10 #define _MP_model_hpp_
37 virtual void logMessage(
int level,
const char *
const msg){}
42 virtual void statistics(
int bm,
int m,
int bn,
int n,
int nz) {}
54 virtual void statistics(
int bm,
int m,
int bn,
int n,
int nz);
64 virtual void constraintDebug(std::string name,
const std::vector<Coef>& cfs);
239 typedef std::set<MP_variable* >::iterator
varIt;
240 typedef std::set<MP_constraint* >::iterator
conIt;
249 static void assemble(std::vector<Coef>& v, std::vector<Coef>& av);
A solver is placed in the constructor, but it is not yet attached or solved.
This is the anchor point for all constructs in a FlopC++ model.
std::set< MP_variable * > Variables
Messenger * getMessenger()
Gets the current messenger.
void detach()
detaches an OsiSolverInterface object from the model.
virtual void statistics(int bm, int m, int bn, int n, int nz)
static MP_model * current_model
Internal use: used when Verbose output is selected.
static MP_model & default_model
Internal use: used when Normal output is selected.
virtual void generationTime(double t)
std::ostream & operator<<(std::ostream &os, const MP_model::MP_status &condition)
allows print of result from call to solve();
MP_direction
used when calling the solve() method.
virtual void objectiveDebug(const std::vector< Coef > &cfs)
MP_model::MP_status solve(const MP_model::MP_direction &dir)
calls the appropriate solving methods in the OsiSolverInterface.
void addRow(const Constraint &c)
Adds a constraint to the MP_model.
Semantic representation of a linear constraint.
static MP_model * getCurrentModel()
Can be used to get the current model.
MP_model & operator=(const MP_model &)
virtual void objectiveDebug(const std::vector< Coef > &cfs)
static MP_model & getDefaultModel()
Can be used to get the default model.
std::set< MP_variable * >::iterator varIt
virtual void constraintDebug(std::string name, const std::vector< Coef > &cfs)
void verbose()
used to help understanding and debugging FlopC++'s behavior.
MP_status getStatus() const
Returns the current status of the model-solver interaction.
static void assemble(std::vector< Coef > &v, std::vector< Coef > &av)
if solve is called and solver finds model primal infeasible.
MP_model(OsiSolverInterface *s, Messenger *m=new NormalMessenger)
Constructs an MP_model from an OsiSolverInterface *.
std::set< MP_constraint * > Constraints
A solver is attached, but not yet solved.
Representation of a set for indexing into some other construct.
Inteface for hooking up to internal flopc++ message handling.
virtual void generationTime(double t)
Symantic representation of a variable.
const double * reducedCost
const double * rowActivity
std::set< MP_constraint * >::iterator conIt
Abstract Base Class for describing an interface to a solver.
void silent()
used to silence FlopC++
MP_model & add(MP_constraint &c)
Adds a constrataint block to the model.
void setSolver(OsiSolverInterface *s)
allows for replacement of the solver used.
Symbolic representation of a linear expression.
OsiSolverInterface * Solver
virtual void constraintDebug(std::string name, const std::vector< Coef > &cfs)
void attach(OsiSolverInterface *solver=NULL)
attaches the symantic representation of a model and data to a particular OsiSolverInterface ...
void maximize()
Binds the data and calls the solver to maximize the current objective expression. ...
MP_status
Reflects the state of the solution from solve()
if solve is called and solver finds the model dual infeasible.
OsiSolverInterface * operator->()
allows access to the OsiSolverInterface *
if solve is called and solver abandons the problem (time?, iter limit?)
virtual void logMessage(int level, const char *const msg)
virtual void statistics(int bm, int m, int bn, int n, int nz)
void minimize()
Binds the data and calls the solver to minimize the current objective expression. ...
double getInfinity() const
Useful for getting an appropriate value to pass in as "infinity".
void minimize_max(MP_set &d, const MP_expression &obj)
Binds the data and calls the solver to minimize maximum value of the parameter obj objective expressi...
if the solve method is called and the optimal solution found.
Semantic representation of a constraint in a Math Program.
void setObjective(const MP_expression &o)
sets the "current objective" to the parameter o
const double * solution
Accessors for the results after a call to maximize()/minimize()