OptNIPSLike.h

00001 #ifndef OptNIPSLike_h
00002 #define OptNIPSLike_h
00003 
00004 /*----------------------------------------------------------------------
00005  Copyright (c) 2001, Sandia Corporation.   Under the terms of Contract 
00006  DE-AC04-94AL85000, there is a non-exclusive license for use of this 
00007  work by or on behalf of the U.S. Government.
00008 
00009  P.J. Williams, Sandia National Laboratories, pwillia@ca.sandia.gov
00010  ----------------------------------------------------------------------*/
00011 
00012 #ifndef OptConstrNewtonLike_h
00013 #include "OptConstrNewtonLike.h"
00014 #endif
00015 
00016 namespace OPTPP {
00017 
00037 class OptNIPSLike: public OptConstrNewtonLike {
00038  protected:
00039   virtual NLP1* nlprob() const= 0; 
00040   real          beta_;  
00041   real          dirder_; 
00042   real          mu_;    
00043   real          penalty_; 
00044   real          sigmin_; 
00045   real          taumin_; 
00046   const real    rho_;    
00047   const real    sw_;    
00048 
00049  public:
00056   OptNIPSLike(): OptConstrNewtonLike(), beta_(0.0e0), 
00057     dirder_(0.0e0), mu_(0.0e0), penalty_(0.0e0),
00058     sigmin_(0.0e0), taumin_(0.0e0), rho_(0.0e0), sw_(0.0e0)
00059     {strcpy(method,"Nonlinear Interior-Point Method");}
00063   OptNIPSLike(int n): OptConstrNewtonLike(n), beta_(0.0e0), 
00064     dirder_(0.0e0), mu_(0.0e0), penalty_(1.0e2),
00065     sigmin_(0.1e0), taumin_(0.95e0), rho_(5.0e-1), sw_(1.0e2)
00066     { strcpy(method,"Nonlinear Interior-Point Method"); }
00071   OptNIPSLike(int n, UPDATEFCN u): OptConstrNewtonLike(n,u), beta_(0.0e0), 
00072     dirder_(0.0e0), mu_(0.0e0), penalty_(1.0e2),
00073     sigmin_(0.1e0), taumin_(0.95e0), rho_(5.0e-1), sw_(1.0e2)
00074     { strcpy(method,"Nonlinear Interior-Point Method"); }
00079   OptNIPSLike(int n, TOLS t): OptConstrNewtonLike(n,t), beta_(0.0e0), 
00080     dirder_(0.0e0), mu_(0.0e0), penalty_(1.0e2),
00081     sigmin_(0.1e0), taumin_(0.95e0), rho_(5.0e-1), sw_(1.0e2)
00082     { strcpy(method,"Nonlinear Interior-Point Method"); }
00083 
00087   virtual ~OptNIPSLike(){}
00088 
00089 //-------------------------------------------------------------------
00090 // Virtual Functions 
00091 //-------------------------------------------------------------------
00092 
00093   virtual void setMeritFcn(MeritFcn option);
00094   virtual NEWMAT::Matrix setupMatrix(const NEWMAT::ColumnVector& xc);
00095   virtual real merit(int flag, const NEWMAT::ColumnVector& xc, const NEWMAT::ColumnVector& yc,
00096                      NEWMAT::ColumnVector& zc, NEWMAT::ColumnVector& sc);
00097   virtual NEWMAT::ColumnVector setupRHS(const NEWMAT::ColumnVector& xc, real mu);
00098   virtual NEWMAT::ColumnVector setupRHS(const NEWMAT::ColumnVector& xplus,
00099                                 const NEWMAT::ColumnVector& yplus,
00100                                 const NEWMAT::ColumnVector& zplus,
00101                                 const NEWMAT::ColumnVector& splus, real mu);
00102 
00103   virtual NEWMAT::SymmetricMatrix updateH(NEWMAT::SymmetricMatrix& H, int k) = 0;
00104 
00105   virtual int checkConvg();
00106   virtual int checkDeriv();
00107   virtual int computeStep(NEWMAT::ColumnVector step);
00108 
00109   virtual void initOpt();               
00110   virtual void initHessian();           
00111   virtual void optimize();              
00112   virtual void printStatus(char *s);    
00113   virtual void readOptInput();          
00114 
00115 //-------------------------------------------------------------------
00116 // Accessor Methods
00117 //-------------------------------------------------------------------
00118 
00122   real getMu() const { return mu_;}
00126   void setMu(real newMu) { mu_ = newMu;}
00127 
00131   void setCenteringParameter(real newSigma) { sigmin_ = newSigma;}
00132 
00136   void setStepLengthToBdry(real newTau) { taumin_ = newTau;}
00137 
00138 //-------------------------------------------------------------------
00139 // These are used by the derived classes 
00140 //-------------------------------------------------------------------
00141 
00146   virtual void reset();
00147 
00148   void recoverFeasibility(NEWMAT::ColumnVector xinit, CompoundConstraint* constraints, 
00149                           double ftol);
00150   NEWMAT::ColumnVector computeSearch2(NEWMAT::Matrix& Jacobian, const NEWMAT::ColumnVector& rhs);
00157   NEWMAT::ColumnVector initMultipliers(const NEWMAT::ColumnVector& df, NEWMAT::Matrix& dcon);
00158 
00163   void updateMu(int k);
00164 
00175   real merit2(int flag, const NEWMAT::ColumnVector& xc, const NEWMAT::ColumnVector& yc,
00176               NEWMAT::ColumnVector& zc, NEWMAT::ColumnVector& sc);
00186   real merit3(int flag, const NEWMAT::ColumnVector& xc, NEWMAT::ColumnVector& zc,
00187               NEWMAT::ColumnVector& sc);
00188 
00195   void computeDirDeriv(NEWMAT::ColumnVector& sk, const NEWMAT::ColumnVector& xc,
00196                        NEWMAT::ColumnVector& derivative);
00201   double dampenStep(NEWMAT::ColumnVector& step);
00202 
00203 };
00204 
00205 } // namespace OPTPP
00206 
00207 #endif
Generated on Mon Jan 24 12:04:37 2011 for FASTlib by  doxygen 1.6.3