OS_DipInterface Class Reference

#include <OSDipInterface.h>

Collaboration diagram for OS_DipInterface:

Collaboration graph
[legend]
List of all members.

Helper Methods.

void readOSiL (string &filename)
void readOSoL (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
OSInstancem_osinstance
OSOptionm_osoption
OSiLReaderm_osilreader
OSoLReaderm_osolreader
char * m_integerVars
CoinPackedMatrix * m_coinpm
CoinPackedVector * m_row

Detailed Description

A generic class to interface with Optimization Services (OS) for use in Dip (Decomposition in Integer Programming).

Definition at line 59 of file OSDipInterface.h.


Constructor & Destructor Documentation

OS_DipInterface::OS_DipInterface (  ) 

class constructor

Definition at line 682 of file OSDipInterface.cpp.

OS_DipInterface::~OS_DipInterface (  ) 

class destructor

Definition at line 693 of file OSDipInterface.cpp.

References m_blockOSInstances, m_coinpm, m_osilreader, and m_osolreader.


Member Function Documentation

void OS_DipInterface::readOSiL ( string &  filename  ) 

Definition at line 25 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 ( string &  filename  ) 

Definition at line 76 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 110 of file OSDipInterface.cpp.

References OSInstance::getLinearConstraintCoefficientsInRowMajor(), SparseMatrix::indexes, m_osinstance, m_row, SparseMatrix::starts, and SparseMatrix::values.

CoinPackedMatrix * OS_DipInterface::getCoinPackedMatrix (  ) 

Definition at line 105 of file OSDipInterface.cpp.

References m_coinpm.

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 129 of file OSDipInterface.cpp.

References getVariableNumber(), OSInstance::getVariableTypes(), m_integerVars, and m_osinstance.

Referenced by OSDipApp::createModelMasterOnlys2(), and OSDipApp::createModelPart().

double OS_DipInterface::getObjectiveOffset (  ) 

Definition at line 149 of file OSDipInterface.cpp.

References getObjectiveConstants().

std::vector< std::set< int > > OS_DipInterface::getBlockVarIndexes (  ) 

Definition at line 213 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 605 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 281 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 361 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 162 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 673 of file OSDipInterface.cpp.

References OSInstance::getDenseObjectiveCoefficients(), and m_osinstance.

Referenced by OSDipApp::createModels().

const double OS_DipInterface::getBestKnownLB (  )  const [inline]

Definition at line 134 of file OSDipInterface.h.

References m_bestKnownLB.

const double OS_DipInterface::getBestKnownUB (  )  const [inline]

Definition at line 135 of file OSDipInterface.h.

References m_bestKnownUB.

const std::string* OS_DipInterface::getObjectiveMaxOrMins (  )  const [inline]

Get objective maxOrMins.

One maxOrMin for each objective.

Returns:
a std::string array of objective maxOrMins ("max" or "min"), null if no objectives.
Exceptions:
Exception if the elements in objectives are logically inconsistent.

Definition at line 146 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.

Returns:
a double array of objective constants, null if no objectives.
Exceptions:
Exception if the elements in objectives are logically inconsistent.

Definition at line 155 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.

Returns:
a double array of objective weights, null if no objectives.
Exceptions:
Exception if the elements in objectives are logically inconsistent.

Definition at line 163 of file OSDipInterface.h.

References OSInstance::getObjectiveWeights(), and m_osinstance.

const int OS_DipInterface::getNumberOfIntegerVariables (  )  const [inline]

getNumberOfIntegerVariables

Returns:
an integer which is the number of general integer variables.

Definition at line 169 of file OSDipInterface.h.

References OSInstance::getNumberOfIntegerVariables(), and m_osinstance.

const int OS_DipInterface::getNumberOfBinaryVariables (  )  const [inline]

getNumberOfBinaryVariables

Returns:
an integer which is the number of binary variables.

Definition at line 175 of file OSDipInterface.h.

References OSInstance::getNumberOfBinaryVariables(), and m_osinstance.

const int OS_DipInterface::getVariableNumber (  )  const [inline]

Get variable number.

Returns:
variable number.

Definition at line 183 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.

Returns:
constraint number.

Definition at line 190 of file OSDipInterface.h.

References OSInstance::getConstraintNumber(), and m_osinstance.

const double* OS_DipInterface::getColLower (  )  const [inline]

Get variable lower bounds.

Returns:
pointer to variable lower bounds.

Definition at line 197 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.

Returns:
pointer to variable upper bounds.

Definition at line 205 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.

Returns:
array of variable names.

Definition at line 213 of file OSDipInterface.h.

References OSInstance::getVariableNames(), and m_osinstance.

const double* OS_DipInterface::getRowLower (  )  const [inline]

Get constraint lower bounds.

Returns:
pointer to constraint lower bounds.

Definition at line 221 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.

Returns:
pointer to constraint upper bounds.

Definition at line 229 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.

Returns:
array of constraint names.

Definition at line 237 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 713 of file OSDipInterface.cpp.

References ErrorClass::errormsg, FileUtil::getFileAsString(), OSResult::getOptimalPrimalVariableValues(), OSInstance::getVariableNames(), DefaultSolver::osinstance, osinstance, DefaultSolver::osoption, osoption, DefaultSolver::osresult, OSiLReader::readOSiL(), DefaultSolver::solve(), and DefaultSolver::sSolverName.


Member Data Documentation

bool OS_DipInterface::m_isProvenOptimal

Best known LB/UB.

Definition at line 65 of file OSDipInterface.h.

double OS_DipInterface::m_bestKnownLB

Definition at line 66 of file OSDipInterface.h.

Referenced by getBestKnownLB().

double OS_DipInterface::m_bestKnownUB

Definition at line 67 of file OSDipInterface.h.

Referenced by getBestKnownUB().

OSInstance* OS_DipInterface::m_osinstance

Definition at line 71 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().

OSOption* OS_DipInterface::m_osoption

Definition at line 72 of file OSDipInterface.h.

Referenced by OSDipApp::generateInitVars(), getBlockFactories(), getBlockVarIndexes(), getCoreConstraintIndexes(), OSDipApp::initializeApp(), and readOSoL().

OSiLReader* OS_DipInterface::m_osilreader

Definition at line 73 of file OSDipInterface.h.

Referenced by readOSiL(), and ~OS_DipInterface().

OSoLReader* OS_DipInterface::m_osolreader

Definition at line 74 of file OSDipInterface.h.

Referenced by readOSoL(), and ~OS_DipInterface().

char* OS_DipInterface::m_integerVars

Definition at line 75 of file OSDipInterface.h.

Referenced by getIntegerColumns().

CoinPackedMatrix* OS_DipInterface::m_coinpm

Definition at line 76 of file OSDipInterface.h.

Referenced by OSDipApp::createModelPart(), getCoinPackedMatrix(), readOSiL(), and ~OS_DipInterface().

CoinPackedVector* OS_DipInterface::m_row

Definition at line 77 of file OSDipInterface.h.

Referenced by getRow().

std::vector<std::set<int> > OS_DipInterface::m_blockVariableIndexes

Definition at line 103 of file OSDipInterface.h.

Referenced by getBlockVarIndexes().

bool OS_DipInterface::m_blockVariableIndexesProcessed

Definition at line 104 of file OSDipInterface.h.

Referenced by getBlockVarIndexes().

std::set<int> OS_DipInterface::m_coreConstraintIndexes

Definition at line 108 of file OSDipInterface.h.

Referenced by getCoreConstraintIndexes().

bool OS_DipInterface::m_coreConstraintIndexesProcessed

Definition at line 109 of file OSDipInterface.h.

Referenced by getCoreConstraintIndexes().

std::vector<std::map<int, int> > OS_DipInterface::m_blockConstraintIndexes

Definition at line 115 of file OSDipInterface.h.

Referenced by getBlockConstraintIndexes().

bool OS_DipInterface::m_blockConstraintIndexesProcessed

Definition at line 116 of file OSDipInterface.h.

Referenced by getBlockConstraintIndexes().

std::vector<OSInstance* > OS_DipInterface::m_blockOSInstances

Definition at line 120 of file OSDipInterface.h.

Referenced by getBlockOSInstances(), and ~OS_DipInterface().

bool OS_DipInterface::m_blockOSInstancesProcessed

Definition at line 121 of file OSDipInterface.h.

Referenced by getBlockOSInstances().

std::vector<std::string > OS_DipInterface::m_blockFactories

Definition at line 126 of file OSDipInterface.h.

Referenced by getBlockFactories().

bool OS_DipInterface::m_blockFactoriesProcessed

Definition at line 127 of file OSDipInterface.h.

Referenced by getBlockFactories().


The documentation for this class was generated from the following files:
Generated on Sun Mar 20 03:11:28 2011 by  doxygen 1.4.7