LindoSolver Class Reference

the LindoSolver class solves problems using Lindo. More...

#include <OSLindoSolver.h>

Inheritance diagram for LindoSolver:
Inheritance graph
[legend]
Collaboration diagram for LindoSolver:
Collaboration graph
[legend]

List of all members.

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

OSiLReaderm_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.
OSrLWriterosrlwriter
 osrlwriter object used to write osrl from and OSResult object

Detailed Description

the LindoSolver class solves problems using Lindo.

Author:
Robert Fourer, Jun Ma, Kipp Martin
Version:
1.0, 03/14/2004
Since:
OS 1.0
Remarks:
this class takes an OSiL instance and optimizes it using the Lindo API

Definition at line 50 of file OSLindoSolver.h.


Constructor & Destructor Documentation

LindoSolver::LindoSolver (  ) 

the LindoSolver class constructor

LindoSolver::~LindoSolver (  ) 

the LindoSolver class destructor


Member Function Documentation

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

Returns:
true if an exception is not thrown.
bool LindoSolver::processVariables (  ) 

read the OSiL instance variables and put these into the LINDO API variables

Returns:
true if an exception is not thrown.
bool LindoSolver::processConstraints (  ) 

read the OSiL instance constraints and put these into the LINDO API constraints

Returns:
true if an exception is not thrown.
bool LindoSolver::generateLindoModel (  ) 

create the LINDO environment and read the problem into the internal LINDO data structures

Returns:
true if an exception is not thrown.
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.

Returns:
true if an exception is not thrown.
bool LindoSolver::processQuadraticTerms (  ) 

read the quadratic terms in the model

Returns:
true if an exception is not thrown.
bool LindoSolver::processNonlinearExpressions (  ) 

read the nonlinear terms in the model

Returns:
true if an exception is not thrown.
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.


Member Data Documentation

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.

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.

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 object used to write osrl from and OSResult object

Definition at line 209 of file OSLindoSolver.h.


The documentation for this class was generated from the following file:

Generated on 15 Mar 2015 for Coin-All by  doxygen 1.6.1