18 #include "OSInstance.h"
24 #include "OSParameters.h"
27 #include "CoinTime.hpp"
36 # error "don't have header file for time"
46 using std::ostringstream;
64 #define LINDO_OP_CODE_CONVERSION \
65 std::map<int, int> nlNodeIdxLindo;\
66 nlNodeIdxLindo[OS_PLUS] = EP_PLUS; \
67 nlNodeIdxLindo[OS_SUM] = EP_SUM; \
68 nlNodeIdxLindo[OS_MINUS] = EP_MINUS; \
69 nlNodeIdxLindo[OS_NEGATE] = EP_NEGATE; \
70 nlNodeIdxLindo[OS_TIMES] = EP_MULTIPLY; \
71 nlNodeIdxLindo[OS_DIVIDE] = EP_DIVIDE; \
72 nlNodeIdxLindo[OS_POWER] = EP_POWER; \
73 nlNodeIdxLindo[OS_SQRT] = EP_SQRT; \
74 nlNodeIdxLindo[OS_LN] = EP_LN; \
75 nlNodeIdxLindo[OS_EXP] = EP_EXP; \
76 nlNodeIdxLindo[OS_NUMBER] = EP_PUSH_NUM; \
77 nlNodeIdxLindo[OS_VARIABLE] = EP_PUSH_VAR;\
78 nlNodeIdxLindo[OS_IF] = EP_IF; \
79 nlNodeIdxLindo[OS_ABS] = EP_ABS; \
80 nlNodeIdxLindo[OS_MAX] = EP_MAX; \
81 nlNodeIdxLindo[OS_MIN] = EP_MIN; \
82 nlNodeIdxLindo[OS_SQUARE] = EP_SQR; \
83 nlNodeIdxLindo[OS_SIN] = EP_SIN; \
84 nlNodeIdxLindo[OS_COS] = EP_COS;
91 m_iNumberNewSlacks( 0),
153 if(
osil.length() == 0 &&
osinstance == NULL)
throw ErrorClass(
"there is no instance");
155 bool newOSiLReader =
false;
160 newOSiLReader =
true;
170 "HERE I AM 1 !!!!!!!!!!!!!!!!!!!\n");
176 "HERE I AM 2 !!!!!!!!!!!!!!!!!!!\n");
184 "Start process variables !!!!!!!!!\n");
189 "Finish process variables !!!!!!!!!\n");
191 "Start process constraints !!!!!!!!!\n");
196 "Finish process constraints !!!!!!!!!\n");
198 "Start generateLindoModel() !!!!!!!!!\n");
203 "Finish generateLindoModel() !!!!!!!!!\n");
211 catch(
const ErrorClass& eclass)
217 throw ErrorClass(
osrl) ;
229 catch(
const ErrorClass& eclass)
235 throw ErrorClass(
osrl) ;
245 double start = CoinCpuTime();
247 cpuTime = CoinCpuTime() - start;
292 throw ErrorClass(
"LINDO cannot handle unbounded constraints");
316 std::ostringstream outStr;
324 ostringstream varName;
326 std::string tmpstring;
330 int* pacAcols = NULL;
338 pachVartypes[ i] =
'C';
339 varName <<
"xyzabc_" ;
342 tmpstring = varName.str();
343 p =
new char[tmpstring.size() + 1];
344 strcpy(p, tmpstring.c_str());
348 if( m_iNumberNewSlacks == 1) paszVarnames[i] = &ch;
349 else paszVarnames[i] = p;
356 if(padU[ i] - padC[i]< 0)
return false;
362 outStr <<
"The number of new slack variables is: " << m_iNumberNewSlacks << endl;
365 outStr << paszVarnames[ i] << endl;
370 if(!LSaddVariables(
pModel_, m_iNumberNewSlacks, pachVartypes, paszVarnames, paiAcols,
371 pacAcols, padAcoef, paiArows, padC, padL, padU))
373 if(m_iNumberNewSlacks > 0)
383 if( m_iNumberNewSlacks == 1)
391 delete[] paszVarnames;
392 delete[] pachVartypes;
441 std::ostringstream outStr;
448 char *MY_LICENSE_KEY = NULL;
449 MY_LICENSE_KEY = getenv(
"LINDOAPI_LICENSE_FILE");
475 int *colLength = NULL;
485 int iNumFakeNonz = 1;
488 paiArrayIdx =
new int[ 1];
492 padValArray =
new double[ 1];
511 colLength, padValArray,
526 lindoAPIErrorCheck(
"Error with LSloadLPData when the number of nonzeros is greater than 0");
546 ostringstream outStr;
548 bool isNonlinear =
false;
551 std::string description =
"";
554 throw ErrorClass(
"OSResult error: setSolverInvoked");
556 throw ErrorClass(
"OSResult error: setServiceName");
559 throw ErrorClass(
"OSResult error: setInstanceName");
569 if( isNonlinear ==
true )
573 "We are using the LINDO Global Optimizer\n");
576 LSgetInfo (
pModel_, LS_IINFO_GOP_STATUS, &nSolStatus);
581 "We are using the LINDO LSsolveMIP Optimizer\n");
587 throw ErrorClass(
"OSResult error: setVariableNumer");
589 throw ErrorClass(
"OSResult error: setObjectiveNumber");
591 throw ErrorClass(
"OSResult error: setConstraintNumber");
593 throw ErrorClass(
"OSResult error: setSolutionNumer");
596 outStr <<
"Solution Status = " << nSolStatus << endl;
624 || (isNonlinear ==
false) )
627 lindoAPIErrorCheck(
"Error trying to obtain primal solution with integer variables present");
633 lindoAPIErrorCheck(
"Error trying to obtain primal solution with NO integer variables present");
638 || (isNonlinear ==
false) )
641 lindoAPIErrorCheck(
"Error trying to obtain dual solution with integer variables present");
646 lindoAPIErrorCheck(
"Error trying to obtain dual solution with NO integer variables present");
651 || (isNonlinear ==
false ) )
659 lindoAPIErrorCheck(
"Error trying to obtain the reduced costs with NO integer variables present");;
663 int numberOfOtherVariableResult = 1;
670 srcost[ i] = outStr.str();
676 || (isNonlinear ==
false ) )
679 lindoAPIErrorCheck(
"Error trying to obtain optimal objective value with integer variables present");
683 LSgetInfo(
pModel_, LS_DINFO_GOP_OBJ, &z[0]);
684 lindoAPIErrorCheck(
"Error trying to obtain optimal objective value with NO integer variables present");
721 "WE ARE PROCESSING QUADRATIC TERMS\n");
724 if(nQCnnz <= 0)
return false;
725 std::map<std::string, double> mapQuadraticAdjustMap;
726 std::map<std::string, double>::iterator mapPointer;
729 int iVarOneIndex, iVarTwoIndex;
734 int iStringPostionOne, iStringPostionTwo;
740 std::ostringstream ostrRow, ostr1, ostr2;
741 std::string sIndexRow, sIndex1, sIndex2;
743 for ( i = 0; i < nQCnnz; i++)
745 iRowIndex = paiQCrows[i];
749 iVarOneIndex = (paiQCcols1[i] >= paiQCcols2[i])?paiQCcols2[i]:paiQCcols1[i];
750 iVarTwoIndex = (paiQCcols1[i] <= paiQCcols2[i])?paiQCcols2[i]:paiQCcols1[i];
751 ostrRow << iRowIndex;
754 sIndexRow = ostrRow.str();
755 sIndex2 = ostr2.str();
756 sIndex1 = ostr1.str();
762 sKey = sIndexRow +
"," + sIndex1 +
"," + sIndex2;
764 mapPointer = mapQuadraticAdjustMap.find(sKey);
765 if (mapPointer != mapQuadraticAdjustMap.end())
767 dValue = mapPointer->second;
768 dValue += padQCcoef[i];
769 mapQuadraticAdjustMap[sKey] = dValue;
773 mapQuadraticAdjustMap[sKey] = padQCcoef[i];
778 int iNumberOfQuadraticTerms = 0;
779 for (mapPointer = mapQuadraticAdjustMap.begin(); mapPointer != mapQuadraticAdjustMap.end(); ++mapPointer)
781 sKey = mapPointer->first;
782 dValue = mapPointer->second;
783 iStringPostionOne = sKey.find_first_of(
',');
784 iStringPostionTwo = sKey.find_last_of(
',');
786 iRowIndex = atoi(sKey.substr(0, iStringPostionOne).c_str());
787 iVarOneIndex = atoi(sKey.substr(iStringPostionOne + 1, iStringPostionTwo).c_str());
788 iVarTwoIndex = atoi(sKey.substr(iStringPostionTwo + 1).c_str());
790 if ( iVarOneIndex == iVarTwoIndex)
795 paiQCrows[iNumberOfQuadraticTerms] = iRowIndex;
796 paiQCcols1[iNumberOfQuadraticTerms] = iVarOneIndex;
797 paiQCcols2[iNumberOfQuadraticTerms] = iVarTwoIndex;
799 padQCcoef[iNumberOfQuadraticTerms] = dValue ;
800 iNumberOfQuadraticTerms ++;
803 if(!LSloadQCData(
pModel_, nQCnnz, paiQCrows, paiQCcols1,
804 paiQCcols2, padQCcoef))
return true;
820 std::ostringstream outStr;
823 "PROCESS NONLINEAR TERMS\n");
828 outStr <<
"The number of objectives with nonlinear terms is: "
830 outStr <<
"The number of constraints with nonlinear terms is: "
842 std::map<double, int> mapNewNumber;
845 std::map<double, int>::iterator
pos;
852 std::vector<int> insList;
860 std::map<int, OSExpressionTree*> allExpTrees;
867 std::vector<OSnLNode*> postFixVec;
870 std::map<int, OSExpressionTree*>::iterator posTree;
881 int *piObjSense = NULL;
886 double *padVarLowerBounds = NULL;
891 double *padVarUpperBounds = NULL;
894 double *padVarval = NULL;
899 char *pachVarType = NULL;
903 char *pachConType = NULL;
906 int iNumNonlinearNonz = 0;
909 double *padNonlinearNonz = NULL;
917 int *paiConsBegin = NULL;
918 if(iNumberOfNonlinearConstraints > 0) paiConsBegin =
new int[ iNumberOfNonlinearConstraints];
923 int *paiConsLength = NULL;
924 if(iNumberOfNonlinearConstraints > 0) paiConsLength =
new int[ iNumberOfNonlinearConstraints];
932 int *paiObjsBegin = NULL;
933 if(iNumberOfNonlinearObjectives > 0) paiObjsBegin =
new int[ iNumberOfNonlinearObjectives];
938 int *paiObjsLength = NULL;
939 if(iNumberOfNonlinearObjectives > 0) paiObjsLength =
new int[ iNumberOfNonlinearObjectives];
947 int iNumberOfNewVariables = 0;
953 int iInstListLength = 0;
956 int *paiNonlinearConIndex = NULL;
957 if(iNumberOfNonlinearConstraints > 0) paiNonlinearConIndex =
new int[ iNumberOfNonlinearConstraints];
969 for(posTree = allExpTrees.begin(); posTree != allExpTrees.end(); ++posTree)
973 outStr <<
"HERE IS EXPRESSION TREE " << posTree->first << endl;
976 postFixVec = posTree->second->m_treeRoot->getPostfixFromExpressionTree();
977 int iVecSize = postFixVec.size();
981 for(i = 0; i < iVecSize; i++)
983 iNodeID = postFixVec[i]->inodeInt;
987 insList.push_back( nlNodeIdxLindo[
OS_SUM] );
988 insList.push_back( postFixVec[i]->inumberOfChildren);
992 insList.push_back( nlNodeIdxLindo[
OS_MAX] );
993 insList.push_back( postFixVec[i]->inumberOfChildren);
997 throw ErrorClass(
"Error: OS_PRODUCT operator not supported by Lindo");
1001 insList.push_back( EP_PUSH_NUM );
1003 pos = mapNewNumber.find( numNode->
value);
1004 if(pos == mapNewNumber.end() )
1008 outStr <<
"FOUND A NEW NUMBER " << numNode->
value << endl;
1010 insList.push_back( iNumNonlinearNonz);
1011 mapNewNumber[ numNode->
value] = iNumNonlinearNonz++;
1013 else insList.push_back( pos->second);
1017 insList.push_back( EP_PUSH_VAR );
1019 insList.push_back( varNode->
idx );
1022 if(varNode->
coef != 1)
1025 insList.push_back( EP_PUSH_NUM );
1026 pos = mapNewNumber.find( varNode->
coef);
1027 if(pos == mapNewNumber.end() )
1031 outStr <<
"FOUND A NEW NUMBER " << varNode->
coef << endl;
1033 insList.push_back( iNumNonlinearNonz);
1034 mapNewNumber[ varNode->
coef] = iNumNonlinearNonz++;
1036 else insList.push_back( pos->second);
1037 insList.push_back( EP_MULTIPLY);
1041 insList.push_back( nlNodeIdxLindo[iNodeID] );
1046 if(posTree->first < 0)
1050 paiObjsBegin[ iCountObjs] = iInstListLength;
1051 paiObjsLength[ iCountObjs] = insList.size() - iInstListLength;
1052 iInstListLength = insList.size();
1058 paiConsBegin[ iCountCons] = iInstListLength;
1059 paiConsLength[ iCountCons] = insList.size() - iInstListLength;
1060 paiNonlinearConIndex[ iCountCons] = posTree->first;
1063 outStr <<
"CONSTRAINT ILIST LENGTH = " << iInstListLength << endl;
1065 iInstListLength = insList.size();
1072 padNonlinearNonz =
new double[ iNumNonlinearNonz];
1075 for(pos = mapNewNumber.begin(); pos != mapNewNumber.end(); ++
pos)
1077 padNonlinearNonz[ pos->second] = pos->first;
1078 outStr <<
"INDEX = " << pos->second <<
" NUMBER = " << pos->first << endl;
1082 paiInsList =
new int[ iInstListLength];
1083 copy(insList.begin(), insList.end(), paiInsList);
1087 int nLinearz, nAutoDeriv;
1092 LS_IPARAM_NLP_LINEARZ, nLinearz);
1100 LS_IPARAM_NLP_AUTODERIV, nAutoDeriv);
1105 outStr <<
"iNumberOfNonlinearConstraints= " << iNumberOfNonlinearConstraints << std::endl;
1106 outStr <<
"iNumberOfNonlinearObjectives= " << iNumberOfNonlinearObjectives << std::endl;
1107 outStr <<
"iNumberOfNewVariables = " << iNumberOfNewVariables << std::endl;
1108 outStr <<
"iNumNonlinearNonz = " << iNumNonlinearNonz << std::endl;
1109 outStr <<
"piObjSense = " <<
"NULL" << std::endl ;
1110 outStr <<
"pachConType = " <<
"NULL" << std::endl ;
1111 outStr <<
"pachVarType = " <<
"NULL" << std::endl ;
1113 outStr <<
"Here is the instruction list" << std::endl;
1114 for(kl = 0; kl < iInstListLength; kl++)
1116 outStr <<
"instruction list num " << paiInsList[ kl] << endl;
1118 outStr <<
"Number of terms in instruction list " << iInstListLength << std::endl;
1119 outStr <<
"Here are the constraint indices " << std::endl;
1120 for(kl = 0; kl < iNumberOfNonlinearConstraints; kl++)
1122 outStr <<
"con idx " << paiNonlinearConIndex[ kl] << endl;
1124 outStr <<
"Here come the nonlinear nonzeros " << std::endl;
1125 for(kl = 0; kl < iNumNonlinearNonz; kl++)
1127 outStr <<
"nonz value = " << padNonlinearNonz[ kl] << endl;
1129 outStr <<
"padVarval = " <<
"NULL" << std::endl ;
1130 for(kl = 0; kl < iNumberOfNonlinearObjectives; kl++)
1132 outStr <<
"obj inst begin = " << paiObjsBegin[ kl] << endl;
1134 for(kl = 0; kl < iNumberOfNonlinearObjectives; kl++)
1136 outStr <<
"obj inst list length = " << paiObjsLength[ kl] << endl;
1138 for(kl = 0; kl < iNumberOfNonlinearConstraints; kl++)
1140 outStr <<
"constraint inst begin = " << paiConsBegin[ kl] << endl;
1142 for(kl = 0; kl < iNumberOfNonlinearConstraints; kl++)
1144 outStr <<
"constraints inst list length = " << paiConsLength[ kl] << endl;
1146 outStr <<
"padVarLowerBounds = " <<
"NULL" << std::endl ;
1147 outStr <<
"padUpperBounds = " <<
"NULL" << std::endl ;
1151 iNumberOfNonlinearObjectives, iNumberOfNewVariables, iNumNonlinearNonz,
1152 piObjSense, pachConType, pachVarType, paiInsList, iInstListLength, paiNonlinearConIndex,
1153 padNonlinearNonz, padVarval, paiObjsBegin, paiObjsLength, paiConsBegin,
1154 paiConsLength, padVarLowerBounds, padVarUpperBounds);
1159 if( iNumberOfNonlinearConstraints > 0)
delete[] paiConsBegin;
1160 if( iNumberOfNonlinearConstraints > 0)
delete[] paiConsLength;
1161 if( iNumberOfNonlinearObjectives > 0)
delete[] paiObjsBegin;
1162 if( iNumberOfNonlinearObjectives > 0)
delete[] paiObjsLength;
1163 if( iNumberOfNonlinearConstraints > 0)
delete[] paiNonlinearConIndex;
1164 if( iNumNonlinearNonz > 0)
delete[] padNonlinearNonz;
1165 if( iInstListLength > 0)
delete[] paiInsList;
1166 mapNewNumber.clear();
1168 allExpTrees.clear();
1190 std::ostringstream outStr;
1215 else outStr <<
"problem is a maximization" << endl;
1265 ostringstream outStr;
1266 std::string error = errormsg;
1267 char lindoerrormsg[LS_MAX_ERROR_MESSAGE_LENGTH];
1271 error =
"LINDO ERROR: "+ error;
1272 outStr << error << endl;
1275 error = lindoerrormsg;
1276 outStr <<
"LINDO ERROR MESSAGE: " << error;
1278 error = outStr.str();
double * getConstraintLowerBounds()
Get constraint lower bounds.
double * getVariableLowerBounds()
Get variable lower bounds.
double * getConstraintUpperBounds()
Get constraint upper bounds.
double coef
coef is an option coefficient on the variable, the default value is 1.0
std::string OSgetVersionInfo()
Constraints * constraints
constraints is a pointer to a Constraints object
int getNumberOfIntegerVariables()
getNumberOfIntegerVariables
char * getVariableTypes()
Get variable initial values.
bool optimize()
invoke the Lindo API solver
bool setSolutionStatus(int solIdx, std::string type, std::string description)
Set the [i]th optimization solution status, where i equals the given solution index.
bool setPrimalVariableValuesDense(int solIdx, double *x)
Set the [i]th optimization solution's primal variable values, where i equals the given solution index...
const OSSmartPtr< OSOutput > osoutput
OSrLWriter * osrlwriter
osrlwriter object used to write osrl from an OSResult object
double * m_mdVarUB
m_mdUb holds an array of variable upper bounds.
pos
position where the operator should be printed when printing the expression
int getVariableNumber()
Get number of variables.
std::string osrl
osrl holds the solution or result of the model
bool setServiceName(std::string serviceName)
Set service name.
void dataEchoCheck()
use this for debugging, print out the instance that the solver thinks it has and compare this with th...
bool setVariableNumber(int variableNumber)
Set the variable number.
int idx
idx is the index of the variable
std::string osil
osil holds the problem instance as a std::string
std::string errormsg
errormsg is the error that is causing the exception to be thrown
int m_iNumberNewSlacks
m_iNumberNewSlacks is the number of slack variables to add
int getLinearConstraintCoefficientNumber()
Get number of specified (usually nonzero) linear constraint coefficient values.
bool setSolverInvoked(std::string solverInvoked)
Set solver invoked.
bool bCallbuildSolverInstance
bCallbuildSolverInstance is set to true if buildSolverService has been called
bool setTime(double time)
Set time.
Take an OSResult object and write a string that validates against OSrL.
OSResult * osresult
osresult holds the solution or result of the model in-memory as an OSResult object ...
double * m_mdConUB
m_mdRhs holds an array of the constraint upper bounds.
bool setDualVariableValuesDense(int solIdx, double *y)
Set the [i]th optimization solution's dual variable values, where i equals the given solution index...
bool setAnOtherVariableResultDense(int solIdx, int otherIdx, std::string name, std::string value, std::string description, std::string *s)
Set the [i]th optimization solution's other (non-standard/solver specific)variable-related results...
int getObjectiveNumber()
Get number of objectives.
bool setObjectiveNumber(int objectiveNumber)
Set the objective number.
bool setInstanceName(std::string instanceName)
Set instance name.
bool processNonlinearExpressions()
read the nonlinear terms in the model
OSInstance * readOSiL(const std::string &osil)
parse the OSiL model instance.
std::string * getVariableNames()
Get variable names.
void lindoAPIErrorCheck(std::string errormsg)
Lindo's generalized error Reporting function.
double * m_mdRhsValue
m_mdRhsValue is used to the store the constraint rhs if we do not use row upper and lower bounds ...
int getNumberOfNonlinearExpressions()
Get number of nonlinear expressions.
std::string writeOSrL(OSResult *theosresult)
create an osrl string from an OSResult object
int numberOfObjectives
numberOfObjectives is the number of objective functions in the instance
int * m_miSlackIdx
because LINDO API does not take row ranges we need some extra stuff m_miSlackIdx indexes the rows tha...
bool processVariables()
read the OSiL instance variables and put these into the LINDO API variables
int * indexes
indexes holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
bool setSolutionNumber(int number)
set the number of solutions.
double ** getDenseObjectiveCoefficients()
getDenseObjectiveCoefficients.
The OSnLNodeNumber Class.
int getNumberOfNonlinearConstraints()
bool setConstraintNumber(int number)
set the number of constraints.
Used to read an OSiL string.
bool setNumberOfOtherVariableResults(int solIdx, int numberOfOtherVariableResults)
Set the [i]th optimization solution's other (non-standard/solver specific) variable-related results...
bool addSlackVars()
LINDO does not handle constraints with upper and lower bounds this method is part of kludge where we ...
std::string * m_msVarName
m_msVarName holds an array of variable std::string names.
double * m_mdConLB
m_mdLhs holds an array of the constraint lower bounds.
char * getConstraintTypes()
Get constraint types.
LindoSolver()
the LindoSolver class constructor
int * varOneIndexes
varOneIndexes holds an integer array of the first variable indexes of all the quadratic terms...
The OSnLNodeVariable Class.
bool addConstraint(int index, std::string name, double lowerBound, double upperBound, double constant)
add a constraint.
int m_iLindoErrorCode
m_iErrorCode is a variable for LINDO error codes
std::string * getObjectiveMaxOrMins()
Get objective maxOrMins.
double value
value is the value of the number
SparseMatrix * getLinearConstraintCoefficientsInColumnMajor()
Get linear constraint coefficients in column major.
char * m_mcVarType
m_vcVarType holds an array of variable types (character), e.g.
bool setGeneralMessage(std::string message)
Set the general message.
double * values
values holds a double array of value elements in coefMatrix (AMatrix), which contains nonzero element...
OSInstance * osinstance
osinstance holds the problem instance in-memory as an OSInstance object
double * getObjectiveConstants()
Get objective constants.
int numberOfConstraints
numberOfConstraints is the number of constraints in the instance
bool processQuadraticTerms()
read the quadratic terms in the model
bool setGeneralStatusType(std::string type)
Set the general status type, which can be: success, error, warning.
std::string getInstanceName()
Get instance name.
InstanceData * instanceData
A pointer to an InstanceData object.
virtual void buildSolverInstance()
buildSolverInstance is a virtual function – the actual solvers will implement their own buildSolverIn...
~LindoSolver()
the LindoSolver class destructor
int getConstraintNumber()
Get number of constraints.
Objective ** obj
coef is pointer to an array of ObjCoef object pointers
bool setConstraintNumber(int constraintNumber)
Set the constraint number.
char * m_mcRowType
m_mcRowType - E for equality, L for less than, G for greater than – used if we do not store rows usin...
#define LINDO_OP_CODE_CONVERSION
std::string writeOSiL(const OSInstance *theosinstance)
create an osil string from an OSInstance object
int CALLTYPE LSwriteMPIFile(pLSmodel pModel, char *pszFname)
int getNumberOfQuadraticTerms()
Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.
Objectives * objectives
objectives is a pointer to a Objectives object
std::string getInstanceSource()
Get instance source.
int * rowIndexes
rowIndexes holds an integer array of row indexes of all the quadratic terms.
int * starts
starts holds an integer array of start elements in coefMatrix (AMatrix), which points to the start of...
QuadraticTerms * getQuadraticTerms()
Get all the quadratic terms in the instance.
double * getVariableUpperBounds()
Get variable upper bounds.
bool setObjectiveValuesDense(int solIdx, double *objectiveValues)
Set the [i]th optimization solution's objective values, where i equals the given solution index...
bool generateLindoModel()
create the LINDO environment and read the problem into the internal LINDO data structures ...
double * m_mdVarLB
m_mdLb holds an array of variable lower bounds.
virtual void setSolverOptions()
The implementation of the virtual functions.
bool processConstraints()
read the OSiL instance constraints and put these into the LINDO API constraints
double * coefficients
coefficients holds a double array all the quadratic term coefficients.
pLSenv pEnv_
declare an instance of the LINDO environment object
int * varTwoIndexes
varTwoIndexes holds an integer array of the second variable indexes of all the quadratic terms...
std::string * getConstraintNames()
Get constraint names.
bool initializeNonLinearStructures()
Initialize the data structures for the nonlinear API.
used for throwing exceptions.
virtual void solve()
solve results in an instance being read into the Lindo data structures and optimized ...
OSiLReader * m_osilreader
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed ...
Take an OSInstance object and write a string that validates against the OSiL schema.
std::string * m_msConName
m_msConName holds an array of constraint std::string names.
int getNumberOfBinaryVariables()
getNumberOfBinaryVariables
std::string getInstanceDescription()
Get instance description.
std::map< int, ScalarExpressionTree * > getAllNonlinearExpressionTreesMod()
void fint fint fint real fint real * x
int getNumberOfNonlinearObjectives()
pLSmodel pModel_
declare an instance of the LINDO model object
char ** m_mmcVarName
m_mmcVarName holds an array of char arrays.