IpBacktrackingLineSearch.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2004, 2006 International Business Machines and others.
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // $Id: IpBacktrackingLineSearch.hpp 759 2006-07-07 03:07:08Z andreasw $
00006 //
00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
00008 //           Andreas Waechter                 IBM    2005-10-13
00009 //               derived file from IpFilterLineSearch.hpp
00010 
00011 #ifndef __IPBACKTRACKINGLINESEARCH_HPP__
00012 #define __IPBACKTRACKINGLINESEARCH_HPP__
00013 
00014 #include "IpLineSearch.hpp"
00015 #include "IpBacktrackingLSAcceptor.hpp"
00016 #include "IpRestoPhase.hpp"
00017 #include "IpConvCheck.hpp"
00018 
00019 namespace Ipopt
00020 {
00021 
00036   class BacktrackingLineSearch : public LineSearch
00037   {
00038   public:
00050     BacktrackingLineSearch(const SmartPtr<BacktrackingLSAcceptor>& acceptor,
00051                            const SmartPtr<RestorationPhase>& resto_phase,
00052                            const SmartPtr<ConvergenceCheck>& conv_check
00053                           );
00054 
00056     virtual ~BacktrackingLineSearch();
00058 
00060     virtual bool InitializeImpl(const OptionsList& options,
00061                                 const std::string& prefix);
00062 
00066     virtual void FindAcceptableTrialPoint();
00067 
00074     virtual void Reset();
00075 
00087     virtual void SetRigorousLineSearch(bool rigorous)
00088     {
00089       rigorous_ = rigorous;
00090     }
00091 
00096     virtual bool CheckSkippedLineSearch()
00097     {
00098       return skipped_line_search_;
00099     }
00100 
00103     virtual bool ActivateFallbackMechanism();
00104 
00107     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
00109 
00110   private:
00120     BacktrackingLineSearch(const BacktrackingLineSearch&);
00121 
00123     void operator=(const BacktrackingLineSearch&);
00125 
00130     bool DoBacktrackingLineSearch(bool skip_first_trial_point,
00131                                   Number& alpha_primal,
00132                                   bool& corr_taken,
00133                                   bool& soc_taken,
00134                                   Index& n_steps,
00135                                   bool& evaluation_error,
00136                                   SmartPtr<IteratesVector>& actual_delta);
00137 
00140     void StartWatchDog();
00141 
00144     void StopWatchDog(SmartPtr<IteratesVector>& actual_delta);
00145 
00151     bool CheckAcceptabilityOfTrialPoint(Number alpha_primal);
00152 
00154     //ToDo This should probably not be a static member function if we want to
00155     //     allow for different relaxation parameters values
00156     static bool Compare_le(Number lhs, Number rhs, Number BasVal);
00157 
00163     void PerformDualStep(Number alpha_primal,
00164                          Number alpha_dual,
00165                          SmartPtr<IteratesVector>& delta);
00166 
00176     bool TrySoftRestoStep(SmartPtr<IteratesVector>& actual_delta,
00177                           bool &satisfies_original_criterion);
00178 
00190     bool TrySecondOrderCorrection(Number alpha_primal_test,
00191                                   Number& alpha_primal,
00192                                   SmartPtr<IteratesVector>& actual_delta);
00193 
00200     bool TryCorrector(Number alpha_primal_test,
00201                       Number& alpha_primal,
00202                       SmartPtr<IteratesVector>& actual_delta);
00203 
00208     void PerformMagicStep();
00209 
00213     bool DetectTinyStep();
00214 
00216     void StoreAcceptablePoint();
00217 
00220     bool RestoreAcceptablePoint();
00221 
00226     bool CurrentIsAcceptable();
00227 
00232     Number alpha_red_factor_;
00233 
00235     enum AlphaForYEnum {
00236       PRIMAL_ALPHA_FOR_Y=0,
00237       DUAL_ALPHA_FOR_Y,
00238       MIN_ALPHA_FOR_Y,
00239       MAX_ALPHA_FOR_Y,
00240       FULL_STEP_FOR_Y,
00241       MIN_DUAL_INFEAS_ALPHA_FOR_Y,
00242       SAFE_MIN_DUAL_INFEAS_ALPHA_FOR_Y
00243     };
00248     AlphaForYEnum alpha_for_y_;
00249 
00253     Number soft_resto_pderror_reduction_factor_;
00257     Index max_soft_resto_iters_;
00258 
00260     bool magic_steps_;
00263     bool accept_every_trial_step_;
00268     bool expect_infeasible_problem_;
00273     Number expect_infeasible_problem_ctol_;
00274 
00276     Number tiny_step_tol_;
00277 
00282     Number tiny_step_y_tol_;
00283 
00285     Index watchdog_trial_iter_max_;
00287     Index watchdog_shortened_iter_trigger_;
00288 
00291     bool start_with_resto_;
00293 
00297     bool in_watchdog_;
00299     Index watchdog_shortened_iter_;
00301     Index watchdog_trial_iter_;
00303     Number watchdog_alpha_primal_test_;
00305     SmartPtr<const IteratesVector> watchdog_iterate_;
00307     SmartPtr<const IteratesVector> watchdog_delta_;
00309     Number last_mu_;
00311 
00315     SmartPtr<const IteratesVector> acceptable_iterate_;
00316     Index acceptable_iteration_number_;
00318 
00321     bool fallback_activated_;
00322 
00327     bool rigorous_;
00328 
00331     bool skipped_line_search_;
00332 
00337     bool in_soft_resto_phase_;
00338 
00341     Index soft_resto_counter_;
00342 
00345     Index count_successive_shortened_steps_;
00346 
00349     bool tiny_step_last_iteration_;
00350 
00353     SmartPtr<BacktrackingLSAcceptor> acceptor_;
00354     SmartPtr<RestorationPhase> resto_phase_;
00355     SmartPtr<ConvergenceCheck> conv_check_;
00357   };
00358 
00359 } // namespace Ipopt
00360 
00361 #endif

Generated on Fri Sep 26 07:44:11 2008 for SimTKcore by  doxygen 1.5.6