NLPBase.h
00001 #ifndef NLPBase_h
00002 #define NLPBase_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifdef HAVE_CONFIG_H
00013 #include "OPT++_config.h"
00014 #endif
00015
00016 #include <iostream>
00017 #include <fstream>
00018 #ifdef HAVE_STD
00019 #include <cstring>
00020 #include <cfloat>
00021 #include <cmath>
00022 #else
00023 #include <string.h>
00024 #include <float.h>
00025 #include <math.h>
00026 #endif
00027
00028 using std::ostream;
00029
00030 #include "globals.h"
00031 #include "precisio.h"
00032 #include "OptppArray.h"
00033 #include "OptppFatalError.h"
00034 #include "OptppExceptions.h"
00035
00036
00037 namespace OPTPP {
00038
00046 class NLPBase{
00047
00048 public:
00049
00050 virtual ~NLPBase() {;}
00051
00052
00053 virtual void setX(const int i, const real& x) = 0;
00054 virtual void setX(const NEWMAT::ColumnVector& x) = 0;
00055
00056 virtual void setF(const real& fx) = 0;
00057
00058 virtual void setIsExpensive(const int e) = 0;
00059
00060 virtual void setFcnAccrcy(const int i, const real& accrcy) = 0;
00061 virtual void setFcnAccrcy(const NEWMAT::ColumnVector& accrcy) = 0;
00062
00063 virtual int getDim() const = 0;
00064 virtual int getFevals() const = 0;
00065 virtual int getIsExpensive() const = 0;
00066 virtual real getF() const = 0;
00067 virtual NEWMAT::ColumnVector getFcnAccrcy() const = 0;
00068 virtual NEWMAT::ColumnVector getXc() const = 0;
00069 virtual real getFcnTime() const = 0;
00070
00071
00072 virtual int getNumOfCons() const = 0;
00073 virtual int getNumOfNLCons() const = 0;
00074 virtual bool hasConstraints() = 0;
00075 virtual void printConstraints() = 0;
00076
00077
00078 virtual void reset() = 0;
00079
00080
00081 virtual void setDebug() = 0;
00082 virtual bool getDebug() const = 0;
00083
00084
00085 virtual void initFcn() = 0;
00086 virtual real evalF() = 0;
00087 virtual real evalF(const NEWMAT::ColumnVector &x) = 0;
00088 virtual NEWMAT::ColumnVector evalG() = 0;
00089 virtual NEWMAT::ColumnVector evalG(const NEWMAT::ColumnVector &x) = 0;
00090 virtual NEWMAT::SymmetricMatrix evalH() = 0;
00091 virtual NEWMAT::SymmetricMatrix evalH(NEWMAT::ColumnVector &x) = 0;
00092 virtual void eval() = 0;
00093
00094
00095 virtual NEWMAT::ColumnVector evalCF(const NEWMAT::ColumnVector &x) = 0;
00096 virtual NEWMAT::Matrix evalCG(const NEWMAT::ColumnVector &x) = 0;
00097 virtual NEWMAT::SymmetricMatrix evalCH(NEWMAT::ColumnVector &x) = 0;
00098 virtual OptppArray<NEWMAT::SymmetricMatrix> evalCH(NEWMAT::ColumnVector &x, int darg) = 0;
00099 virtual void evalC(const NEWMAT::ColumnVector &x) = 0;
00100
00101
00102 virtual void printState(char *s) = 0;
00103 virtual void fPrintState(ostream *nlpout, char *s) = 0;
00104
00105 };
00106
00107 }
00108 #endif