source: branches/dev/Algorithm/IpBacktrackingLSAcceptor.hpp @ 542

Last change on this file since 542 was 542, checked in by andreasw, 14 years ago
  • cleaned up line search to allow for alternative globalization scheme
File size: 5.3 KB
Line 
1// Copyright (C) 2004,2005 International Business Machines and others.
2// All Rights Reserved.
3// This code is published under the Common Public License.
4//
5// $Id: IpFilterLineSearch.hpp 501 2005-08-26 15:43:07Z claird $
6//
7// Authors:  Carl Laird, Andreas Waechter     IBM    2004-08-13
8//           Andreas Waechter                 IBM    2005-10-13
9//               derived file from IpFilterLineSearch.hpp
10
11#ifndef __IPBACKTRACKINGLSACCEPTOR_HPP__
12#define __IPBACKTRACKINGLSACCEPTOR_HPP__
13
14#include "IpAlgStrategy.hpp"
15
16namespace Ipopt
17{
18
19  /** Base class for backtracking line search acceptors.
20   */
21  class BacktrackingLSAcceptor : public AlgorithmStrategyObject
22  {
23  public:
24    /**@name Constructors/Destructors */
25    //@{
26    /** Constructor. */
27    BacktrackingLSAcceptor()
28    {}
29
30    /** Default destructor */
31    virtual ~BacktrackingLSAcceptor()
32    {}
33    //@}
34
35    /** InitializeImpl - overloaded from AlgorithmStrategyObject */
36    virtual bool InitializeImpl(const OptionsList& options,
37                                const std::string& prefix)=0;
38
39    /** Reset the acceptor.
40     *  This function should be called if all previous information
41     *  should be discarded when the line search is performed the
42     *  next time.  For example, this method should be called if
43     *  the barrier parameter is changed.
44     */
45    virtual void Reset()=0;
46
47    /** Initialization for the next line search.  The flag in_watchdog
48     *  indicates if we are currently in an active watchdog
49     *  procedure. */
50    virtual void InitThisLineSearch(bool in_watchdog)=0;
51
52    /** Method that is called before the restoration phase is called.
53     *  Here, we can set up things that are required in the
54     *  termination test for the restoration phase, such as augmenting
55     *  a filter. */
56    virtual void PrepareRestoPhaseStart()=0;
57
58    /** Method returning the lower bound on the trial step sizes.  If
59     *  the backtracking procedure encounters a trial step size below
60     *  this value after the first trial set, it swtiches to the
61     *  (soft) restoration phase. */
62    virtual Number CalculateAlphaMin()=0;
63
64    /** Method for checking if current trial point is acceptable.  It
65     *  is assumed that the delta information in ip_data is the search
66     *  direction used in criteria.  The primal trial point has to be
67     *  set before the call.  alpha_primal is the step size which is
68     *  to be used for the test; if it is zero, then this method is
69     *  called during the soft restoration phase.
70     */
71    virtual bool CheckAcceptabilityOfTrialPoint(Number alpha_primal)=0;
72
73    /** Try a second order correction for the constraints.  If the
74     *  first trial step (with incoming alpha_primal) has been reject,
75     *  this tries second order corrections, e.g., for the
76     *  constraints.  Here, alpha_primal_test is the step size that
77     *  has to be used in the filter acceptance tests.  On output
78     *  actual_delta_ has been set to the step including the
79     *  second order correction if it has been accepted, otherwise it
80     *  is unchanged.  If the SOC step has been accepted, alpha_primal
81     *  has the fraction-to-the-boundary value for the SOC step on output.
82     *  The return value is true, if a SOC step has been accepted.
83     */
84    virtual bool TrySecondOrderCorrection(Number alpha_primal_test,
85                                          Number& alpha_primal,
86                                          SmartPtr<IteratesVector>& actual_delta)=0;
87
88    /** Try higher order corrector (for fast local convergence).  In
89     *  contrast to a second order correction step, which tries to
90     *  make an unacceptable point acceptable by improving constraint
91     *  violation, this corrector step is tried even if the regular
92     *  primal-dual step is acceptable.
93     */
94    virtual bool TryCorrector(Number alpha_primal_test,
95                              Number& alpha_primal,
96                              SmartPtr<IteratesVector>& actual_delta)=0;
97
98    /** Method for ending the current line search.  When it is called,
99     *  the internal data should be updates, e.g., the filter might be
100     *  augmented.  alpha_primal_test is the value of alpha that has
101     *  been used for in the acceptence test ealier.  Return value is
102     *  a character for the info_alpha_primal_char field in IpData. */
103    virtual char UpdateForNextIteration(Number alpha_primal_test)=0;
104
105    /** Method for setting internal data if the watchdog procedure is
106     *  started. */
107    virtual void StartWatchDog()=0;
108
109    /** Method for setting internal data if the watchdog procedure is
110     *  stopped. */
111    virtual void StopWatchDog()=0;
112
113    /** Methods for OptionsList */
114    //@{
115    static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
116    //@}
117
118  private:
119    /**@name Default Compiler Generated Methods
120     * (Hidden to avoid implicit creation/calling).
121     * These methods are not implemented and
122     * we do not want the compiler to implement
123     * them for us, so we declare them private
124     * and do not define them. This ensures that
125     * they will not be implicitly created/called. */
126    //@{
127    /** Copy Constructor */
128    BacktrackingLSAcceptor(const BacktrackingLSAcceptor&);
129
130    /** Overloaded Equals Operator */
131    void operator=(const BacktrackingLSAcceptor&);
132    //@}
133  };
134
135} // namespace Ipopt
136
137#endif
Note: See TracBrowser for help on using the repository browser.