- Main Page
- Classes
- Files

- File List
- File Members

# src/contrib/CGPenalty/IpCGPerturbationHandler.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2005, 2008 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Eclipse Public License.
    00004 //
    00005 // $Id: IpCGPerturbationHandler.hpp 1861 2010-12-21 21:34:47Z andreasw $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter              IBM    2005-08-04
    00008
    00009 #ifndef __IPCGPERTURBATIONHANDLER_HPP__
    00010 #define __IPCGPERTURBATIONHANDLER_HPP__
    00011
    00012 #include "IpPDPerturbationHandler.hpp"
    00013 #include "IpCGPenaltyCq.hpp"
    00014
    00015 namespace Ipopt
    00016 {
    00017
    00025   class CGPerturbationHandler: public PDPerturbationHandler
    00026   {
    00027   public:
    00031     CGPerturbationHandler();
    00033     virtual ~CGPerturbationHandler()
    00034     {}
    00036
    00037     /* overloaded from AlgorithmStrategyObject */
    00038     virtual bool InitializeImpl(const OptionsList& options,
    00039                                 const std::string& prefix);
    00040
    00047     bool ConsiderNewSystem(Number& delta_x, Number& delta_s,
    00048                            Number& delta_c, Number& delta_d);
    00049
    00054     bool PerturbForSingularity(Number& delta_x, Number& delta_s,
    00055                                Number& delta_c, Number& delta_d);
    00056
    00061     bool PerturbForWrongInertia(Number& delta_x, Number& delta_s,
    00062                                 Number& delta_c, Number& delta_d);
    00063
    00066     void CurrentPerturbation(Number& delta_x, Number& delta_s,
    00067                              Number& delta_c, Number& delta_d);
    00068
    00071     static void RegisterOptions(SmartPtr<RegisteredOptions> roptions);
    00073
    00074   private:
    00084     CGPerturbationHandler(const CGPerturbationHandler&);
    00085
    00087     void operator=(const CGPerturbationHandler&);
    00089
    00091     CGPenaltyData& CGPenData()
    00092     {
    00093       CGPenaltyData& cg_pen_data =
    00094         static_cast<CGPenaltyData&>(IpData().AdditionalData());
    00095       DBG_ASSERT(dynamic_cast<CGPenaltyData*>(&IpData().AdditionalData()));
    00096       return cg_pen_data;
    00097     }
    00098
    00100     CGPenaltyCq& CGPenCq()
    00101     {
    00102       CGPenaltyCq& cg_pen_cq =
    00103         static_cast<CGPenaltyCq&>(IpCq().AdditionalCq());
    00104       DBG_ASSERT(dynamic_cast<CGPenaltyCq*>(&IpCq().AdditionalCq()));
    00105       return cg_pen_cq;
    00106     }
    00107
    00111     Number delta_x_last_;
    00113     Number delta_s_last_;
    00115     Number delta_c_last_;
    00117     Number delta_d_last_;
    00119
    00124     Number delta_x_curr_;
    00126     Number delta_s_curr_;
    00128     Number delta_c_curr_;
    00130     Number delta_d_curr_;
    00132
    00135     bool get_deltas_for_wrong_inertia_called_;
    00136
    00140     enum DegenType
    00141     {
    00142       NOT_YET_DETERMINED,
    00143       NOT_DEGENERATE,
    00144       DEGENERATE
    00145     };
    00146
    00149     DegenType hess_degenerate_;
    00150
    00153     DegenType jac_degenerate_;
    00154
    00158     Index degen_iters_;
    00159
    00161     enum TrialStatus
    00162     {
    00163       NO_TEST,
    00164       TEST_DELTA_C_EQ_0_DELTA_X_EQ_0,
    00165       TEST_DELTA_C_GT_0_DELTA_X_EQ_0,
    00166       TEST_DELTA_C_EQ_0_DELTA_X_GT_0,
    00167       TEST_DELTA_C_GT_0_DELTA_X_GT_0
    00168     };
    00169
    00171     TrialStatus test_status_;
    00173
    00177     Number delta_xs_max_;
    00179     Number delta_xs_min_;
    00181     Number delta_xs_first_inc_fact_;
    00183     Number delta_xs_inc_fact_;
    00185     Number delta_xs_dec_fact_;
    00187     Number delta_xs_init_;
    00189     Number delta_cd_val_;
    00191     Number delta_cd_exp_;
    00195     bool reset_last_;
    00197     Index degen_iters_max_;
    00200     bool perturb_always_cd_;
    00202
    00204     Number penalty_max_;
    00206     Number mult_diverg_feasibility_tol_;
    00207
    00213     bool get_deltas_for_wrong_inertia(Number& delta_x, Number& delta_s,
    00214                                       Number& delta_c, Number& delta_d);
    00215
    00219     void finalize_test();
    00221     Number delta_cd();
    00223
    00224   };
    00225
    00226 } // namespace Ipopt
    00227
    00228 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines