ConstraintBase.h
00001 #ifndef ConstraintBase_h
00002 #define ConstraintBase_h
00003
00004
00005
00006
00007
00008
00009
00010 #include <iostream>
00011
00012 #include "globals.h"
00013
00014 #include "include.h"
00015 #include "newmatap.h"
00016 #include "precisio.h"
00017
00018 #include "BoolVector.h"
00019 #include "OptppArray.h"
00020 #include "OptppExceptions.h"
00021 #include "OptppFatalError.h"
00022
00023 double const MIN_BND = -FLT_MAX;
00024 double const MAX_BND = FLT_MAX;
00025 double const BIG_BND = 1.0e10;
00026
00036 namespace OPTPP {
00037
00038 class ConstraintBase {
00039
00040 public:
00044 virtual ~ConstraintBase() {}
00045
00046
00047
00051 virtual int getNumOfCons() const = 0;
00052
00056 virtual int getNumOfVars() const = 0;
00057
00061 virtual NEWMAT::ColumnVector getLower() const = 0;
00062
00066 virtual NEWMAT::ColumnVector getUpper() const = 0;
00067
00071 virtual NEWMAT::ColumnVector getConstraintType() const = 0;
00072
00076 virtual NEWMAT::ColumnVector getConstraintValue() const = 0;
00077
00081 virtual NEWMAT::ColumnVector getConstraintViolation() const = 0;
00082
00086 virtual OptppArray<int> getConstraintMappingIndices() const = 0;
00087
00093 virtual NEWMAT::ColumnVector evalResidual(const NEWMAT::ColumnVector& xcurrent) const = 0;
00094 virtual void evalCFGH(const NEWMAT::ColumnVector& xcurrent) const = 0;
00095
00101 virtual NEWMAT::Matrix evalGradient(const NEWMAT::ColumnVector& xcurrent) const = 0;
00102
00108 virtual NEWMAT::SymmetricMatrix evalHessian(NEWMAT::ColumnVector& xcurrent) const = 0;
00109
00116 virtual OptppArray<NEWMAT::SymmetricMatrix> evalHessian(NEWMAT::ColumnVector& xcurrent, int darg) const = 0;
00117
00124 virtual bool amIFeasible(const NEWMAT::ColumnVector& xcurrent, double epsilon) const = 0;
00125 };
00126
00127 }
00128 #endif