MINLPData.h

Go to the documentation of this file.
00001 // Copyright (C) 2006 Ivo Nowak and Stefan Vigerske
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Author: Stefan Vigerske
00006 
00007 #ifndef _MINLPDATA_H_
00008 #define _MINLPDATA_H_
00009 
00010 #include "standard.h"
00011 #include "func.h"
00012 #include "problem.h"
00013 
00014 #include <string>
00015 
00016 class MINLP;
00017 
00018 class MinlpOpt;
00019 class Reformulation;
00020 class LinearizedConCutGenerator;
00021 class PolynomialUnderestimator2;
00022 class QuadraticUnderestimator;
00023 
00026 class MINLPData {
00027         friend class MINLP;
00028         friend class MinlpOpt;
00029         friend class Reformulation;
00030         friend class LinearizedConCutGenerator;
00031         friend class PolynomialUnderestimator2;
00032         friend class QuadraticUnderestimator;
00033 private:
00036         class ObjCon {
00037         public:
00040                 string name;
00043                 Pointer<SepQcFunc> func;
00046                 SepQcFunc::ftype functype;
00049                 Func::CurvatureType curvtype;
00050                 
00053                 Pointer<SepQcFunc> polynomial_underestimator;
00056                 map<int, double> polynomial_approx_constants_lower;
00057                 
00060                 map<int, double> convexification_characteristica_lower;
00061                 
00064                 Pointer<SepQcFunc> convex_underestimator;
00065                 
00068                 map<int, int> reformulation_constraints_lower;
00069                 
00070                 ObjCon(const Pointer<SepQcFunc>& func_, const string& name_=string());
00071                 
00072                 ObjCon()
00073                 : functype(SepQcFunc::CONSTANT), curvtype(Func::LINEAR)
00074                 { }
00075                 
00076                 friend ostream& operator<<(ostream& out, const ObjCon& objcon);
00077 
00078                 // TODO: information about usage of blocks, sparsity, relaxations, ...
00079         };
00080         friend ostream& operator<<(ostream& out, const ObjCon& objcon);
00081         
00082 public:
00085         class Variable {
00086         public:
00089                 int index;
00092                 int block_nr;
00095                 int index_in_block;
00096 
00099                 string name;
00100                 
00103                 double lower;
00106                 double upper;
00110                 bool discrete;
00111 
00112                 Variable(int index_, double lower_, double upper_, bool discrete_=false, const string& name_=string())
00113                 : index(index_), block_nr(-1), index_in_block(-1), name(name_), lower(lower_), upper(upper_), discrete(discrete_)
00114                 { }
00115 
00116         };
00117 
00121         class Constraint : public ObjCon {
00122         public:
00125                 int index;
00128                 bool equality;
00129 
00132                 Pointer<SepQcFunc> polynomial_overestimator;
00135                 map<int, double> polynomial_approx_constants_upper;
00136 
00139                 map<int, double> convexification_characteristica_upper;
00142                 Pointer<SepQcFunc> concave_overestimator;
00143 
00144                 map<int, int> reformulation_constraints_upper;
00145 
00148 //              int ineq_index;
00149                 
00150                 Constraint(int index_, const Pointer<SepQcFunc>& func_, bool equality_, const string& name_=string())
00151                 : ObjCon(func_, name_), index(index_), equality(equality_)
00152                 { }
00153 
00154                 friend ostream& operator<<(ostream& out, const Constraint& con);
00155         };
00156         friend ostream& operator<<(ostream& out, const Constraint& con);
00157         
00160         class Objective : public ObjCon {
00161         public:
00162                 Objective(const Pointer<SepQcFunc>& func_, const string& name_=string())
00163                 : ObjCon(func_, name_)
00164                 { }
00165                 
00166                 Objective()
00167                 : ObjCon()
00168                 { }
00169         };
00170         
00171         typedef vector<int> Block;
00172         typedef vector<Block> BlockStructure;
00173         
00174         
00175 private:
00178         string name;
00181         vector<Variable> var;
00182         
00185         vector<Constraint> con;
00186         
00189         Objective obj;
00190         
00193         BlockStructure block;
00194         
00197         vector<int> discrete_var;
00198 
00199 
00200 public:
00201         MINLPData();
00202         MINLPData(const MinlpProblem& prob);
00203         virtual ~MINLPData();
00204 };
00205 
00206 #endif //_MINLPDATA_H_

Generated on Mon Oct 20 03:12:06 2008 for LaGO by  doxygen 1.4.7