10 #define _MP_model_hpp_
20 #include <CoinPackedVector.hpp>
21 class OsiSolverInterface;
38 virtual void logMessage(
int level,
const char *
const msg){}
43 virtual void statistics(
int bm,
int m,
int bn,
int n,
int nz) {}
55 virtual void statistics(
int bm,
int m,
int bn,
int n,
int nz);
190 void attach(OsiSolverInterface *solver = 0);
234 typedef std::set<MP_variable* >::iterator
varIt;
235 typedef std::set<MP_constraint* >::iterator
conIt;
244 static void assemble(vector<MP::Coef>& v, vector<MP::Coef>& av);
void attach(OsiSolverInterface *solver=0)
attaches the symantic representation of a model and data to a particular OsiSolverInterface ...
static void assemble(vector< MP::Coef > &v, vector< MP::Coef > &av)
MP_status getStatus() const
Returns the current status of the model-solver interaction. This method will return the current under...
OsiSolverInterface * operator->()
allows access to the OsiSolverInterface *
MP_model & add(MP_constraint &constraint)
Adds a constrataint block to the model.
virtual void constraintDebug(string name, const vector< MP::Coef > &cfs)
virtual void constraintDebug(string name, const vector< MP::Coef > &cfs)
Symbolic representation of a linear expression.This is one of the main public interface classes...
MP_model(OsiSolverInterface *s, Messenger *m=new NormalMessenger)
Constructs an MP_model from an OsiSolverInterface *.
std::ostream & operator<<(std::ostream &os, const MP_model::MP_status &condition)
allows print of result from call to solve();
static MP_model * getCurrentModel()
double getInfinity() const
std::set< MP_constraint * >::iterator conIt
Messenger * getMessenger()
std::set< MP_variable * >::iterator varIt
if the solve method is called and the optimal solution found.
Inteface for hooking up to internal flopc++ message handling.In more advanced use of FlopC++...
virtual void statistics(int bm, int m, int bn, int n, int nz)
virtual void generationTime(double t)
MP_model & operator=(const MP_model &)
void setObjective(const MP_expression &o)
sets the "current objective" to the parameter o
MP_direction
used when calling the solve() method.
static MP_model * current_model
void addRow(const Constraint &constraint)
Adds a constraint to the MP_model.
void verbose()
used to help understanding and debugging FlopC++'s behavior.
This is the anchor point for all constructs in a FlopC++ model.The constructors take an OsiSolverInte...
virtual void statistics(int bm, int m, int bn, int n, int nz)
All flopc++ code is contained within the flopc namespace.
OsiSolverInterface * Solver
MP_model::MP_status solve(const MP_model::MP_direction &dir)
set< MP_variable * > Variables
void silent()
used to silence FlopC++
if solve is called and solver finds the model dual infeasible.
if solve is called and solver finds model primal infeasible.
set< MP_constraint * > Constraints
void minimize_max(MP_set &d, const MP_expression &obj)
Symantic representation of a variable.This is one of the main public interface classes. It should be directly declared by clients of the FlopC++. The parametersof construction are MP_set s which specify the indexes over which the variable is defined.
Representation of a set for indexing into some other construct.This is one of the main public interfa...
A solver is attached, but not yet solved.
virtual void objectiveDebug(const vector< MP::Coef > &cfs)
static MP_model & default_model
static MP_model & getDefaultModel()
virtual void objectiveDebug(const vector< MP::Coef > &cfs)
MP_status
Reflects the state of the solution from solve()
void setSolver(OsiSolverInterface *s)
allows for replacement of the solver used.
virtual void logMessage(int level, const char *const msg)
void detach()
detaches an OsiSolverInterface object from the model. In essence, this will clean up any intermediate...
virtual void generationTime(double t)
Semantic representation of a linear constraint.This is one of the main public interface classes...