the LindoSolver class solves problems using Lindo. More...
#include <OSLindoSolver.h>
Public Member Functions | |
LindoSolver () | |
the LindoSolver class constructor | |
~LindoSolver () | |
the LindoSolver class destructor | |
virtual void | solve () |
solve results in an instance being read into the Knitro data structrues and optimized | |
virtual void | buildSolverInstance () throw (ErrorClass) |
buildSolverInstance is a virtual function -- the actual solvers will implement their own solve method -- the solver instance is the instance the individual solver sees in its api | |
bool | optimize () |
invoke the Lindo API solver | |
bool | processVariables () |
read the OSiL instance variables and put these into the LINDO API variables | |
bool | processConstraints () |
read the OSiL instance constraints and put these into the LINDO API constraints | |
bool | generateLindoModel () |
create the LINDO environment and read the problem into the internal LINDO data structures | |
bool | addSlackVars () |
LINDO does not handle constraints with upper and lower bounds this method is part of kludge where we add a new variable to handle the bounds. | |
bool | processQuadraticTerms () |
read the quadratic terms in the model | |
bool | processNonlinearExpressions () |
read the nonlinear terms in the model | |
void | dataEchoCheck () |
use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file | |
Public Attributes | |
OSiLReader * | m_osilreader |
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed | |
Protected Member Functions | |
void | lindoAPIErrorCheck (std::string errormsg) |
Lindo's generalized error Reporting function. | |
Private Attributes | |
pLSenv | pEnv_ |
declare an instance of the LINDO environment object | |
pLSmodel | pModel_ |
declare an instance of the LINDO model object | |
int | m_iLindoErrorCode |
m_iErrorCode is a variable for LINDO error codes | |
int * | m_miSlackIdx |
because LINDO API does not take row ranges we need some extra suff m_miSlackIdx indexes the rows that get additional slack variable | |
int | m_iNumberNewSlacks |
m_iNumberNewSlacks is the number of slack variables to add | |
double * | m_mdRhsValue |
m_mdRhsValue is used to the store the constraint rhs if we do not use row upper and lower bounds | |
char * | m_mcRowType |
m_mcRowType - E for equality, L for less than, G for greater than -- used if we do not store rows using upper and lower bounds | |
double * | m_mdVarLB |
m_mdLb holds an array of variable lower bounds. | |
double * | m_mdVarUB |
m_mdUb holds an array of variable upper bounds. | |
double * | m_mdConLB |
m_mdLhs holds an array of the constraint lower bounds. | |
double * | m_mdConUB |
m_mdRhs holds an array of the constraint upper bounds. | |
char ** | m_mmcVarName |
m_mmcVarName holds an array of char arrays. | |
std::string * | m_msVarName |
m_msVarName holds an array of variable std::string names. | |
std::string * | m_msConName |
m_msConName holds an array of constraint std::string names. | |
char * | m_mcVarType |
m_vcVarType holds an array of variable types (character), e.g. | |
double | m_mdObjConstant |
m_mdObjConstant holds an array of objective function constants. | |
OSrLWriter * | osrlwriter |
osrlwriter object used to write osrl from and OSResult object |
the LindoSolver class solves problems using Lindo.
Definition at line 50 of file OSLindoSolver.h.
LindoSolver::LindoSolver | ( | ) |
the LindoSolver class constructor
LindoSolver::~LindoSolver | ( | ) |
the LindoSolver class destructor
virtual void LindoSolver::solve | ( | ) | [virtual] |
solve results in an instance being read into the Knitro data structrues and optimized
Implements DefaultSolver.
virtual void LindoSolver::buildSolverInstance | ( | ) | throw (ErrorClass) [virtual] |
buildSolverInstance is a virtual function -- the actual solvers will implement their own solve method -- the solver instance is the instance the individual solver sees in its api
Implements DefaultSolver.
bool LindoSolver::optimize | ( | ) |
invoke the Lindo API solver
bool LindoSolver::processVariables | ( | ) |
read the OSiL instance variables and put these into the LINDO API variables
bool LindoSolver::processConstraints | ( | ) |
read the OSiL instance constraints and put these into the LINDO API constraints
bool LindoSolver::generateLindoModel | ( | ) |
create the LINDO environment and read the problem into the internal LINDO data structures
bool LindoSolver::addSlackVars | ( | ) |
LINDO does not handle constraints with upper and lower bounds this method is part of kludge where we add a new variable to handle the bounds.
bool LindoSolver::processQuadraticTerms | ( | ) |
read the quadratic terms in the model
bool LindoSolver::processNonlinearExpressions | ( | ) |
read the nonlinear terms in the model
void LindoSolver::dataEchoCheck | ( | ) |
use this for debugging, print out the instance that the solver thinks it has and compare this with the OSiL file
void LindoSolver::lindoAPIErrorCheck | ( | std::string | errormsg | ) | [protected] |
Lindo's generalized error Reporting function.
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
Definition at line 124 of file OSLindoSolver.h.
pLSenv LindoSolver::pEnv_ [private] |
declare an instance of the LINDO environment object
Definition at line 138 of file OSLindoSolver.h.
pLSmodel LindoSolver::pModel_ [private] |
declare an instance of the LINDO model object
Definition at line 141 of file OSLindoSolver.h.
int LindoSolver::m_iLindoErrorCode [private] |
m_iErrorCode is a variable for LINDO error codes
Definition at line 144 of file OSLindoSolver.h.
int* LindoSolver::m_miSlackIdx [private] |
because LINDO API does not take row ranges we need some extra suff m_miSlackIdx indexes the rows that get additional slack variable
Definition at line 148 of file OSLindoSolver.h.
int LindoSolver::m_iNumberNewSlacks [private] |
m_iNumberNewSlacks is the number of slack variables to add
Definition at line 151 of file OSLindoSolver.h.
double* LindoSolver::m_mdRhsValue [private] |
m_mdRhsValue is used to the store the constraint rhs if we do not use row upper and lower bounds
Definition at line 156 of file OSLindoSolver.h.
char* LindoSolver::m_mcRowType [private] |
m_mcRowType - E for equality, L for less than, G for greater than -- used if we do not store rows using upper and lower bounds
Definition at line 161 of file OSLindoSolver.h.
double* LindoSolver::m_mdVarLB [private] |
m_mdLb holds an array of variable lower bounds.
Definition at line 166 of file OSLindoSolver.h.
double* LindoSolver::m_mdVarUB [private] |
m_mdUb holds an array of variable upper bounds.
Definition at line 171 of file OSLindoSolver.h.
double* LindoSolver::m_mdConLB [private] |
m_mdLhs holds an array of the constraint lower bounds.
Definition at line 176 of file OSLindoSolver.h.
double* LindoSolver::m_mdConUB [private] |
m_mdRhs holds an array of the constraint upper bounds.
Definition at line 181 of file OSLindoSolver.h.
char** LindoSolver::m_mmcVarName [private] |
m_mmcVarName holds an array of char arrays.
Definition at line 186 of file OSLindoSolver.h.
std::string* LindoSolver::m_msVarName [private] |
m_msVarName holds an array of variable std::string names.
Definition at line 191 of file OSLindoSolver.h.
std::string* LindoSolver::m_msConName [private] |
m_msConName holds an array of constraint std::string names.
Definition at line 196 of file OSLindoSolver.h.
char* LindoSolver::m_mcVarType [private] |
m_vcVarType holds an array of variable types (character), e.g.
'C' for continuous type, 'I' for integer type, 'B' for binary type, 'S' for std::string type).
Definition at line 202 of file OSLindoSolver.h.
double LindoSolver::m_mdObjConstant [private] |
m_mdObjConstant holds an array of objective function constants.
Definition at line 206 of file OSLindoSolver.h.
OSrLWriter* LindoSolver::osrlwriter [private] |
osrlwriter object used to write osrl from and OSResult object
Definition at line 209 of file OSLindoSolver.h.