/home/coin/SVN-release/Ipopt-3.3.2/Ipopt/src/Algorithm/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 1020 2007-06-24 04:06:59Z 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     {
00237       PRIMAL_ALPHA_FOR_Y=0,
00238       DUAL_ALPHA_FOR_Y,
00239       MIN_ALPHA_FOR_Y,
00240       MAX_ALPHA_FOR_Y,
00241       FULL_STEP_FOR_Y,
00242       MIN_DUAL_INFEAS_ALPHA_FOR_Y,
00243       SAFE_MIN_DUAL_INFEAS_ALPHA_FOR_Y
00244     };
00249     AlphaForYEnum alpha_for_y_;
00250 
00254     Number soft_resto_pderror_reduction_factor_;
00258     Index max_soft_resto_iters_;
00259 
00261     bool magic_steps_;
00264     bool accept_every_trial_step_;
00269     bool expect_infeasible_problem_;
00274     Number expect_infeasible_problem_ctol_;
00275 
00277     Number tiny_step_tol_;
00278 
00283     Number tiny_step_y_tol_;
00284 
00286     Index watchdog_trial_iter_max_;
00288     Index watchdog_shortened_iter_trigger_;
00289 
00292     bool start_with_resto_;
00294 
00298     bool in_watchdog_;
00300     Index watchdog_shortened_iter_;
00302     Index watchdog_trial_iter_;
00304     Number watchdog_alpha_primal_test_;
00306     SmartPtr<const IteratesVector> watchdog_iterate_;
00308     SmartPtr<const IteratesVector> watchdog_delta_;
00310     Number last_mu_;
00312 
00316     SmartPtr<const IteratesVector> acceptable_iterate_;
00317     Index acceptable_iteration_number_;
00319 
00322     bool fallback_activated_;
00323 
00328     bool rigorous_;
00329 
00332     bool skipped_line_search_;
00333 
00338     bool in_soft_resto_phase_;
00339 
00342     Index soft_resto_counter_;
00343 
00346     Index count_successive_shortened_steps_;
00347 
00350     bool tiny_step_last_iteration_;
00351 
00354     SmartPtr<BacktrackingLSAcceptor> acceptor_;
00355     SmartPtr<RestorationPhase> resto_phase_;
00356     SmartPtr<ConvergenceCheck> conv_check_;
00358   };
00359 
00360 } // namespace Ipopt
00361 
00362 #endif

Generated on Thu May 15 22:27:51 2008 by  doxygen 1.4.7