- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# /home/coin/SVN-release/Ipopt-3.5.1/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 1065 2007-08-06 21:19:49Z 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       PRIMAL_AND_FULL_ALPHA_FOR_Y,
    00245       DUAL_AND_FULL_ALPHA_FOR_Y,
    00246       LSACCEPTOR_ALPHA_FOR_Y
    00247     };
    00252     AlphaForYEnum alpha_for_y_;
    00253
    00256     Number alpha_for_y_tol_;
    00257
    00261     Number soft_resto_pderror_reduction_factor_;
    00265     Index max_soft_resto_iters_;
    00266
    00268     bool magic_steps_;
    00271     bool accept_every_trial_step_;
    00276     bool expect_infeasible_problem_;
    00281     Number expect_infeasible_problem_ctol_;
    00282
    00284     Number tiny_step_tol_;
    00285
    00290     Number tiny_step_y_tol_;
    00291
    00293     Index watchdog_trial_iter_max_;
    00295     Index watchdog_shortened_iter_trigger_;
    00296
    00299     bool start_with_resto_;
    00301
    00305     bool in_watchdog_;
    00307     Index watchdog_shortened_iter_;
    00309     Index watchdog_trial_iter_;
    00311     Number watchdog_alpha_primal_test_;
    00313     SmartPtr<const IteratesVector> watchdog_iterate_;
    00315     SmartPtr<const IteratesVector> watchdog_delta_;
    00317     Number last_mu_;
    00319
    00323     SmartPtr<const IteratesVector> acceptable_iterate_;
    00324     Index acceptable_iteration_number_;
    00326
    00329     bool fallback_activated_;
    00330
    00335     bool rigorous_;
    00336
    00339     bool skipped_line_search_;
    00340
    00345     bool in_soft_resto_phase_;
    00346
    00349     Index soft_resto_counter_;
    00350
    00353     Index count_successive_shortened_steps_;
    00354
    00357     bool tiny_step_last_iteration_;
    00358
    00361     SmartPtr<BacktrackingLSAcceptor> acceptor_;
    00362     SmartPtr<RestorationPhase> resto_phase_;
    00363     SmartPtr<ConvergenceCheck> conv_check_;
    00365   };
    00366
    00367 } // namespace Ipopt
    00368
    00369 #endif