OptBCEllipsoid.h
00001 #ifndef OptBCEllipsoid_h
00002 #define OptBCEllipsoid_h
00003
00004 #include "Opt.h"
00005
00006 namespace OPTPP{
00007
00017 class OptBCEllipsoid: public OptimizeClass {
00018 private:
00019 NLP1* mem_nlp;
00020 int nlp_type;
00021
00022 protected:
00024 NLP1* nlprob() const {return mem_nlp;}
00026 double fval_lowbound, fval_upbound;
00028 double initial_radius;
00030 int xscal_flag;
00032 int deepcutflag;
00033
00034 public:
00035
00036
00037
00038
00039
00043 OptBCEllipsoid() {}
00044
00050 OptBCEllipsoid(NLP1* p): OptimizeClass(p->getDim()), mem_nlp(p),
00051 initial_radius(-1.0e0), xscal_flag(0), deepcutflag(0) {nlp_type = 1;}
00052
00059 OptBCEllipsoid(NLP1* p, UPDATEFCN u): OptimizeClass(p->getDim()),
00060 mem_nlp(p), initial_radius(-1.0e0), xscal_flag(0), deepcutflag(0)
00061 {update_fcn = u; nlp_type = 1;}
00062
00069 OptBCEllipsoid(NLP1* p, TOLS t): OptimizeClass(p->getDim(),t),
00070 mem_nlp(p), initial_radius(-1.0e0), xscal_flag(0), deepcutflag(0)
00071 {nlp_type = 1;}
00072
00076 ~OptBCEllipsoid(){}
00077
00078
00079
00080
00081
00082 virtual void acceptStep(int k, int step_type);
00084 virtual int checkConvg();
00085 NEWMAT::ColumnVector computeSearch(NEWMAT::SymmetricMatrix&) {exit(-1); return xprev;}
00086 virtual void optimize();
00087 virtual void readOptInput();
00088
00089 virtual void printStatus(char *);
00090
00091 virtual void updateModel(int k, int ndim, NEWMAT::ColumnVector x)
00092 {OptimizeClass::defaultUpdateModel(k, ndim, x);}
00093 virtual void reset();
00094
00095
00096
00097
00098
00100 virtual void initOpt();
00101
00103 void setInitialEllipsoid(double rad) {initial_radius = rad;}
00104
00106 double computeFeasibility(NEWMAT::ColumnVector&);
00107
00109 NEWMAT::ColumnVector computeConstraintSubgradient(NEWMAT::ColumnVector&);
00110
00112 int infeasibilityStep(NEWMAT::ColumnVector&, NEWMAT::SymmetricMatrix &,
00113 double &);
00114
00116 int halfSpaceStep(NEWMAT::ColumnVector&, NEWMAT::SymmetricMatrix &,double &);
00117
00119 void setXScale(NEWMAT::ColumnVector &x) {OptimizeClass::setXScale(x);
00120 xscal_flag = 1;}
00122 void setDeepCut() {deepcutflag = 1;}
00123
00125 void resetDeepCut() {deepcutflag = 0;}
00126
00128 double computeGamma(double);
00129
00130 };
00131
00132 }
00133
00134 #endif