NLP1.h

00001 #ifndef NLP1_h
00002 #define NLP1_h
00003 
00004 #include "NLP0.h"
00005 
00006 using std::ostream;
00007 
00020 namespace OPTPP {
00021 
00022 class NLP1: public NLP0 {
00023 protected:
00025   NEWMAT::ColumnVector mem_grad;        
00027   int          ngevals;         
00029   int          analytic_grad;
00030 
00031 public:
00032 // Constructors
00039   NLP1(): 
00040     NLP0(), mem_grad(0), ngevals(0) {;}
00046   NLP1(int ndim): 
00047     NLP0(ndim), mem_grad(ndim), ngevals(0) {;}
00054   NLP1(int ndim,int nlncons): 
00055     NLP0(ndim, nlncons), mem_grad(ndim), ngevals(0) {;}
00062   NLP1(int ndim, CompoundConstraint* constraint): 
00063     NLP0(ndim, constraint), mem_grad(ndim), ngevals(0) {;}
00064 
00068   virtual ~NLP1() {;}                     
00069 
00073   void setGrad(const NEWMAT::ColumnVector& set_grad) {mem_grad = set_grad;}
00074 
00078   NEWMAT::ColumnVector getGrad() const {return mem_grad;}
00079 
00083   int getGevals()        const {return ngevals;}
00084 
00088   int AnalyticGrad()     const {return analytic_grad;}
00089 
00091   virtual void reset() = 0;   
00092 
00094   virtual void initFcn() = 0;   
00095   virtual real evalF() = 0;
00096   virtual real evalF(const NEWMAT::ColumnVector& x) = 0;
00097   virtual void eval()  = 0;
00098 
00100   virtual NEWMAT::ColumnVector evalG() = 0;
00101   virtual NEWMAT::ColumnVector evalG(const NEWMAT::ColumnVector& x) = 0;
00102 
00104   virtual NEWMAT::SymmetricMatrix evalH() = 0;
00105   virtual NEWMAT::SymmetricMatrix evalH(NEWMAT::ColumnVector& x) = 0;
00106   virtual NEWMAT::SymmetricMatrix FDHessian(NEWMAT::ColumnVector& x);
00107 
00108 
00110   virtual real evalLagrangian(const NEWMAT::ColumnVector& x, NEWMAT::ColumnVector& mult,
00111     const NEWMAT::ColumnVector& type) = 0;
00112   virtual NEWMAT::ColumnVector evalLagrangianGradient(const NEWMAT::ColumnVector& x,
00113     const NEWMAT::ColumnVector& mult, const NEWMAT::ColumnVector& type) = 0;
00114 
00116   virtual NEWMAT::ColumnVector evalCF(const NEWMAT::ColumnVector& x) = 0;
00117   virtual NEWMAT::Matrix evalCG(const NEWMAT::ColumnVector& x) = 0;
00118   virtual NEWMAT::SymmetricMatrix evalCH(NEWMAT::ColumnVector& x) = 0;
00119   virtual OptppArray<NEWMAT::SymmetricMatrix> evalCH(NEWMAT::ColumnVector& x, int darg) = 0;
00120   virtual void evalC(const NEWMAT::ColumnVector& x) = 0;
00121 
00123   virtual OptppArray<NEWMAT::SymmetricMatrix> CONFDHessian(NEWMAT::ColumnVector& x);
00124 
00126   virtual void printState(char* s);   
00127   virtual void fPrintState(ostream *nlpout, char* s);   
00128 
00129 };
00130 
00131 } // namespace OPTPP
00132 #endif
Generated on Mon Jan 24 12:04:37 2011 for FASTlib by  doxygen 1.6.3