Loading...
Searching...
No Matches
OsiDylpSolverInterface.hpp
Go to the documentation of this file.
#ifndef OsiDylpSolverInterface_H
#define OsiDylpSolverInterface_H
/*
Copyright (C) 2002, 2003, 2004.
Lou Hafer, Stephen Tse, International Business Machines Corporation and
others. All Rights Reserved.
Copyright (C) 2005 -- 2010 Lou Hafer
This file is a portion of the COIN/OSI interface for dylp and is licensed
under the terms of the Eclipse Public License (EPL)
*/
/*
sccs: @(#)OsiDylpSolverInterface.hpp 1.12 09/16/04
cvs: $Id: OsiDylpSolverInterface.hpp 1312 2008-10-10 00:26:32Z lou $
*/
#include "OsiConfig.h"
#include <CoinPackedMatrix.hpp>
#include <OsiSolverInterface.hpp>
#include <CoinWarmStart.hpp>
#include <CoinMessageHandler.hpp>
#include <CoinMpsIO.hpp>
#include <CoinPresolveMatrix.hpp>
#define DYLP_INTERNAL
extern "C" {
#include "dylp.h"
}
class OsiDylpWarmStartBasis ;
typedef enum { startInvalid = 0,
startCold = 1, startWarm, startHot } ODSI_start_enum ;
class OsiDylpSolverInterface: virtual public OsiSolverInterface
{ friend void OsiDylpSolverInterfaceUnitTest(const std::string &mpsDir,
const std::string &netLibDir) ;
/*
Consult the COIN OSI documentation or relevant source code for details
not covered here. Supported functions are listed first, followed by
unsupported functions.
*/
public:
OsiDylpSolverInterface() ;
OsiDylpSolverInterface(const OsiDylpSolverInterface &src) ;
OsiSolverInterface* clone(bool copyData = true) const ;
OsiDylpSolverInterface &operator=(const OsiDylpSolverInterface &rhs) ;
~OsiDylpSolverInterface() ;
void reset() ;
int readMps(const char *filename, const char *extension = "mps") ;
int readMps(const char *filename, const char *extension,
int &numberSets, CoinSet **&sets) ;
void writeMps(const char *basename,
const char *extension = "mps",
double objsense = 0.0) const ;
void loadProblem(const CoinPackedMatrix &matrix,
const double *collb, const double *colub, const double *obj,
const char *rowsen, const double *rowrhs,
const double *rowrng) ;
void loadProblem(const CoinPackedMatrix &matrix,
const double *collb, const double *colub, const double *obj,
const double *rowlb, const double *rowub) ;
void loadProblem(const int colcnt, const int rowcnt,
const int *start, const int *index, const double *value,
const double *collb, const double *colub, const double *obj,
const char *sense, const double *rhsin, const double *range) ;
void loadProblem(const int colcnt, const int rowcnt,
const int *start, const int *index, const double *value,
const double *collb, const double *colub, const double *obj,
const double *row_lower, const double *row_upper) ;
void assignProblem(CoinPackedMatrix *&matrix,
double *&collb, double *&colub, double *&obj,
char *&rowsen, double *&rowrhs, double *&rowrng) ;
void assignProblem(CoinPackedMatrix *&matrix,
double *&collb, double *&colub, double *&obj,
double *&rowlb, double *&rowub) ;
int getNumCols() const ;
int getNumRows() const ;
int getNumElements() const ;
int getNumIntegers() const ;
const double* getColLower() const ;
const double* getColUpper() const ;
bool isContinuous(int colIndex) const ;
bool isBinary(int colIndex) const ;
bool isIntegerNonBinary (int colIndex) const ;
bool isInteger (int colIndex) const ;
const char* getRowSense() const ;
const double* getRightHandSide() const ;
const double* getRowRange() const ;
const double* getRowLower() const ;
const double* getRowUpper() const ;
const double* getObjCoefficients() const ;
double getObjSense() const ;
const CoinPackedMatrix *getMatrixByRow() const ;
const CoinPackedMatrix *getMatrixByCol() const ;
void setObjName (std::string name) ;
void setRowName(int ndx, std::string name) ;
void setColName(int ndx, std::string name) ;
void setContinuous(int index) ;
using OsiSolverInterface::setContinuous ;
void setInteger(int index) ;
using OsiSolverInterface::setInteger ;
void setColLower(int index, double value) ;
using OsiSolverInterface::setColLower ;
void setColUpper(int index, double value) ;
using OsiSolverInterface::setColUpper ;
void setRowLower(int index, double value) ;
void setRowUpper(int index, double value) ;
void setRowType(int index, char rowsen, double rowrhs, double rowrng) ;
void setObjCoeff (int index, double value) ;
void setObjective(const double * array);
void setObjSense(double sense) ;
void setColSolution(const double *colsol) ;
void setRowPrice(const double*) ;
/* For overload resolution with OSI::addCol functions. */
using OsiSolverInterface::addCol ;
void addCol(const CoinPackedVectorBase &vec,
const double collb, const double colub, const double obj) ;
void deleteCols(const int num, const int *colIndices) ;
/* For overload resolution with OSI::addRow functions. */
using OsiSolverInterface::addRow ;
void addRow(const CoinPackedVectorBase &row,
const double rowlb, const double rowub) ;
void addRow(const CoinPackedVectorBase &row,
const char rowsen, const double rowrhs, const double rowrng) ;
void deleteRows(const int num, const int *rowIndices) ;
void applyRowCut(const OsiRowCut &cut) ;
void applyColCut(const OsiColCut &cut) ;
void initialSolve() ;
CoinWarmStart *getEmptyWarmStart () const ;
CoinWarmStart *getWarmStart() const ;
bool setWarmStart(const CoinWarmStart *warmStart) ;
void resolve() ;
void markHotStart() ;
void solveFromHotStart() ;
void unmarkHotStart() ;
bool isAbandoned() const ;
bool isProvenOptimal() const ;
bool isProvenPrimalInfeasible() const ;
bool isProvenDualInfeasible() const ;
bool isIterationLimitReached() const ;
int getIterationCount() const ;
bool isPrimalObjectiveLimitReached() const ;
bool isDualObjectiveLimitReached() const ;
double getInfinity() const ;
bool setIntParam(OsiIntParam key, int value) ;
bool setDblParam(OsiDblParam key, double value) ;
bool setStrParam(OsiStrParam key, const std::string& value) ;
bool setHintParam(OsiHintParam key, bool sense = true,
OsiHintStrength strength = OsiHintTry, void *info = 0) ;
bool getIntParam(OsiIntParam key, int &value) const ;
bool getDblParam(OsiDblParam key, double &value) const ;
bool getStrParam(OsiStrParam key, std::string &value) const ;
/* For overload resolution with OSI::getHintParam functions. */
using OsiSolverInterface::getHintParam ;
bool getHintParam(OsiHintParam key, bool &sense,
OsiHintStrength &strength, void *&info) const ;
inline void newLanguage(CoinMessages::Language language)
{ setOsiDylpMessages(language) ; }
inline void setLanguage(CoinMessages::Language language)
{ setOsiDylpMessages(language) ; }
double getObjValue() const ;
const double* getColSolution() const ;
const double* getRowPrice() const ;
const double* getReducedCost() const ;
const double* getRowActivity() const ;
std::vector<double *> getDualRays(int maxNumRays, bool fullRay) const ;
std::vector<double *> getPrimalRays(int maxNumRays) const ;
int canDoSimplexInterface() const ;
void enableFactorization() const ;
void disableFactorization() const ;
bool basisIsAvailable () const ;
void getBasisStatus (int *archStatus, int *logStatus) const ;
int setBasisStatus (const int *archStatus, const int *logStatus) ;
virtual void getReducedGradient(double *columnReducedCosts,
double *duals, const double *c) const ;
virtual void getBasics(int *index) const ;
virtual void getBInvCol(int col, double *betak) const ;
virtual void getBInvACol(int col, double *abarj) const ;
virtual void getBInvRow(int row, double *betai) const ;
virtual void getBInvARow(int row, double *abari, double *betai = 0) const ;
void activateRowCutDebugger (const char * modelName) ;
void activateRowCutDebugger (const double *solution,
bool keepContinuous = false) ;
# if ODSI_PARANOIA >= 1
void indexCheck (int k, bool isCol, std::string rtnnme) ;
# endif
void dylp_controlfile(const char* name, const bool silent,
const bool mustexist = true) ;
void dylp_logfile(const char* name, bool echo = false) ;
void dylp_outfile(const char* name) ;
void dylp_printsoln(bool wantSoln, bool wantStats) ;
void setOsiDylpMessages(CoinMessages::Language local_language) ;
void branchAndBound() ;
lpopts_struct *initialSolveOptions ;
lpopts_struct *resolveOptions ;
lptols_struct *tolerances ;
private:
/*
Private implementation state and helper functions. If you're contemplating
using any of these, you should have a look at the code.
See OsiDylpSolverInterface.cpp for descriptions.
*/
consys_struct *consys ;
lpprob_struct *lpprob ;
lpstats_struct *statistics ;
static int reference_count ;
static bool basis_ready ;
ioid local_outchn ;
ioid local_logchn ;
bool initial_gtxecho ;
bool resolve_gtxecho ;
lpret_enum lp_retval ;
double obj_sense ;
double odsiInfinity ;
const std::string solvername ;
mutable void *info_[OsiLastHintParam] ;
bool mps_debug ;
CoinWarmStart *hotstart_fallback ;
enum basisCondition
{ basisNone = 0, basisFresh, basisModified, basisDamaged } ;
struct
{ CoinWarmStart *basis ;
basisCondition condition ;
int balance ; } activeBasis ;
bool solnIsFresh ;
mutable struct
{ int simplex ;
bool saved_fullsys ; } simplex_state ;
mutable double _objval ;
mutable double* _col_obj ;
mutable double* _col_x ;
mutable double* _col_cbar ;
mutable double* _row_rhs ;
mutable double* _row_lower ;
mutable double* _row_upper ;
mutable char* _row_sense ;
mutable double* _row_range ;
mutable double* _row_lhs ;
mutable double* _row_price ;
mutable CoinPackedMatrix* _matrix_by_col ;
mutable CoinPackedMatrix* _matrix_by_row ;
CoinPresolveMatrix *preObj_ ;
const CoinPresolveAction *postActions_ ;
CoinPostsolveMatrix *postObj_ ;
int passLimit_ ;
bool keepIntegers_ ;
consys_struct *savedConsys_ ;
mutable double* saved_col_obj ;
mutable double* saved_row_rhs ;
mutable double* saved_row_lower ;
mutable double* saved_row_upper ;
mutable char* saved_row_sense ;
mutable double* saved_row_range ;
mutable CoinPackedMatrix* saved_matrix_by_col ;
mutable CoinPackedMatrix* saved_matrix_by_row ;
CoinPresolveMatrix *initialisePresolve(bool keepIntegers) ;
void doPresolve() ;
bool evalPresolve() ;
void saveOriginalSys() ;
void installPresolve() ;
CoinPostsolveMatrix *initialisePostsolve(CoinPresolveMatrix *&preObj) ;
void doPostsolve() ;
void installPostsolve() ;
void destruct_presolve() ;
bool ensureOwnership () const ;
//}@
void construct_lpprob() ;
void construct_options() ;
void construct_consys(int cols, int rows) ;
void dylp_ioinit() ;
void gen_rowparms(int rowcnt,
double *rhs, double *rhslow, contyp_enum *ctyp,
const double *rowlb, const double *rowub) ;
void gen_rowparms(int rowcnt,
double *rhs, double *rhslow, contyp_enum *ctyp,
const char *sense, const double *rhsin, const double *range) ;
void load_problem(const CoinMpsIO &mps) ;
void load_problem(const CoinPackedMatrix &matrix,
const double* col_lower, const double* col_upper, const double* obj,
const contyp_enum *ctyp, const double* rhs, const double* rhslow) ;
void load_problem (const int colcnt, const int rowcnt,
const int *start, const int *lens,
const int *index, const double *value,
const double* col_lower, const double* col_upper, const double* obj,
const contyp_enum *ctyp, const double* rhs, const double* rhslow) ;
lpret_enum do_lp (ODSI_start_enum start, bool echo) ;
void setBasisInLpprob (const OsiDylpWarmStartBasis *wsb,
lpprob_struct *lpprob) const ;
void destruct_primal_cache() ;
void destruct_dual_cache() ;
void destruct_col_cache(bool structure) ;
void destruct_row_cache(bool structure) ;
void destruct_cache(bool rowStructure, bool colStructure) ;
void destruct_problem(bool preserve_interface) ;
void detach_dylp() const ;
/*
There are separate groups for member and static methods so that doxygen
won't promote the group to the top level.
*/
void add_col(const CoinPackedVectorBase& coin_coli,
vartyp_enum vtypi, double vlbi,
double vubi, double obji, const std::string *nme) ;
void add_row(const CoinPackedVectorBase& coin_rowi,
char clazzi, contyp_enum ctypi,
double rhsi, double rhslowi, const std::string *nme) ;
void calc_objval() ;
contyp_enum bound_to_type(double lower, double upper) ;
void gen_rowiparms(contyp_enum* ctypi, double* rhsi, double* rhslowi,
char sensei, double rhsini, double rangei) ;
void gen_rowiparms(contyp_enum* ctypi, double* rhsi, double* rhslowi,
double rowlbi, double rowubi) ;
void unimp_hint(bool dylpSense, bool hintSense,
OsiHintStrength hintStrength, const char *msgString) ;
void pessimal_primal() ;
void reduceActiveBasis() ;
static contyp_enum sense_to_type(char type) ;
static char type_to_sense(contyp_enum type) ;
template<class T> static void copy(const T* src, T* dst, int n) ;
template<class T> static T* copy(const T* src, int n) ;
template<class T> static T* copy(const T* src) ;
/*
Specializations for more complicated structures.
*/
static basis_struct* copy_basis(const basis_struct* src, int dstsze) ;
static void copy_basis(const basis_struct* src, basis_struct* dst) ;
static lpprob_struct* copy_lpprob(const lpprob_struct* src) ;
#ifndef _MSC_VER
template<class T> static void assert_same(const T& t1, const T& t2,
bool exact) ;
template<class T> static void assert_same(const T* t1, const T* t2,
int n, bool exact) ;
static void assert_same(double d1, double d2, bool exact) ;
static void assert_same(const basis_struct& b1,
const basis_struct& b2, bool exact) ;
static void assert_same(const consys_struct& c1, const
consys_struct& c2, bool exact) ;
static void assert_same(const conbnd_struct& c1, const
conbnd_struct& c2, bool exact) ;
static void assert_same(const lpprob_struct& l1,
const lpprob_struct& l2, bool exact) ;
static void assert_same(const OsiDylpSolverInterface& o1,
const OsiDylpSolverInterface& o2, bool exact) ;
#endif /* ! _MSC_VER */
template<class T> inline static T* idx_vec (T* vec) { return (vec-1) ; }
inline static int idx (int i) { return (i+1) ; }
template<class T> inline static T* inv_vec (T* vec) { return (vec+1) ; }
inline static int inv (int i) { return (i-1) ; }
static pkvec_struct* packed_vector(
const CoinShallowPackedVector vector, int dimension) ;
static void packed_vector(
const CoinShallowPackedVector vector, int dimension, pkvec_struct *dst) ;
static std::string make_filename(const char *filename,
const char *ext1, const char *ext2) ;
} ;
/*
OsiDylpSolverInterfaceTest.cpp
*/
void OsiDylpSolverInterfaceUnitTest(const std::string & mpsDir,
const std::string &netLibDir) ;
#endif // OsiDylpSolverInterface_H
ODSI_start_enum
ODSI_start_enum
Enum to specify cold/warm/hot start.
Definition OsiDylpSolverInterface.hpp:45
startWarm
@ startWarm
Definition OsiDylpSolverInterface.hpp:46
startInvalid
@ startInvalid
Definition OsiDylpSolverInterface.hpp:45
startHot
@ startHot
Definition OsiDylpSolverInterface.hpp:46
startCold
@ startCold
Definition OsiDylpSolverInterface.hpp:46
OsiDylpSolverInterface
COIN OSI API for dylp.
Definition OsiDylpSolverInterface.hpp:109
OsiDylpSolverInterface::isDualObjectiveLimitReached
bool isDualObjectiveLimitReached() const
Is the dual objective limit reached?
OsiDylpSolverInterface::type_to_sense
static char type_to_sense(contyp_enum type)
OsiDylpSolverInterface::isInteger
bool isInteger(int colIndex) const
Return true if the variable is integer (general or binary)
OsiDylpSolverInterface::setHintParam
bool setHintParam(OsiHintParam key, bool sense=true, OsiHintStrength strength=OsiHintTry, void *info=0)
Set an OSI hint.
OsiDylpSolverInterface::unmarkHotStart
void unmarkHotStart()
Delete the hot start snapshot.
OsiDylpSolverInterface::initial_gtxecho
bool initial_gtxecho
Controls output of log information to stdout during initialSolve()
Definition OsiDylpSolverInterface.hpp:847
OsiDylpSolverInterface::getRowActivity
const double * getRowActivity() const
Return the vector of row activity for the solution.
OsiDylpSolverInterface::_col_obj
double * _col_obj
Definition OsiDylpSolverInterface.hpp:972
OsiDylpSolverInterface::canDoSimplexInterface
int canDoSimplexInterface() const
Return the simplex implementation level.
OsiDylpSolverInterface::_objval
double _objval
Definition OsiDylpSolverInterface.hpp:971
OsiDylpSolverInterface::getBInvRow
virtual void getBInvRow(int row, double *betai) const
Get a row of the basis inverse.
OsiDylpSolverInterface::isProvenOptimal
bool isProvenOptimal() const
True if dylp reported an optimal solution.
OsiDylpSolverInterface::setBasisInLpprob
void setBasisInLpprob(const OsiDylpWarmStartBasis *wsb, lpprob_struct *lpprob) const
Install a basis in the lp problem structure.
OsiDylpSolverInterface::evalPresolve
bool evalPresolve()
Decide whether presolve was effective enough to use.
OsiDylpSolverInterface::setColLower
void setColLower(int index, double value)
Set the lower bound on a column (variable)
OsiDylpSolverInterface::loadProblem
void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const char *rowsen, const double *rowrhs, const double *rowrng)
Load a problem description (OSI packed matrix, row sense, parameters unaffected).
OsiDylpSolverInterface::idx_vec
static T * idx_vec(T *vec)
Convert 0-based vector pointer to 1-based vector pointer.
Definition OsiDylpSolverInterface.hpp:1221
OsiDylpSolverInterface::dylp_printsoln
void dylp_printsoln(bool wantSoln, bool wantStats)
Print the solution and/or statistics to the output file.
OsiDylpSolverInterface::saved_row_sense
char * saved_row_sense
Definition OsiDylpSolverInterface.hpp:1034
OsiDylpSolverInterface::obj_sense
double obj_sense
Objective function sense for this ODSI instance.
Definition OsiDylpSolverInterface.hpp:871
OsiDylpSolverInterface::isProvenPrimalInfeasible
bool isProvenPrimalInfeasible() const
True if dylp reported the problem to be primal infeasible.
OsiDylpSolverInterface::applyColCut
void applyColCut(const OsiColCut &cut)
Apply a column (variable) cut (adjust one or more bounds)
OsiDylpSolverInterface::assert_same
static void assert_same(const T *t1, const T *t2, int n, bool exact)
OsiDylpSolverInterface::copy
static T * copy(const T *src, int n)
OsiDylpSolverInterface::setLanguage
void setLanguage(CoinMessages::Language language)
An alias for OsiDylpSolverInterface::newLanguage.
Definition OsiDylpSolverInterface.hpp:574
OsiDylpSolverInterface::solvername
const std::string solvername
Solver name (dylp).
Definition OsiDylpSolverInterface.hpp:879
OsiDylpSolverInterface::sense_to_type
static contyp_enum sense_to_type(char type)
OsiDylpSolverInterface::assert_same
static void assert_same(double d1, double d2, bool exact)
OsiDylpSolverInterface::setRowName
void setRowName(int ndx, std::string name)
Set a row name.
OsiDylpSolverInterface::isBinary
bool isBinary(int colIndex) const
Return true if the variable is binary.
OsiDylpSolverInterface::getObjSense
double getObjSense() const
Get the objective function sense (min/max)
OsiDylpSolverInterface::_row_upper
double * _row_upper
Definition OsiDylpSolverInterface.hpp:978
OsiDylpSolverInterface::pessimal_primal
void pessimal_primal()
OsiDylpSolverInterface::isIntegerNonBinary
bool isIntegerNonBinary(int colIndex) const
Return true if the variable is general integer.
OsiDylpSolverInterface::packed_vector
static pkvec_struct * packed_vector(const CoinShallowPackedVector vector, int dimension)
OsiDylpSolverInterface::reduceActiveBasis
void reduceActiveBasis()
OsiDylpSolverInterface::basis_ready
static bool basis_ready
Basis maintenance package is initialised.
Definition OsiDylpSolverInterface.hpp:817
OsiDylpSolverInterface::assignProblem
void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, double *&rowlb, double *&rowub)
Load a problem description (OSI packed matrix, row bounds, parameters destroyed).
OsiDylpSolverInterface::postActions_
const CoinPresolveAction * postActions_
List of postsolve actions.
Definition OsiDylpSolverInterface.hpp:1009
OsiDylpSolverInterface::setObjective
void setObjective(const double *array)
Set the objective coefficients for all columns.
OsiDylpSolverInterface::dylp_controlfile
void dylp_controlfile(const char *name, const bool silent, const bool mustexist=true)
Process an options (.spc) file.
OsiDylpSolverInterface::getMatrixByRow
const CoinPackedMatrix * getMatrixByRow() const
Get a pointer to a row-major copy of the constraint matrix.
OsiDylpSolverInterface::destruct_problem
void destruct_problem(bool preserve_interface)
OsiDylpSolverInterface::saved_col_obj
double * saved_col_obj
Saved pointers to cached structural vectors.
Definition OsiDylpSolverInterface.hpp:1030
OsiDylpSolverInterface::reference_count
static int reference_count
Number of outstanding ODSI objects.
Definition OsiDylpSolverInterface.hpp:815
OsiDylpSolverInterface::deleteCols
void deleteCols(const int num, const int *colIndices)
Remove column(s) (variable(s)) from the problem.
OsiDylpSolverInterface::getInfinity
double getInfinity() const
Get dylp's value for infinity.
OsiDylpSolverInterface::gen_rowparms
void gen_rowparms(int rowcnt, double *rhs, double *rhslow, contyp_enum *ctyp, const double *rowlb, const double *rowub)
OsiDylpSolverInterface::getNumCols
int getNumCols() const
Get the number of columns (variables)
OsiDylpSolverInterface::setDblParam
bool setDblParam(OsiDblParam key, double value)
Set an OSI double parameter.
OsiDylpSolverInterface::isProvenDualInfeasible
bool isProvenDualInfeasible() const
True if dylp reported the problem to be dual infeasible (primal unbounded)
OsiDylpSolverInterface::getBasics
virtual void getBasics(int *index) const
Get indices of basic variables.
OsiDylpSolverInterface::getColSolution
const double * getColSolution() const
Return the vector of primal variables for the solution.
OsiDylpSolverInterface::copy_basis
static void copy_basis(const basis_struct *src, basis_struct *dst)
OsiDylpSolverInterface::make_filename
static std::string make_filename(const char *filename, const char *ext1, const char *ext2)
OsiDylpSolverInterface::assert_same
static void assert_same(const T &t1, const T &t2, bool exact)
OsiDylpSolverInterface::solnIsFresh
bool solnIsFresh
The most recent solution from dylp is valid.
Definition OsiDylpSolverInterface.hpp:948
OsiDylpSolverInterface::clone
OsiSolverInterface * clone(bool copyData=true) const
Clone the solver object.
OsiDylpSolverInterface::writeMps
void writeMps(const char *basename, const char *extension="mps", double objsense=0.0) const
Write the problem into the specified file in MPS format.
OsiDylpSolverInterface::addRow
void addRow(const CoinPackedVectorBase &row, const double rowlb, const double rowub)
Add a row (constraint) to the problem.
OsiDylpSolverInterface::assert_same
static void assert_same(const consys_struct &c1, const consys_struct &c2, bool exact)
OsiDylpSolverInterface::getReducedGradient
virtual void getReducedGradient(double *columnReducedCosts, double *duals, const double *c) const
Calculate duals and reduced costs for the given objective coefficients.
OsiDylpSolverInterface::destruct_primal_cache
void destruct_primal_cache()
OsiDylpSolverInterface::construct_options
void construct_options()
OsiDylpSolverInterface::initialisePresolve
CoinPresolveMatrix * initialisePresolve(bool keepIntegers)
Create and load a presolve object.
OsiDylpSolverInterface::isContinuous
bool isContinuous(int colIndex) const
Return true if the variable is continuous.
OsiDylpSolverInterface::resolve_gtxecho
bool resolve_gtxecho
Controls output of log information to stdout during resolve() and solveFromHotStart()
Definition OsiDylpSolverInterface.hpp:853
OsiDylpSolverInterface::getRightHandSide
const double * getRightHandSide() const
Get the row (constraint) right-hand-side vector.
OsiDylpSolverInterface::saveOriginalSys
void saveOriginalSys()
Save the original problem.
OsiDylpSolverInterface::resolveOptions
lpopts_struct * resolveOptions
Solver options for a resolve.
Definition OsiDylpSolverInterface.hpp:781
OsiDylpSolverInterface::lpprob
lpprob_struct * lpprob
The lp problem.
Definition OsiDylpSolverInterface.hpp:805
OsiDylpSolverInterface::destruct_row_cache
void destruct_row_cache(bool structure)
OsiDylpSolverInterface::initialSolveOptions
lpopts_struct * initialSolveOptions
Solver options for an initial solve.
Definition OsiDylpSolverInterface.hpp:778
OsiDylpSolverInterface::load_problem
void load_problem(const CoinMpsIO &mps)
OsiDylpSolverInterface::inv
static int inv(int i)
Convert 1-based index to 0-based index.
Definition OsiDylpSolverInterface.hpp:1234
OsiDylpSolverInterface::enableFactorization
void enableFactorization() const
Prepare the solver for the use of tableau access methods.
OsiDylpSolverInterface::lp_retval
lpret_enum lp_retval
Result of last call to solver for this ODSI instance.
Definition OsiDylpSolverInterface.hpp:864
OsiDylpSolverInterface::setColName
void setColName(int ndx, std::string name)
Set a column name.
OsiDylpSolverInterface::getIntParam
bool getIntParam(OsiIntParam key, int &value) const
Get an OSI integer parameter.
OsiDylpSolverInterface::copy_lpprob
static lpprob_struct * copy_lpprob(const lpprob_struct *src)
OsiDylpSolverInterface::_matrix_by_row
CoinPackedMatrix * _matrix_by_row
Definition OsiDylpSolverInterface.hpp:985
OsiDylpSolverInterface::disableFactorization
void disableFactorization() const
Undo the effects of enableFactorization.
OsiDylpSolverInterface::setColUpper
void setColUpper(int index, double value)
Set the upper bound on a column (variable)
OsiDylpSolverInterface::getEmptyWarmStart
CoinWarmStart * getEmptyWarmStart() const
Get an empty OsiDylpWarmStartBasis object.
OsiDylpSolverInterface::basisCondition
basisCondition
Codes for basis condition.
Definition OsiDylpSolverInterface.hpp:919
OsiDylpSolverInterface::basisDamaged
@ basisDamaged
Definition OsiDylpSolverInterface.hpp:919
OsiDylpSolverInterface::basisModified
@ basisModified
Definition OsiDylpSolverInterface.hpp:919
OsiDylpSolverInterface::basisFresh
@ basisFresh
Definition OsiDylpSolverInterface.hpp:919
OsiDylpSolverInterface::basisNone
@ basisNone
Definition OsiDylpSolverInterface.hpp:919
OsiDylpSolverInterface::saved_row_upper
double * saved_row_upper
Definition OsiDylpSolverInterface.hpp:1033
OsiDylpSolverInterface::installPresolve
void installPresolve()
Load the presolved problem into the ODSI object.
OsiDylpSolverInterface::activateRowCutDebugger
void activateRowCutDebugger(const char *modelName)
Activate the row cut debugger.
OsiDylpSolverInterface::getRowUpper
const double * getRowUpper() const
Get the row (constraint) upper bound vector.
OsiDylpSolverInterface::setStrParam
bool setStrParam(OsiStrParam key, const std::string &value)
Set an OSI string parameter.
OsiDylpSolverInterface::odsiInfinity
double odsiInfinity
The value of infinity.
Definition OsiDylpSolverInterface.hpp:875
OsiDylpSolverInterface::detach_dylp
void detach_dylp() const
OsiDylpSolverInterface::unimp_hint
void unimp_hint(bool dylpSense, bool hintSense, OsiHintStrength hintStrength, const char *msgString)
OsiDylpSolverInterface::statistics
lpstats_struct * statistics
The statistics structure.
Definition OsiDylpSolverInterface.hpp:807
OsiDylpSolverInterface::markHotStart
void markHotStart()
Create a hot start snapshot.
OsiDylpSolverInterface::setBasisStatus
int setBasisStatus(const int *archStatus, const int *logStatus)
Set a basis and update the factorization and solution.
OsiDylpSolverInterface::getWarmStart
CoinWarmStart * getWarmStart() const
Build a warm start object for the current lp solution.
OsiDylpSolverInterface::readMps
int readMps(const char *filename, const char *extension="mps")
Read a problem description in MPS format from a file.
OsiDylpSolverInterface::ensureOwnership
bool ensureOwnership() const
Ensure that the solver is ready for simplex operations.
OsiDylpSolverInterface::saved_matrix_by_row
CoinPackedMatrix * saved_matrix_by_row
Definition OsiDylpSolverInterface.hpp:1037
OsiDylpSolverInterface::destruct_col_cache
void destruct_col_cache(bool structure)
OsiDylpSolverInterface::_row_lhs
double * _row_lhs
Definition OsiDylpSolverInterface.hpp:981
OsiDylpSolverInterface::isIterationLimitReached
bool isIterationLimitReached() const
True if dylp reached the iteration limit.
OsiDylpSolverInterface::getObjCoefficients
const double * getObjCoefficients() const
Get the objective function coefficient vector.
OsiDylpSolverInterface::getColLower
const double * getColLower() const
Get the column (variable) lower bound vector.
OsiDylpSolverInterface::setColSolution
void setColSolution(const double *colsol)
Set the value of the primal variables in the problem solution.
OsiDylpSolverInterface::OsiDylpSolverInterfaceUnitTest
friend void OsiDylpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netLibDir)
Unit test for OsiDylpSolverInterface.
OsiDylpSolverInterface::branchAndBound
void branchAndBound()
Invoke the solver's built-in branch-and-bound algorithm.
OsiDylpSolverInterface::reset
void reset()
Reset the solver object to the state produced by the default constructor.
OsiDylpSolverInterface::add_col
void add_col(const CoinPackedVectorBase &coin_coli, vartyp_enum vtypi, double vlbi, double vubi, double obji, const std::string *nme)
OsiDylpSolverInterface::_matrix_by_col
CoinPackedMatrix * _matrix_by_col
Definition OsiDylpSolverInterface.hpp:984
OsiDylpSolverInterface::tolerances
lptols_struct * tolerances
Solver numeric tolerances.
Definition OsiDylpSolverInterface.hpp:784
OsiDylpSolverInterface::_row_lower
double * _row_lower
Definition OsiDylpSolverInterface.hpp:977
OsiDylpSolverInterface::addRow
void addRow(const CoinPackedVectorBase &row, const char rowsen, const double rowrhs, const double rowrng)
Add a row (constraint) to the problem.
OsiDylpSolverInterface::load_problem
void load_problem(const int colcnt, const int rowcnt, const int *start, const int *lens, const int *index, const double *value, const double *col_lower, const double *col_upper, const double *obj, const contyp_enum *ctyp, const double *rhs, const double *rhslow)
OsiDylpSolverInterface::addCol
void addCol(const CoinPackedVectorBase &vec, const double collb, const double colub, const double obj)
Add a column (variable) to the problem.
OsiDylpSolverInterface::setObjSense
void setObjSense(double sense)
Set the sense (min/max) of the objective.
OsiDylpSolverInterface::dylp_ioinit
void dylp_ioinit()
OsiDylpSolverInterface::setWarmStart
bool setWarmStart(const CoinWarmStart *warmStart)
Apply a warm start object.
OsiDylpSolverInterface::saved_row_range
double * saved_row_range
Definition OsiDylpSolverInterface.hpp:1035
OsiDylpSolverInterface::setObjCoeff
void setObjCoeff(int index, double value)
Set an objective function coefficient.
OsiDylpSolverInterface::doPostsolve
void doPostsolve()
Apply the postsolve transforms from postActions_.
OsiDylpSolverInterface::hotstart_fallback
CoinWarmStart * hotstart_fallback
Warm start object used as a fallback for hot start.
Definition OsiDylpSolverInterface.hpp:896
OsiDylpSolverInterface::operator=
OsiDylpSolverInterface & operator=(const OsiDylpSolverInterface &rhs)
Assignment.
OsiDylpSolverInterface::basisIsAvailable
bool basisIsAvailable() const
Check if an optimal basis is available.
OsiDylpSolverInterface::balance
int balance
Definition OsiDylpSolverInterface.hpp:941
OsiDylpSolverInterface::basis
CoinWarmStart * basis
Definition OsiDylpSolverInterface.hpp:939
OsiDylpSolverInterface::_row_sense
char * _row_sense
Definition OsiDylpSolverInterface.hpp:979
OsiDylpSolverInterface::copy
static T * copy(const T *src)
OsiDylpSolverInterface::loadProblem
void loadProblem(const CoinPackedMatrix &matrix, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
Load a problem description (OSI packed matrix, row bounds, parameters unaffected).
OsiDylpSolverInterface::loadProblem
void loadProblem(const int colcnt, const int rowcnt, const int *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *row_lower, const double *row_upper)
Load a problem description (standard column-major packed matrix, row bounds, parameters unaffected)
OsiDylpSolverInterface::assert_same
static void assert_same(const basis_struct &b1, const basis_struct &b2, bool exact)
OsiDylpSolverInterface::saved_row_lower
double * saved_row_lower
Definition OsiDylpSolverInterface.hpp:1032
OsiDylpSolverInterface::condition
basisCondition condition
Definition OsiDylpSolverInterface.hpp:940
OsiDylpSolverInterface::loadProblem
void loadProblem(const int colcnt, const int rowcnt, const int *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const char *sense, const double *rhsin, const double *range)
Load a problem description (standard column-major packed matrix, row sense, parameters unaffected)
OsiDylpSolverInterface::keepIntegers_
bool keepIntegers_
true if presolve should consider integrality
Definition OsiDylpSolverInterface.hpp:1024
OsiDylpSolverInterface::getColUpper
const double * getColUpper() const
Get the column (variable) upper bound vector.
OsiDylpSolverInterface::local_logchn
ioid local_logchn
Log stream for this ODSI instance.
Definition OsiDylpSolverInterface.hpp:841
OsiDylpSolverInterface::gen_rowiparms
void gen_rowiparms(contyp_enum *ctypi, double *rhsi, double *rhslowi, double rowlbi, double rowubi)
OsiDylpSolverInterface::setOsiDylpMessages
void setOsiDylpMessages(CoinMessages::Language local_language)
Set the language for messages.
OsiDylpSolverInterface::getDualRays
std::vector< double * > getDualRays(int maxNumRays, bool fullRay) const
Get as many dual rays as the solver can provide.
OsiDylpSolverInterface::getObjValue
double getObjValue() const
Get the objective function value for the solution.
OsiDylpSolverInterface::bound_to_type
contyp_enum bound_to_type(double lower, double upper)
OsiDylpSolverInterface::_col_cbar
double * _col_cbar
Definition OsiDylpSolverInterface.hpp:974
OsiDylpSolverInterface::getBasisStatus
void getBasisStatus(int *archStatus, int *logStatus) const
Retrieve status information for architectural and logical variables.
OsiDylpSolverInterface::resolve
void resolve()
Call dylp to reoptimize (warm start).
OsiDylpSolverInterface::setObjName
void setObjName(std::string name)
Set the objective function name.
OsiDylpSolverInterface::activateRowCutDebugger
void activateRowCutDebugger(const double *solution, bool keepContinuous=false)
Activate the row cut debugger.
OsiDylpSolverInterface::assignProblem
void assignProblem(CoinPackedMatrix *&matrix, double *&collb, double *&colub, double *&obj, char *&rowsen, double *&rowrhs, double *&rowrng)
Load a problem description (OSI packed matrix, row sense, parameters destroyed).
OsiDylpSolverInterface::setRowLower
void setRowLower(int index, double value)
Set the lower bound on a row (constraint)
OsiDylpSolverInterface::calc_objval
void calc_objval()
OsiDylpSolverInterface::inv_vec
static T * inv_vec(T *vec)
Convert 1-based vector pointer to 0-based vector pointer.
Definition OsiDylpSolverInterface.hpp:1231
OsiDylpSolverInterface::getRowSense
const char * getRowSense() const
Get the row sense (constraint type) vector.
OsiDylpSolverInterface::load_problem
void load_problem(const CoinPackedMatrix &matrix, const double *col_lower, const double *col_upper, const double *obj, const contyp_enum *ctyp, const double *rhs, const double *rhslow)
OsiDylpSolverInterface::destruct_dual_cache
void destruct_dual_cache()
OsiDylpSolverInterface::setInteger
void setInteger(int index)
Set a single variable to be integer.
OsiDylpSolverInterface::mps_debug
bool mps_debug
Allow messages from CoinMpsIO package.
Definition OsiDylpSolverInterface.hpp:887
OsiDylpSolverInterface::consys
consys_struct * consys
The constraint system.
Definition OsiDylpSolverInterface.hpp:803
OsiDylpSolverInterface::OsiDylpSolverInterface
OsiDylpSolverInterface(const OsiDylpSolverInterface &src)
Copy constructor.
OsiDylpSolverInterface::setRowPrice
void setRowPrice(const double *)
Set the value of the dual variables in the problem solution.
OsiDylpSolverInterface::assert_same
static void assert_same(const conbnd_struct &c1, const conbnd_struct &c2, bool exact)
OsiDylpSolverInterface::postObj_
CoinPostsolveMatrix * postObj_
The postsolve object.
Definition OsiDylpSolverInterface.hpp:1018
OsiDylpSolverInterface::destruct_presolve
void destruct_presolve()
Delete presolve information.
OsiDylpSolverInterface::getRowLower
const double * getRowLower() const
Get the row (constraint) lower bound vector.
OsiDylpSolverInterface::_row_range
double * _row_range
Definition OsiDylpSolverInterface.hpp:980
OsiDylpSolverInterface::setContinuous
void setContinuous(int index)
Set a single variable to be continuous.
OsiDylpSolverInterface::_row_rhs
double * _row_rhs
Definition OsiDylpSolverInterface.hpp:976
OsiDylpSolverInterface::setRowUpper
void setRowUpper(int index, double value)
Set the upper bound on a row (constraint)
OsiDylpSolverInterface::getNumIntegers
int getNumIntegers() const
Get the number of integer variables.
OsiDylpSolverInterface::getNumElements
int getNumElements() const
Get the number of non-zero coefficients.
OsiDylpSolverInterface::OsiDylpSolverInterface
OsiDylpSolverInterface()
Default constructor.
OsiDylpSolverInterface::_col_x
double * _col_x
Definition OsiDylpSolverInterface.hpp:973
OsiDylpSolverInterface::_row_price
double * _row_price
Definition OsiDylpSolverInterface.hpp:982
OsiDylpSolverInterface::idx
static int idx(int i)
Convert 0-based index to 1-based index.
Definition OsiDylpSolverInterface.hpp:1224
OsiDylpSolverInterface::savedConsys_
consys_struct * savedConsys_
Saved copy of original problem.
Definition OsiDylpSolverInterface.hpp:1027
OsiDylpSolverInterface::setRowType
void setRowType(int index, char rowsen, double rowrhs, double rowrng)
Set the type of a row (constraint)
OsiDylpSolverInterface::getStrParam
bool getStrParam(OsiStrParam key, std::string &value) const
Get an OSI string parameter.
OsiDylpSolverInterface::saved_row_rhs
double * saved_row_rhs
Definition OsiDylpSolverInterface.hpp:1031
OsiDylpSolverInterface::simplex
int simplex
Definition OsiDylpSolverInterface.hpp:957
OsiDylpSolverInterface::solveFromHotStart
void solveFromHotStart()
Call dylp to reoptimize (hot start).
OsiDylpSolverInterface::dylp_logfile
void dylp_logfile(const char *name, bool echo=false)
Establish a log file.
OsiDylpSolverInterface::dylp_outfile
void dylp_outfile(const char *name)
Establish an output (solution and/or statistics) file.
OsiDylpSolverInterface::initialisePostsolve
CoinPostsolveMatrix * initialisePostsolve(CoinPresolveMatrix *&preObj)
Create and load a postsolve object.
OsiDylpSolverInterface::passLimit_
int passLimit_
Limit for iterations of the major presolve loop.
Definition OsiDylpSolverInterface.hpp:1021
OsiDylpSolverInterface::construct_consys
void construct_consys(int cols, int rows)
OsiDylpSolverInterface::getBInvACol
virtual void getBInvACol(int col, double *abarj) const
Get a column of the tableau.
OsiDylpSolverInterface::assert_same
static void assert_same(const lpprob_struct &l1, const lpprob_struct &l2, bool exact)
OsiDylpSolverInterface::local_outchn
ioid local_outchn
Output stream for this ODSI instance.
Definition OsiDylpSolverInterface.hpp:834
OsiDylpSolverInterface::add_row
void add_row(const CoinPackedVectorBase &coin_rowi, char clazzi, contyp_enum ctypi, double rhsi, double rhslowi, const std::string *nme)
OsiDylpSolverInterface::saved_matrix_by_col
CoinPackedMatrix * saved_matrix_by_col
Definition OsiDylpSolverInterface.hpp:1036
OsiDylpSolverInterface::preObj_
CoinPresolveMatrix * preObj_
The presolve object.
Definition OsiDylpSolverInterface.hpp:1001
OsiDylpSolverInterface::assert_same
static void assert_same(const OsiDylpSolverInterface &o1, const OsiDylpSolverInterface &o2, bool exact)
OsiDylpSolverInterface::getMatrixByCol
const CoinPackedMatrix * getMatrixByCol() const
Get a pointer to a column-major copy of the constraint matrix.
OsiDylpSolverInterface::initialSolve
void initialSolve()
Solve an lp from scratch.
OsiDylpSolverInterface::doPresolve
void doPresolve()
Perform presolve transformations.
OsiDylpSolverInterface::getPrimalRays
std::vector< double * > getPrimalRays(int maxNumRays) const
Get as many primal rays as the solver can provide.
OsiDylpSolverInterface::deleteRows
void deleteRows(const int num, const int *rowIndices)
Delete row(s) (constraint(s)) from the problem.
OsiDylpSolverInterface::gen_rowparms
void gen_rowparms(int rowcnt, double *rhs, double *rhslow, contyp_enum *ctyp, const char *sense, const double *rhsin, const double *range)
OsiDylpSolverInterface::installPostsolve
void installPostsolve()
Reload the original constraint system with the postsolved basis.
OsiDylpSolverInterface::getBInvCol
virtual void getBInvCol(int col, double *betak) const
Get a column of the basis inverse.
OsiDylpSolverInterface::getNumRows
int getNumRows() const
Get the number of rows (constraints)
OsiDylpSolverInterface::applyRowCut
void applyRowCut(const OsiRowCut &cut)
Apply a row (constraint) cut (add one constraint)
OsiDylpSolverInterface::simplex_state
struct OsiDylpSolverInterface::@38 simplex_state
State related to the OsiSimplex interface.
OsiDylpSolverInterface::getBInvARow
virtual void getBInvARow(int row, double *abari, double *betai=0) const
Get a row of the tableau.
OsiDylpSolverInterface::saved_fullsys
bool saved_fullsys
Definition OsiDylpSolverInterface.hpp:958
OsiDylpSolverInterface::getReducedCost
const double * getReducedCost() const
Return the vector of reduced costs for the solution.
OsiDylpSolverInterface::destruct_cache
void destruct_cache(bool rowStructure, bool colStructure)
OsiDylpSolverInterface::construct_lpprob
void construct_lpprob()
OsiDylpSolverInterface::setIntParam
bool setIntParam(OsiIntParam key, int value)
Set an OSI integer parameter.
OsiDylpSolverInterface::copy
static void copy(const T *src, T *dst, int n)
OsiDylpSolverInterface::info_
void * info_[OsiLastHintParam]
Array for info blocks associated with hints.
Definition OsiDylpSolverInterface.hpp:883
OsiDylpSolverInterface::getRowPrice
const double * getRowPrice() const
Return the vector of dual variables for the solution.
OsiDylpSolverInterface::newLanguage
void newLanguage(CoinMessages::Language language)
Change the language for OsiDylp messages.
Definition OsiDylpSolverInterface.hpp:569
OsiDylpSolverInterface::getDblParam
bool getDblParam(OsiDblParam key, double &value) const
Get an OSI double parameter.
OsiDylpSolverInterface::getRowRange
const double * getRowRange() const
Get the row (constraint) range vector.
OsiDylpSolverInterface::isPrimalObjectiveLimitReached
bool isPrimalObjectiveLimitReached() const
Is the primal objective limit reached?
OsiDylpSolverInterface::getHintParam
bool getHintParam(OsiHintParam key, bool &sense, OsiHintStrength &strength, void *&info) const
Get an OSI hint.
OsiDylpSolverInterface::isAbandoned
bool isAbandoned() const
True if dylp abandoned the problem.
OsiDylpSolverInterface::packed_vector
static void packed_vector(const CoinShallowPackedVector vector, int dimension, pkvec_struct *dst)
OsiDylpSolverInterface::activeBasis
struct OsiDylpSolverInterface::@37 activeBasis
Active basis.
OsiDylpSolverInterface::gen_rowiparms
void gen_rowiparms(contyp_enum *ctypi, double *rhsi, double *rhslowi, char sensei, double rhsini, double rangei)
OsiDylpSolverInterface::getIterationCount
int getIterationCount() const
Get the number of iterations for the last lp.
OsiDylpSolverInterface::do_lp
lpret_enum do_lp(ODSI_start_enum start, bool echo)
Common core method to invoke dylp.
OsiDylpSolverInterface::readMps
int readMps(const char *filename, const char *extension, int &numberSets, CoinSet **&sets)
Read a problem description in MPS format from a file, including SOS information.
OsiDylpSolverInterface::copy_basis
static basis_struct * copy_basis(const basis_struct *src, int dstsze)
OsiDylpSolverInterface::~OsiDylpSolverInterface
~OsiDylpSolverInterface()
Destructor.
OsiDylpWarmStartBasis
The dylp warm start class.
Definition OsiDylpWarmStartBasis.hpp:46
vartyp_enum
vartyp_enum
Definition dy_consys.h:354
contyp_enum
contyp_enum
Definition dy_consys.h:338
ioid
int ioid
Definition dylib_io.h:39
dylp.h
lpret_enum
lpret_enum
Definition dylp.h:170
basis_struct
Definition dylp.h:454
conbnd_struct
Definition dy_consys.h:308
consys_struct
Definition dy_consys.h:461
lpopts_struct
Definition dylp.h:1115
lpprob_struct
Definition dylp.h:587
lpstats_struct
Definition dylp.h:1303
lptols_struct
Definition dylp.h:667
pkvec_struct
Definition dy_vector.h:241