23 #include "OSParameters.h"
25 #include "CoinFinite.hpp"
26 #include "CoinTime.hpp"
30 using namespace Bonmin;
31 using namespace Ipopt;
34 using std::ostringstream;
50 if(m_osilreader != NULL)
delete m_osilreader;
52 if(m_osolreader != NULL)
delete m_osolreader;
55 if(osrlwriter != NULL )
delete osrlwriter;
74 for(i = 0; i <
n; i++)
76 if( varType[i] ==
'B')
78 var_types[i] = BINARY;
82 if( varType[i] ==
'I')
88 if( varType[i] ==
'C')
90 var_types[i] = CONTINUOUS;
94 throw ErrorClass(
"variable type not yet implemented");
105 std::ostringstream outStr;
121 std::map<int, int> varIndexMap;
122 std::map<int, int>::iterator posVarIndexMap;
128 for(i = 0; i <
n; i++)
138 for(posVarIndexMap = varIndexMap.begin(); posVarIndexMap != varIndexMap.end(); ++posVarIndexMap)
140 outStr <<
"Variable Index = " << posVarIndexMap->first << std::endl ;
141 var_types[ posVarIndexMap->first] = Ipopt::TNLP::NON_LINEAR;
143 outStr <<
"Number of nonlinear variables = " << varIndexMap.size() << std::endl;
151 std::ostringstream outStr;
154 for(i = 0; i <
m; i++)
163 for(i = 0; i < mm; i++)
178 Index& nnz_h_lag, TNLP::IndexStyleEnum& index_style)
180 std::ostringstream outStr;
189 outStr <<
"Bonmin number variables !!!!!!!!!!!!!!!!!!!!!!!!!!!" << n << endl;
190 outStr <<
"Bonmin number constraints !!!!!!!!!!!!!!!!!!!!!!!!!!!" << m << endl;
218 outStr <<
"nnz_jac_g !!!!!!!!!!!!!!!!!!!!!!!!!!!" << nnz_jac_g << endl;
236 outStr <<
"nnz_h_lag !!!!!!!!!!!!!!!!!!!!!!!!!!!" << nnz_h_lag << endl;
240 index_style = TNLP::C_STYLE;
247 Index
m, Number* g_l, Number* g_u)
249 std::ostringstream outStr;
256 for(i = 0; i <
n; i++)
258 x_l[ i] = mdVarLB[ i];
259 x_u[ i] = mdVarUB[ i];
263 outStr <<
"x_l !!!!!!!!!!!!!!!!!!!!!!!!!!!" << x_l[i] << endl;
264 outStr <<
"x_u !!!!!!!!!!!!!!!!!!!!!!!!!!!" << x_u[i] << endl;
278 for(
int i = 0; i <
m; i++)
280 g_l[ i] = mdConLB[ i];
281 g_u[ i] = mdConUB[ i];
285 outStr <<
"lower !!!!!!!!!!!!!!!!!!!!!!!!!!!" << g_l[i] << endl;
286 outStr <<
"upper !!!!!!!!!!!!!!!!!!!!!!!!!!!" << g_u[i] << endl;
296 bool init_z, Number* z_L, Number* z_U, Index
m,
bool init_lambda,
299 std::ostringstream outStr;
303 assert(init_x ==
true);
304 assert(init_z ==
false);
305 assert(init_lambda ==
false);
311 "get initial values !!!!!!!!!!!!!!!!!!!!!!!!!!\n");
317 "get number of initial values !!!!!!!!!!!!!!!!!!!!!!!!!!\n");
327 outStr <<
"number of variables initialed: " << m1 << endl;
333 initialed =
new bool[n1];
337 outStr <<
"number of variables in total: " << n1 << endl;
342 for(k = 0; k < n1; k++)
343 initialed[k] =
false;
359 for(k = 0; k <
m1; k++)
361 i = initVarVector[
k]->
idx;
362 if (initVarVector[k]->idx > n1)
363 throw ErrorClass (
"Illegal index value in variable initialization");
365 initval = initVarVector[
k]->
value;
369 throw ErrorClass (
"Initial value outside of bounds");
374 throw ErrorClass (
"Initial value outside of bounds");
380 throw ErrorClass (
"Initial value outside of bounds");
383 x[initVarVector[
k]->
idx] = initval;
384 initialed[initVarVector[
k]->idx] =
true;
390 "Error in BonminProblem::get_starting_point (OSBonminSolver.cpp)\n\n\n");
394 double default_initval;
395 default_initval = 1.7171;
398 for(k = 0; k < n1; k++)
404 x[
k] = default_initval;
409 x[
k] = default_initval;
414 x[
k] = default_initval;
425 for(i = 0; i < n1; i++)
427 outStr <<
"INITIAL VALUE !!!!!!!!!!!!!!!!!!!! " << x[ i] << std::endl;
461 if( CoinIsnan( (
double)obj_value) )
return false;
468 double *objGrad = NULL;
482 for(i = 0; i <
n; i++)
486 grad_f[ i] = objGrad[ i];
490 grad_f[ i] = -objGrad[ i];
504 for(i = 0; i <
m; i++)
506 if( CoinIsnan( (
double)conVals[ i] ) )
return false;
521 Index
m, Index nele_jac, Index* iRow, Index *jCol,
539 for(idx = 0; idx <
m; idx++)
541 for(k = *(sparseJacobian->
starts + idx); k < *(sparseJacobian->
starts + idx + 1); k++)
544 jCol[i] = *(sparseJacobian->
indexes +
k);
561 for(
int i = 0; i < nele_jac; i++)
563 values[ i] = sparseJacobian->
values[i];
572 Number obj_factor, Index
m,
const Number* lambda,
573 bool new_lambda, Index nele_hess, Index* iRow,
574 Index* jCol, Number*
values)
592 for(i = 0; i < nele_hess; i++)
601 double* objMultipliers =
new double[1];
602 objMultipliers[0] = obj_factor;
606 delete[] objMultipliers;
611 delete[] objMultipliers;
614 for(i = 0; i < nele_hess; i++)
616 values[ i] = *(sparseHessian->
hessValues + i);
624 bool& use_x_scaling, Index
n,
626 bool& use_g_scaling, Index
m,
645 Index
n,
const Number*
x, Number obj_value)
647 std::ostringstream outStr;
653 outStr <<
"FINALIZE OBJ SOLUTION VALUE = " << obj_value << std::endl;
664 if(osil.length() == 0 &&
osinstance == NULL)
throw ErrorClass(
"there is no instance");
673 throw ErrorClass(
"Solver cannot handle multiple objectives --- please delete all but one");
677 this->bCallbuildSolverInstance =
true;
681 catch(
const ErrorClass& eclass)
686 osrl = osrlwriter->writeOSrL(
osresult);
687 throw ErrorClass( osrl) ;
695 std::ostringstream outStr;
698 this->bSetSolverOptions =
true;
699 bonminSetup.initializeOptionsAndJournalist();
701 bonminSetup.roptions()->AddStringOption2(
"print_solution",
"Do we print the solution or not?",
703 "no",
"No, we don't.",
704 "yes",
"Yes, we do.",
705 "A longer comment can be put here");
708 bonminSetup.options()->SetNumericValue(
"bonmin.time_limit", 5000);
726 bonminSetup.readOptionsString(
"bonmin.algorithm B-BB\n");
729 bonminSetup.options()->SetIntegerValue(
"bonmin.bb_log_level", 0 );
730 bonminSetup.options()->SetIntegerValue(
"bonmin.nlp_log_level", 0 );
734 bonminSetup.options()->GetEnumValue(
"print_solution", printSolution,
"");
735 if(printSolution == 1)
737 tminlp->printSolutionAtEndOfAlgorithm();
740 if(
osoption == NULL && osol.length() > 0)
743 osoption = m_osolreader->readOSoL( osol);
750 std::vector<SolverOption*> optionsVector;
752 int num_bonmin_options = optionsVector.size();
753 for(i = 0; i < num_bonmin_options; i++)
755 if(optionsVector[ i]->type ==
"numeric" )
759 outStr <<
"FOUND A NUMERIC OPTION "
763 if(optionsVector[ i]->category ==
"ipopt")
765 bonminSetup.options()->SetNumericValue(optionsVector[ i]->
name,
os_strtod( optionsVector[ i]->
value.c_str(), &pEnd ) );
769 if(optionsVector[ i]->category ==
"cbc" )
771 bonminSetup.options()->SetNumericValue(
"milp_solver."+optionsVector[ i]->
name,
os_strtod( optionsVector[ i]->
value.c_str(), &pEnd ) );
775 bonminSetup.options()->SetNumericValue(
"bonmin."+optionsVector[ i]->
name,
os_strtod( optionsVector[ i]->
value.c_str(), &pEnd ) );
779 else if(optionsVector[ i]->type ==
"integer" )
783 outStr <<
"FOUND AN INTEGER OPTION " << optionsVector[ i]->name << std::endl;
785 if(optionsVector[ i]->category ==
"ipopt")
787 bonminSetup.options()->SetIntegerValue(optionsVector[ i]->
name, atoi( optionsVector[ i]->
value.c_str() ) );
791 if(optionsVector[ i]->category ==
"cbc" )
794 "SETTING INTEGER CBC OPTION\n");
795 bonminSetup.options()->SetIntegerValue(
"milp_solver."+optionsVector[ i]->
name, atoi( optionsVector[ i]->
value.c_str() ));
799 bonminSetup.options()->SetIntegerValue(
"bonmin."+optionsVector[ i]->
name, atoi( optionsVector[ i]->
value.c_str() ) );
803 else if(optionsVector[ i]->type ==
"string" )
807 outStr <<
"FOUND A STRING OPTION " << optionsVector[ i]->name << std::endl;
809 if(optionsVector[ i]->category ==
"ipopt")
811 bonminSetup.options()->SetStringValue(optionsVector[ i]->
name, optionsVector[ i]->
value );
815 if(optionsVector[ i]->category ==
"cbc" )
817 bonminSetup.options()->SetStringValue(
"milp_solver."+optionsVector[ i]->
name, optionsVector[ i]->
value);
821 bonminSetup.options()->SetStringValue(
"bonmin."+optionsVector[ i]->
name, optionsVector[ i]->
value);
829 catch(
const ErrorClass& eclass)
834 osrl = osrlwriter->writeOSrL(
osresult);
835 throw ErrorClass( osrl) ;
843 if( this->bCallbuildSolverInstance ==
false) buildSolverInstance();
844 if( this->bSetSolverOptions ==
false) setSolverOptions();
849 bonminSetup.initialize(
GetRawPtr(tminlp) );
858 osrl = osrlwriter->writeOSrL(
osresult);
859 throw ErrorClass( osrl) ;
863 ostringstream outStr;
864 outStr << E.className() <<
"::"<< E.methodName() << std::endl << E.message() << std::endl;
868 osrl = osrlwriter->writeOSrL(
osresult);
869 throw ErrorClass( osrl) ;
873 ostringstream outStr;
874 outStr << E.className() <<
"::"<< E.methodName() << std::endl << E.message() << std::endl;
878 osrl = osrlwriter->writeOSrL(
osresult);
879 throw ErrorClass( osrl);
884 std::string solutionDescription =
"";
885 std::string message =
"Success";
889 throw ErrorClass(
"OSResult error: setServiceName");
891 throw ErrorClass(
"OSResult error: setInstanceName");
893 throw ErrorClass(
"OSResult error: setVariableNumber");
895 throw ErrorClass(
"OSResult error: setObjectiveNumber");
897 throw ErrorClass(
"OSResult error: setConstraintNumber");
899 throw ErrorClass(
"OSResult error: setSolutionNumer");
901 throw ErrorClass(
"OSResult error: setGeneralMessage");
902 solutionDescription =
"The problem is unbounded";
906 osrl = osrlwriter->writeOSrL(
osresult);
911 if(( bb.model().isProvenInfeasible() ==
true) )
913 std::string solutionDescription =
"";
914 std::string message =
"Success";
919 throw ErrorClass(
"OSResult error: setServiceName");
921 throw ErrorClass(
"OSResult error: setInstanceName");
923 throw ErrorClass(
"OSResult error: setVariableNumer");
925 throw ErrorClass(
"OSResult error: setObjectiveNumber");
927 throw ErrorClass(
"OSResult error: setConstraintNumber");
929 throw ErrorClass(
"OSResult error: setSolutionNumber");
931 throw ErrorClass(
"OSResult error: setGeneralMessage");
932 solutionDescription =
"The problem is infeasible";
937 osrl = osrlwriter->writeOSrL(
osresult);
940 status = tminlp->status;
944 catch(
const ErrorClass& eclass)
948 osrl = osrlwriter->writeOSrL(
osresult);
949 throw ErrorClass( osrl) ;
960 std::string solutionDescription =
"";
961 std::string message =
"Bonmin solver finishes to the end.";
971 throw ErrorClass(
"OSResult error: setServiceName");
973 throw ErrorClass(
"OSResult error: setSolverInvoked");
975 throw ErrorClass(
"OSResult error: setInstanceName");
981 throw ErrorClass(
"OSResult error: setVariableNumer");
983 throw ErrorClass(
"OSResult error: setObjectiveNumber");
985 throw ErrorClass(
"OSResult error: setConstraintNumber");
987 throw ErrorClass(
"OSResult error: setSolutionNumer");
989 throw ErrorClass(
"OSResult error: setGeneralMessage");
994 solutionDescription =
"SUCCESS[BONMIN]: Algorithm terminated normally at a locally optimal point, satisfying the convergence tolerances.";
1006 *(x + i) = bb.bestSolution()[i];
1013 solutionDescription =
"LIMIT_EXCEEDED[BONMIN]: A resource limit was exceeded, we provide the current solution.";
1027 *(x + i) = bb.bestSolution()[i];
1034 solutionDescription =
"MINLP_ERROR [BONMIN]: Algorithm stopped with unspecified error.";
1040 solutionDescription =
"CONTINUOUS_UNBOUNDED [BONMIN]: The continuous relaxation is unbounded, the MINLP may or may not be unbounded.";
1047 solutionDescription =
"INFEASIBLE [BONMIN]: Problem may be infeasible.";
1053 solutionDescription =
"OTHER[BONMIN]: other unknown solution status from Bonmin solver";
1057 osrl = osrlwriter->writeOSrL(
osresult);
1073 osrl = osrlwriter->writeOSrL(
osresult);
1081 std::ostringstream outStr;
1108 else outStr <<
"problem is a maximization" << endl;
double * getConstraintLowerBounds()
Get constraint lower bounds.
double * getVariableLowerBounds()
Get variable lower bounds.
double * getConstraintUpperBounds()
Get constraint upper bounds.
std::string OSgetVersionInfo()
double os_strtod(const char *s00, char **se)
int getNumberOfInitVarValues()
Get the number of initial variable values.
int getNumberOfIntegerVariables()
getNumberOfIntegerVariables
char * getVariableTypes()
Get variable initial values.
std::string value
value holds the text of the value attribute of the OtherVariableResult element
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...
SparseHessianMatrix * calculateLagrangianHessian(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the Hessian of the Lagrangian Expression Tree This method will build the CppAD expression t...
const OSSmartPtr< OSOutput > osoutput
virtual void setSolverOptions()
The implementation of the virtual functions.
double * values
values holds a double array of nonzero partial derivatives
bool bUseExpTreeForFunEval
bUseExpTreeForFunEval is set to true if you wish to use the OS Expression Tree for function evaluatio...
BonminSolver()
the BonminSolver class constructor
int getVariableNumber()
Get number of variables.
void dataEchoCheck()
use this for debugging, print out the instance that the solver thinks it has and compare this with th...
bool setServiceName(std::string serviceName)
Set service name.
bool setVariableNumber(int variableNumber)
Set the variable number.
virtual bool eval_grad_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
Method to return the gradient of the objective.
std::string errormsg
errormsg is the error that is causing the exception to be thrown
int getLinearConstraintCoefficientNumber()
Get number of specified (usually nonzero) linear constraint coefficient values.
virtual void buildSolverInstance()
buildSolverInstance is a virtual function – the actual solvers will implement their own buildSolverIn...
int * getNonlinearExpressionTreeModIndexes()
Get all the nonlinear expression tree indexes, i.e., indexes of rows (objectives or constraints) that...
std::string maxOrMin
declare the objective function to be a max or a min
std::vector< SolverOption * > getSolverOptions(std::string solver_name)
Get the options associated with a given solver.
virtual bool eval_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
Method to return the objective value.
bool setSolverInvoked(std::string solverInvoked)
Set solver invoked.
SparseJacobianMatrix * calculateAllConstraintFunctionGradients(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the gradient of all constraint functions.
std::string name
name holds the text of the name attribute of the OtherVariableResult element
void writeResult()
use this to write the solution information to an OSResult object
Take an OSResult object and write a string that validates against OSrL.
int getNumberOfNonlinearExpressionTreeModIndexes()
Get the number of unique nonlinear expression tree indexes after modifying the expression tree to con...
int * hessColIdx
hessColIdx is an integer array of column indices in the range 0, ..., n - 1.
int getObjectiveNumber()
Get number of objectives.
bool setObjectiveNumber(int objectiveNumber)
Set the objective number.
bool setInstanceName(std::string instanceName)
Set instance name.
virtual bool get_variables_types(Ipopt::Index n, VariableType *var_types)
Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer.
bool setSolutionMessage(int solIdx, std::string msg)
Set the [i]th optimization solution's message, where i equals the given solution index.
std::map< int, int > getAllNonlinearVariablesIndexMap()
std::string * getVariableNames()
Get variable names.
int * hessRowIdx
hessRowIdx is an integer array of row indices in the range 0, ..., n - 1.
int getNumberOfNonlinearExpressions()
Get number of nonlinear expressions.
int numberOfObjectives
numberOfObjectives is the number of objective functions in the instance
virtual bool get_constraints_linearity(Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types)
Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer.
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.
SparseJacobianMatrix * getJacobianSparsityPattern()
Error class to throw exceptions from OsiTMINLPInterface.
virtual bool get_bounds_info(Ipopt::Index n, Ipopt::Number *x_l, Ipopt::Number *x_u, Ipopt::Index m, Ipopt::Number *g_l, Ipopt::Number *g_u)
Bonmin specific methods for defining the nlp problem.
virtual void solve()
solve results in an instance being read into the Bonmin data structrues and optimized ...
virtual void finalize_solution(Bonmin::TMINLP::SolverReturn status_, Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number obj_value)
Method called by Ipopt at the end of optimization.
int valueSize
valueSize is the dimension of the values array
Used to read an OSiL string.
int * indexes
indexes holds an integer array of variable indices.
double * calculateAllConstraintFunctionValues(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate all of the constraint function values.
SolverReturn
Return statuses of algorithm.
double lb
lb corresponds to the optional attribute that holds the variable lower bound.
Variable ** var
Here we define a pointer to an array of var pointers.
int hessDimension
hessDimension is the number of nonzeros in each array.
int * varOneIndexes
varOneIndexes holds an integer array of the first variable indexes of all the quadratic terms...
double value
initial value
virtual bool get_nlp_info(Ipopt::Index &n, Ipopt::Index &m, Ipopt::Index &nnz_jac_g, Ipopt::Index &nnz_h_lag, Ipopt::TNLP::IndexStyleEnum &index_style)
Method to pass the main dimensions of the problem to Ipopt.
SparseHessianMatrix * getLagrangianHessianSparsityPattern()
std::string * getObjectiveMaxOrMins()
Get objective maxOrMins.
BonminProblem(OSInstance *osinstance_, OSOption *osoption_)
the BonminProblemclass constructor
double ub
ub corresponds to the optional attribute that holds the variable upper bound.
double * hessValues
hessValues is a double array of the Hessian values.
virtual bool get_starting_point(Ipopt::Index n, bool init_x, Ipopt::Number *x, bool init_z, Ipopt::Number *z_L, Ipopt::Number *z_U, Ipopt::Index m, bool init_lambda, Ipopt::Number *lambda)
Method to return the starting point for the algorithm.
Variables * variables
variables is a pointer to a Variables object
virtual bool eval_h(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number obj_factor, Ipopt::Index m, const Ipopt::Number *lambda, bool new_lambda, Ipopt::Index nele_hess, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
Method to return: 1) The structure of the hessian of the lagrangian (if "values" is NULL) 2) The valu...
SparseMatrix * getLinearConstraintCoefficientsInColumnMajor()
Get linear constraint coefficients in column major.
bool setGeneralMessage(std::string message)
Set the general message.
virtual bool get_variables_linearity(Ipopt::Index n, Ipopt::TNLP::LinearityType *var_types)
Pass info about linear and nonlinear variables.
double * values
values holds a double array of value elements in coefMatrix (AMatrix), which contains nonzero element...
bool setGeneralStatusType(std::string type)
Set the general status type, which can be: success, error, warning.
U * GetRawPtr(const OSSmartPtr< U > &smart_ptr)
a sparse Jacobian matrix data structure
std::string getInstanceName()
Get instance name.
InstanceData * instanceData
A pointer to an InstanceData object.
virtual bool eval_jac_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
Method to return: 1) The structure of the jacobian (if "values" is NULL) 2) The values of the jacobia...
int * starts
starts holds an integer array of start elements, each start element points to the start of partials f...
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.
int getNumberOfSolverOptions()
Get the number of solver options.
int getNumberOfQuadraticTerms()
Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.
Used to read an OSoL string.
Objectives * objectives
objectives is a pointer to a Objectives object
std::string getInstanceSource()
Get instance source.
InitVarValue ** getInitVarValuesSparse()
Get the initial values associated with the variables in sparse form.
bool initForAlgDiff()
This should be called by nonlinear solvers using callback functions.
virtual bool eval_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
Method to return the constraint residuals.
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...
double * calculateAllObjectiveFunctionValues(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate all of the objective function values.
virtual bool get_scaling_parameters(Ipopt::Number &obj_scaling, bool &use_x_scaling, Ipopt::Index n, Ipopt::Number *x_scaling, bool &use_g_scaling, Ipopt::Index m, Ipopt::Number *g_scaling)
overload this method to return scaling parameters.
QuadraticTerms * getQuadraticTerms()
Get all the quadratic terms in the instance.
We will throw this error when a problem is not solved.
virtual ~BonminProblem()
the BonminProblem class destructor
double * getVariableUpperBounds()
Get variable upper bounds.
void fint fint fint real fint real real real real real real * g
bool setObjectiveValuesDense(int solIdx, double *objectiveValues)
Set the [i]th optimization solution's objective values, where i equals the given solution index...
~BonminSolver()
the IpoptSolver class destructor
The in-memory representation of an OSiL instance..
double * coefficients
coefficients holds a double array all the quadratic term coefficients.
int * varTwoIndexes
varTwoIndexes holds an integer array of the second variable indexes of all the quadratic terms...
The in-memory representation of a SparseHessianMatrix..
std::string * getConstraintNames()
Get constraint names.
used for throwing exceptions.
VariableType
Type of the variables.
int getNumberOfBinaryVariables()
getNumberOfBinaryVariables
std::string getInstanceDescription()
Get instance description.
double * calculateObjectiveFunctionGradient(double *x, double *objLambda, double *conLambda, int objIdx, bool new_x, int highestOrder)
Calculate the gradient of the objective function indexed by objIdx.
void fint fint fint real fint real * x