#include <OSDipInterface.h>
Collaboration diagram for OS_DipInterface:
Helper Methods. | |
void | readOSiL (std::string &filename) |
void | readOSoL (std::string &filename) |
CoinPackedVector * | getRow (int i) |
CoinPackedMatrix * | getCoinPackedMatrix () |
const char * | getIntegerColumns () |
Returns array[getNumCols()] specifying if a variable is integer. | |
double | getObjectiveOffset () |
std::vector< std::set< int > > | getBlockVarIndexes () |
std::set< int > | getCoreConstraintIndexes () |
std::vector< std::map< int, int > > | getBlockConstraintIndexes () |
std::vector< OSInstance * > | getBlockOSInstances () |
std::vector< std::string > | getBlockFactories () |
double * | getObjectiveFunctionCoeff () |
const double | getBestKnownLB () const |
const double | getBestKnownUB () const |
const std::string * | getObjectiveMaxOrMins () const |
Get objective maxOrMins. | |
const double * | getObjectiveConstants () const |
Get objective constants. | |
const double * | getObjectiveWeights () const |
Get objective weights. | |
const int | getNumberOfIntegerVariables () const |
getNumberOfIntegerVariables | |
const int | getNumberOfBinaryVariables () const |
getNumberOfBinaryVariables | |
const int | getVariableNumber () const |
Get variable number. | |
const int | getConstraintNumber () const |
Get constraint number. | |
const double * | getColLower () const |
Get variable lower bounds. | |
const double * | getColUpper () const |
Get variable upper bounds. | |
const std::string * | getVariableNames () const |
Get variable names. | |
const double * | getRowLower () const |
Get constraint lower bounds. | |
const double * | getRowUpper () const |
Get constraint upper bounds. | |
const std::string * | getConstraintNames () const |
Get constraint names. | |
std::map< int, std::vector< int > > | generateInitialMaster () |
OS_DipInterface () | |
class constructor | |
~OS_DipInterface () | |
class destructor | |
std::vector< std::set< int > > | m_blockVariableIndexes |
bool | m_blockVariableIndexesProcessed |
std::set< int > | m_coreConstraintIndexes |
bool | m_coreConstraintIndexesProcessed |
std::vector< std::map< int, int > > | m_blockConstraintIndexes |
bool | m_blockConstraintIndexesProcessed |
std::vector< OSInstance * > | m_blockOSInstances |
bool | m_blockOSInstancesProcessed |
std::vector< std::string > | m_blockFactories |
bool | m_blockFactoriesProcessed |
Public Attributes | |
bool | m_isProvenOptimal |
Best known LB/UB. | |
double | m_bestKnownLB |
double | m_bestKnownUB |
OSInstance * | m_osinstance |
OSOption * | m_osoption |
OSiLReader * | m_osilreader |
OSoLReader * | m_osolreader |
char * | m_integerVars |
CoinPackedMatrix * | m_coinpm |
CoinPackedVector * | m_row |
Definition at line 57 of file OSDipInterface.h.
OS_DipInterface::OS_DipInterface | ( | ) |
OS_DipInterface::~OS_DipInterface | ( | ) |
class destructor
Definition at line 699 of file OSDipInterface.cpp.
References m_blockOSInstances, m_coinpm, m_osilreader, and m_osolreader.
void OS_DipInterface::readOSiL | ( | std::string & | filename | ) |
Definition at line 23 of file OSDipInterface.cpp.
References ErrorClass::errormsg, OSInstance::getConstraintNumber(), FileUtil::getFileAsString(), OSInstance::getLinearConstraintCoefficientNumber(), OSInstance::getLinearConstraintCoefficientsInColumnMajor(), OSInstance::getLinearConstraintCoefficientsInRowMajor(), OSInstance::getVariableNumber(), SparseMatrix::indexes, m_coinpm, m_osilreader, m_osinstance, OSiLReader::readOSiL(), SparseMatrix::starts, and SparseMatrix::values.
Referenced by OSDipApp::initializeApp().
void OS_DipInterface::readOSoL | ( | std::string & | filename | ) |
Definition at line 74 of file OSDipInterface.cpp.
References ErrorClass::errormsg, FileUtil::getFileAsString(), m_osolreader, m_osoption, and OSoLReader::readOSoL().
Referenced by OSDipApp::initializeApp().
CoinPackedVector * OS_DipInterface::getRow | ( | int | i | ) |
Definition at line 108 of file OSDipInterface.cpp.
References OSInstance::getLinearConstraintCoefficientsInRowMajor(), SparseMatrix::indexes, k, m_osinstance, m_row, SparseMatrix::starts, and SparseMatrix::values.
CoinPackedMatrix * OS_DipInterface::getCoinPackedMatrix | ( | ) |
const char * OS_DipInterface::getIntegerColumns | ( | ) |
Returns array[getNumCols()] specifying if a variable is integer.
At present, simply coded as zero (continuous) and non-zero (integer) May be extended at a later date.
Definition at line 127 of file OSDipInterface.cpp.
References getVariableNumber(), OSInstance::getVariableTypes(), m_integerVars, and m_osinstance.
Referenced by OSDipApp::createModelMasterOnlys2(), and OSDipApp::createModelPart().
double OS_DipInterface::getObjectiveOffset | ( | ) |
std::vector< std::set< int > > OS_DipInterface::getBlockVarIndexes | ( | ) |
Definition at line 211 of file OSDipInterface.cpp.
References ErrorClass::errormsg, OSOption::getNumberOfOtherVariableOptions(), OSOption::getOtherVariableOptions(), OSInstance::getVariableNumber(), m_blockVariableIndexes, m_blockVariableIndexesProcessed, m_osinstance, and m_osoption.
Referenced by getBlockConstraintIndexes(), getBlockOSInstances(), and OSDipApp::initializeApp().
std::set< int > OS_DipInterface::getCoreConstraintIndexes | ( | ) |
Definition at line 603 of file OSDipInterface.cpp.
References ErrorClass::errormsg, OSInstance::getConstraintNumber(), OSOption::getNumberOfOtherConstraintOptions(), OSOption::getOtherConstraintOptions(), m_coreConstraintIndexes, m_coreConstraintIndexesProcessed, m_osinstance, and m_osoption.
Referenced by getBlockConstraintIndexes(), getBlockOSInstances(), and OSDipApp::initializeApp().
std::vector< std::map< int, int > > OS_DipInterface::getBlockConstraintIndexes | ( | ) |
Definition at line 279 of file OSDipInterface.cpp.
References ErrorClass::errormsg, getBlockVarIndexes(), getCoreConstraintIndexes(), OSInstance::getLinearConstraintCoefficientsInColumnMajor(), SparseMatrix::indexes, m_blockConstraintIndexes, m_blockConstraintIndexesProcessed, m_osinstance, and SparseMatrix::starts.
Referenced by getBlockOSInstances().
std::vector< OSInstance * > OS_DipInterface::getBlockOSInstances | ( | ) |
Definition at line 359 of file OSDipInterface.cpp.
References OSInstance::addObjective(), SparseVector::bDeleteArrays, ErrorClass::errormsg, getBlockConstraintIndexes(), getBlockVarIndexes(), OSInstance::getConstraintLowerBounds(), OSInstance::getConstraintUpperBounds(), getCoreConstraintIndexes(), OSInstance::getDenseObjectiveCoefficients(), OSInstance::getLinearConstraintCoefficientsInColumnMajor(), OSInstance::getObjectiveMaxOrMins(), OSInstance::getVariableLowerBounds(), OSInstance::getVariableNames(), OSInstance::getVariableTypes(), OSInstance::getVariableUpperBounds(), SparseMatrix::indexes, SparseVector::indexes, m_blockOSInstances, m_blockOSInstancesProcessed, m_osinstance, osinstance, OSInstance::setConstraintNumber(), OSInstance::setConstraints(), OSInstance::setLinearConstraintCoefficients(), OSInstance::setObjectiveNumber(), OSInstance::setVariableNumber(), OSInstance::setVariables(), SparseMatrix::starts, SparseMatrix::values, and SparseVector::values.
Referenced by OSDipApp::initializeApp().
std::vector< std::string > OS_DipInterface::getBlockFactories | ( | ) |
Definition at line 160 of file OSDipInterface.cpp.
References ErrorClass::errormsg, OSOption::getNumberOfOtherVariableOptions(), OSOption::getOtherVariableOptions(), m_blockFactories, m_blockFactoriesProcessed, and m_osoption.
Referenced by OSDipApp::initializeApp().
double * OS_DipInterface::getObjectiveFunctionCoeff | ( | ) |
Definition at line 671 of file OSDipInterface.cpp.
References OSInstance::getDenseObjectiveCoefficients(), and m_osinstance.
Referenced by OSDipApp::createModels().
const double OS_DipInterface::getBestKnownLB | ( | ) | const [inline] |
const double OS_DipInterface::getBestKnownUB | ( | ) | const [inline] |
const std::string* OS_DipInterface::getObjectiveMaxOrMins | ( | ) | const [inline] |
Get objective maxOrMins.
One maxOrMin for each objective.
Exception | if the elements in objectives are logically inconsistent. |
Definition at line 144 of file OSDipInterface.h.
References OSInstance::getObjectiveMaxOrMins(), and m_osinstance.
const double* OS_DipInterface::getObjectiveConstants | ( | ) | const [inline] |
Get objective constants.
One constant for each objective.
Exception | if the elements in objectives are logically inconsistent. |
Definition at line 153 of file OSDipInterface.h.
References OSInstance::getObjectiveConstants(), and m_osinstance.
Referenced by getObjectiveOffset().
const double* OS_DipInterface::getObjectiveWeights | ( | ) | const [inline] |
Get objective weights.
One weight for each objective.
Exception | if the elements in objectives are logically inconsistent. |
Definition at line 161 of file OSDipInterface.h.
References OSInstance::getObjectiveWeights(), and m_osinstance.
const int OS_DipInterface::getNumberOfIntegerVariables | ( | ) | const [inline] |
getNumberOfIntegerVariables
Definition at line 167 of file OSDipInterface.h.
References OSInstance::getNumberOfIntegerVariables(), and m_osinstance.
const int OS_DipInterface::getNumberOfBinaryVariables | ( | ) | const [inline] |
getNumberOfBinaryVariables
Definition at line 173 of file OSDipInterface.h.
References OSInstance::getNumberOfBinaryVariables(), and m_osinstance.
const int OS_DipInterface::getVariableNumber | ( | ) | const [inline] |
Get variable number.
Definition at line 181 of file OSDipInterface.h.
References OSInstance::getVariableNumber(), and m_osinstance.
Referenced by OSDipApp::createModelMasterOnlys2(), OSDipApp::createModelPart(), OSDipApp::createModels(), and getIntegerColumns().
const int OS_DipInterface::getConstraintNumber | ( | ) | const [inline] |
Get constraint number.
Definition at line 188 of file OSDipInterface.h.
References OSInstance::getConstraintNumber(), and m_osinstance.
const double* OS_DipInterface::getColLower | ( | ) | const [inline] |
Get variable lower bounds.
Definition at line 195 of file OSDipInterface.h.
References OSInstance::getVariableLowerBounds(), and m_osinstance.
Referenced by OSDipApp::createModelMasterOnlys2(), and OSDipApp::createModelPart().
const double* OS_DipInterface::getColUpper | ( | ) | const [inline] |
Get variable upper bounds.
Definition at line 203 of file OSDipInterface.h.
References OSInstance::getVariableUpperBounds(), and m_osinstance.
Referenced by OSDipApp::createModelMasterOnlys2(), and OSDipApp::createModelPart().
const std::string* OS_DipInterface::getVariableNames | ( | ) | const [inline] |
Get variable names.
Definition at line 211 of file OSDipInterface.h.
References OSInstance::getVariableNames(), and m_osinstance.
const double* OS_DipInterface::getRowLower | ( | ) | const [inline] |
Get constraint lower bounds.
Definition at line 219 of file OSDipInterface.h.
References OSInstance::getConstraintLowerBounds(), and m_osinstance.
Referenced by OSDipApp::createModelPart().
const double* OS_DipInterface::getRowUpper | ( | ) | const [inline] |
Get constraint upper bounds.
Definition at line 227 of file OSDipInterface.h.
References OSInstance::getConstraintUpperBounds(), and m_osinstance.
Referenced by OSDipApp::createModelPart().
const std::string* OS_DipInterface::getConstraintNames | ( | ) | const [inline] |
Get constraint names.
Definition at line 235 of file OSDipInterface.h.
References OSInstance::getConstraintNames(), and m_osinstance.
Referenced by OSDipApp::createModelPart().
std::map< int, std::vector< int > > OS_DipInterface::generateInitialMaster | ( | ) |
Definition at line 719 of file OSDipInterface.cpp.
References ErrorClass::errormsg, FileUtil::getFileAsString(), OSResult::getOptimalPrimalVariableValues(), OSInstance::getVariableNames(), k, DefaultSolver::osinstance, osinstance, DefaultSolver::osoption, osoption, DefaultSolver::osresult, OSiLReader::readOSiL(), DefaultSolver::solve(), and DefaultSolver::sSolverName.
Definition at line 69 of file OSDipInterface.h.
Referenced by getBlockConstraintIndexes(), getBlockOSInstances(), getBlockVarIndexes(), getColLower(), getColUpper(), getConstraintNames(), getConstraintNumber(), getCoreConstraintIndexes(), getIntegerColumns(), getNumberOfBinaryVariables(), getNumberOfIntegerVariables(), getObjectiveConstants(), getObjectiveFunctionCoeff(), getObjectiveMaxOrMins(), getObjectiveWeights(), getRow(), getRowLower(), getRowUpper(), getVariableNames(), getVariableNumber(), and readOSiL().
Definition at line 70 of file OSDipInterface.h.
Referenced by OSDipApp::generateInitVars(), getBlockFactories(), getBlockVarIndexes(), getCoreConstraintIndexes(), OSDipApp::initializeApp(), and readOSoL().
CoinPackedMatrix* OS_DipInterface::m_coinpm |
Definition at line 74 of file OSDipInterface.h.
Referenced by OSDipApp::createModelPart(), getCoinPackedMatrix(), readOSiL(), and ~OS_DipInterface().
CoinPackedVector* OS_DipInterface::m_row |
std::vector<std::set<int> > OS_DipInterface::m_blockVariableIndexes |
std::set<int> OS_DipInterface::m_coreConstraintIndexes |
std::vector<std::map<int, int> > OS_DipInterface::m_blockConstraintIndexes |
std::vector<OSInstance* > OS_DipInterface::m_blockOSInstances |
Definition at line 118 of file OSDipInterface.h.
Referenced by getBlockOSInstances(), and ~OS_DipInterface().
std::vector<std::string > OS_DipInterface::m_blockFactories |