32 #include "CoinHelperFunctions.hpp"
51 #define R_OPS ((ASL_fg*)asl)->I.r_ops_
52 #define OBJ_DE ((ASL_fg*)asl)->I.obj_de_
53 #define VAR_E ((ASL_fg*)asl)->I.var_e_
54 #define CON_DE ((ASL_fg*)asl)->I.con_de_
74 cw = ASL_alloc( ASL_read_fg);
75 rw = ASL_alloc( ASL_read_fg);
91 else if (name ==
"cw")
93 else if (name ==
"rw")
111 std::ostringstream outStr;
115 efunc *r_ops_int[N_OPS];
123 nl = jac0dim(const_cast<char*>(stub.c_str()), (
fint)stub.length());
126 A_vals = (
real *)Malloc(nzc*
sizeof(
real));
132 X0 =
new real[n_var];
133 havex0 =
new char[n_var];
134 pi0 =
new real[n_con];
135 havepi0 =
new char[n_con];
140 outStr <<
"number of nonzeros = " << nzc << endl;
141 outStr <<
"number of variables = " << n_var << endl;
142 outStr <<
"number of constraints = " << n_con << endl;
143 outStr <<
"number of objectives = " << n_obj << endl;
144 outStr <<
"number of ranges = " << nranges << endl;
145 outStr <<
"number of equations = " << n_eqn << endl;
150 for(
int i = 0; i < N_OPS; i++)
152 r_ops_int[i] = (efunc*)(
unsigned long)i;
156 fg_read(nl, ASL_keep_all_suffixes);
163 nl = jac0dim((
char*)stub.c_str(), (
fint)stub.length());
195 if (X0)
delete [] X0; X0 = NULL;
196 if (havex0)
delete [] havex0; havex0 = NULL;
197 if (pi0)
delete [] pi0; pi0 = NULL;
198 if (havepi0)
delete [] havepi0; havepi0 = NULL;
199 if (
cw != NULL) ASL_free(&
cw);
200 if (
rw != NULL) ASL_free(&
rw);
234 for (ep = e->L.ep; ep < e->R.ep; *ep++)
243 for (ep = e->L.ep; ep < e->R.ep; *ep++)
288 nlNodeNumberPoint->
value = e->R.en->v;
293 operand.push_back( e->R.en->v );
311 nlNodeNumberPoint->
value = e->L.en->v;
349 nlNodeNumberPoint->
value = (double) ((expr_n*)
e)->v;
353 operand.push_back( (
double) ((expr_n*)e)->v );
357 return nlNodeNumberPoint;
367 struct cexp *common = ((
const ASL_fg *)
asl) -> I.cexps_ +
j ;
371 int nlin = common -> nlin;
380 linpart *
L = common ->
L;
381 for(
int kj = 0; kj < nlin; kj++)
386 nlNodeVariablePoint->
coef = L [kj]. fac;
387 nlNodeVariablePoint->
idx = ((uintptr_t) (L [kj].v.rp) - (uintptr_t)
VAR_E) /
sizeof (expr_v);
396 struct cexp1 *common = ((
const ASL_fg *)
asl) -> I.cexps1_ + (j - ncom0);
400 int nlin = common -> nlin;
409 linpart *
L = common ->
L;
410 for(
int kj = 0; kj < nlin; kj++)
415 nlNodeVariablePoint->
coef = L [kj]. fac;
416 nlNodeVariablePoint->
idx = ((uintptr_t) (L [kj].v.rp) - (uintptr_t)
VAR_E) /
sizeof (expr_v);
426 nlNodeVariablePoint->
idx = e->a;
427 nlNodeVariablePoint->
coef = 1.0;
429 op_type.push_back(
"VARIABLE");
433 return nlNodeVariablePoint;
436 std::ostringstream outStr;
440 error =
"ERROR: An unsupported operator found, AMPL operator number = " ;
444 error = outStr.str();
463 std::ostringstream outStr;
468 outStr <<
"LOWER = " << lower << std::endl;
469 outStr <<
"UPPER = " << upper << std::endl;
472 for(i = lower; i < upper; i++)
483 std::ostringstream outStr;
488 outStr <<
"LOWER = " << lower << std::endl;
489 outStr <<
"UPPER = " << upper << std::endl;
492 for(i = lower; i < upper; i++)
494 if (LUv[2*i] > -1.0 +
OS_EPS && LUv[2*i+1] < 2.0 -
OS_EPS)
506 int *A_rowstarts = NULL;
507 int *A_colptr = NULL;
508 double *A_nzelem = NULL;
510 std::ostringstream outStr;
547 std::vector<int> fidxs, v1idxs, v2idxs;
548 std::vector<double> coeffs;
549 std::vector<Nl> nlExprs;
558 bool fill_in =
false;
560 if (nlvc > 0 || nlvo > 0)
568 for (osNLIdx = -nlo, aNLIdx = nlo-1; osNLIdx < 0; osNLIdx++, aNLIdx--)
570 if (nqpcheck(aNLIdx, &rowqp, &colqp, &delsqp) > 0)
572 for (
int v1 = 0; v1 < n_var; v1++)
574 for (
int* psV2 = (
int*)&rowqp[colqp[v1]]; psV2 < (
int*)&rowqp[colqp[v1+1]]; psV2++, delsqp++)
576 if (std::abs(*delsqp) >
OS_EPS)
578 fidxs.push_back(osNLIdx);
579 v1idxs.push_back(v1);
580 v2idxs.push_back(*psV2);
581 coeffs.push_back(0.5 * *delsqp);
598 nlExprs.push_back(nl);
605 double* A_row_temp =
new double[n_var];
607 for (osNLIdx = 0, aNLIdx = -1; osNLIdx < nlc; osNLIdx++, aNLIdx--)
614 for(cg = Cgrad[osNLIdx]; cg; cg = cg->next)
616 if (cg->coef != 0) A_row_temp[cg->varno] = cg->coef;
620 nqpchk = nqpcheck(aNLIdx, &rowqp, &colqp, &delsqp);
623 for (
int v1 = 0; v1 < n_var; v1++)
625 for (
int* psV2 = (
int*)&rowqp[colqp[v1]]; psV2 < (
int*)&rowqp[colqp[v1+1]]; psV2++, delsqp++)
627 if (std::abs(*delsqp) >
OS_EPS)
629 fidxs.push_back(osNLIdx);
630 v1idxs.push_back(v1);
631 v2idxs.push_back(*psV2);
632 coeffs.push_back(0.5 * *delsqp);
638 for(cg = Cgrad[osNLIdx]; cg; cg = cg->next)
641 if (cg->coef != A_row_temp[cg->varno])
650 if (nqpchk < 0) isQP =
false;
665 nlExprs.push_back(nl);
668 delete [] A_row_temp;
672 Nl** ppsNl =
new Nl*[ nlExprs.size() ];
673 for (i = 0; i < nlExprs.size(); i++)
675 ppsNl[i] =
new Nl(nlExprs[i]);
697 double objWeight = 1.0;
702 for(i = 0; i < n_obj; i++)
705 for(
og = Ograd[i];
og;
og =
og->next)
707 if (
og->coef != 0) n_obj_coef++;
711 for(
og = Ograd[i];
og;
og =
og->next)
716 objectiveCoefficients->
values[i_obj_coef] =
og->coef;
717 objectiveCoefficients->
indexes[i_obj_coef] =
og->varno;
721 (objtype[i] == 1)?
"max":
"min",
722 objconst( i), objWeight, objectiveCoefficients) ;
723 delete objectiveCoefficients;
724 objectiveCoefficients = NULL;
732 double constant = 0.0;
734 for(i = 0; i < n_con; i++)
749 A_rowstarts =
new int[n_con+1];
751 for (
int i=0; i < n_con; i++)
754 for(cg = Cgrad[i]; cg; cg = cg->next)
756 if (cg->coef != 0) row_len++;
758 A_rowstarts[i+1] = A_rowstarts[i] + row_len;
760 A_colptr =
new int[A_rowstarts[n_con]];
761 A_nzelem =
new double[A_rowstarts[n_con]];
762 for (
int i=0; i < n_con; i++)
765 for(cg = Cgrad[i]; cg; cg = cg->next)
769 A_colptr[A_rowstarts[i]+row_len] = cg->varno;
770 A_nzelem[A_rowstarts[i]+row_len] = cg->coef;
776 if(A_rowstarts[ n_con] > 0)
779 A_nzelem, 0, A_rowstarts[n_con] - 1,
780 A_colptr, 0, A_rowstarts[n_con] - 1,
781 A_rowstarts, 0, n_con);
793 outStr <<
"A-matrix elements: ";
794 for (
int i = 0; i < A_rowstarts[ n_con]; i++)
795 outStr << A_nzelem[i] <<
" ";
797 outStr <<
"A-matrix col index: ";
798 for (
int i = 0; i < A_rowstarts[ n_con]; i++)
799 outStr << A_colptr[i] <<
" ";
801 outStr <<
"A-matrix rowstart: ";
802 for (
int i = 0; i <= n_con; i++)
803 outStr << A_rowstarts[i] <<
" ";
812 int colStart, colEnd, nCoefSqueezed;
818 outStr <<
"A-matrix elements: ";
819 for (
int i = 0; i < A_colstarts[ n_var]; i++)
820 outStr << A_vals[i] <<
" ";
822 outStr <<
"A-matrix rowinfo: ";
823 for (
int i = 0; i < A_colstarts[ n_var]; i++)
824 outStr << A_rownos[i] <<
" ";
826 outStr <<
"A-matrix colstart: ";
827 for (
int i = 0; i <= n_var; i++)
828 outStr << A_colstarts[i] <<
" ";
834 for (i = 0; i < n_var; i++)
837 colEnd = A_colstarts[i+1];
841 outStr <<
"col " << i <<
" from " << colStart <<
" to " << colEnd - 1 << endl;
844 for (j = colStart; j < colEnd; j++)
846 if (fabs(A_vals[ j]) >
OS_EPS)
848 A_vals[ j-nCoefSqueezed] = A_vals[
j];
849 A_rownos[ j-nCoefSqueezed] = A_rownos[
j];
856 outStr <<
"squeeze out element " << j << endl;
862 A_colstarts[i+1] = A_colstarts[i+1] - nCoefSqueezed;
868 outStr <<
"A-matrix elements: ";
869 for (i = 0; i < A_colstarts[ n_var]; i++)
870 outStr << A_vals[i] <<
" ";
872 outStr <<
"A-matrix rowinfo: ";
873 for (i = 0; i < A_colstarts[ n_var]; i++)
874 outStr << A_rownos[i] <<
" ";
876 outStr <<
"A-matrix colstart: ";
877 for (i = 0; i <= n_var; i++)
878 outStr << A_colstarts[i] <<
" ";
880 outStr <<
"A-matrix nonzeroes: " << A_colstarts[ n_var] <<
"; nsqueezed: " << nCoefSqueezed << endl;
884 if(A_colstarts[ n_var] > 0)
887 A_vals, 0, A_colstarts[n_var] - 1,
888 A_rownos, 0, A_colstarts[n_var] - 1,
889 A_colstarts, 0, n_var);
909 int suffixType, nOther, nOtherIdx;
918 bool have_primal =
false;
919 for (i=0; i < n_var; i++)
928 bool have_dual =
false;
929 for (i=0; i < n_con; i++)
940 if ((
asl->i.suffixes[ASL_Sufkind_var] != NULL) ||
941 (
asl->i.suffixes[ASL_Sufkind_con] != NULL) ||
942 (
asl->i.suffixes[ASL_Sufkind_obj] != NULL) ||
943 (
asl->i.suffixes[ASL_Sufkind_prob] != NULL) ||
944 ( have_primal ) || ( have_dual ) )
967 std::string *otherOptionNames = NULL;
970 suffixType = ASL_Sufkind_var;
971 if ( (
asl->i.suffixes[suffixType] != NULL) )
986 for (d=
asl->i.suffixes[suffixType]; d; d=d->next)
991 outStr <<
"Detected suffix " << d->sufname <<
"; kind = " << d->kind << std::endl;
996 if (strcmp(d->sufname,
"sstatus") == 0)
1022 outStr <<
"Original basis (in AMPL codes):";
1023 for (
int k=0;
k<n_var;
k++)
1024 outStr <<
" " << d->u.i[
k];
1025 outStr << std::endl;
1041 IBS =
new int[nIndexes];
1044 for (
int k=0;
k < nIndexes;
k++)
1051 outStr <<
"After processing state " << i <<
":";
1052 for (
int k=0;
k<n_var;
k++)
1053 outStr <<
" " << d->u.i[
k];
1054 outStr << std::endl;
1062 outStr <<
"Merged basis (in AMPL codes):";
1063 for (
int k=0;
k<n_var;
k++)
1064 outStr <<
" " << d->u.i[
k];
1065 outStr << std::endl;
1078 for (
int k=0;
k < n_var;
k++)
1083 IBS2 =
new int*[ENUM_BASIS_STATUS_NUMBER_OF_STATES];
1086 IBS2[i] =
new int[nidx[i]];
1090 for (
int k=0;
k < n_var;
k++)
1092 IBS2[d->u.i[
k]][kidx[d->u.i[
k]]++] =
k;
1111 varopt->
name = d->sufname;
1118 for (iopt=0; iopt < nOther; iopt++)
1120 if (d->sufname == otherOptionNames[iopt])
1142 varopt->
description =
"combined from osol and .nl data";
1147 varopt->
description =
"transferred from .nl file";
1154 for (
int k=0;
k < n_var;
k++)
1159 varopt->
var[nOtherIdx]->
idx =
k;
1169 for (
int k=0;
k < n_var;
k++)
1174 varopt->
var[nOtherIdx]->
idx =
k;
1197 throw ErrorClass(
"OSnl2OS: Error transfering suffixes on variables" );
1204 delete [] otherOptionNames;
1205 otherOptionNames = NULL;
1209 suffixType = ASL_Sufkind_con;
1210 if ( (
asl->i.suffixes[suffixType] != NULL) )
1225 for (d=
asl->i.suffixes[suffixType]; d; d=d->next)
1230 outStr <<
"Detected suffix " << d->sufname <<
"; kind = " << d->kind << std::endl;
1234 if (strcmp(d->sufname,
"sstatus") == 0)
1261 outStr <<
"Original basis (in AMPL codes):";
1262 for (
int k=0;
k<n_con;
k++)
1263 outStr <<
" " << d->u.i[
k];
1264 outStr << std::endl;
1280 IBS =
new int[nIndexes];
1283 for (
int k=0;
k < nIndexes;
k++)
1290 outStr <<
"After processing state " << i <<
":";
1291 for (
int k=0;
k<n_con;
k++)
1292 outStr <<
" " << d->u.i[
k];
1293 outStr << std::endl;
1301 outStr <<
"Merged basis (in AMPL codes):";
1302 for (
int k=0;
k<n_con;
k++)
1303 outStr <<
" " << d->u.i[
k];
1304 outStr << std::endl;
1317 for (
int k=0;
k < n_con;
k++)
1322 IBS2 =
new int*[ENUM_BASIS_STATUS_NUMBER_OF_STATES];
1325 IBS2[i] =
new int[nidx[i]];
1329 for (
int k=0;
k < n_con;
k++)
1331 IBS2[d->u.i[
k]][kidx[d->u.i[
k]]++] =
k;
1350 conopt->
name = d->sufname;
1357 for (iopt=0; iopt < nOther; iopt++)
1359 if (d->sufname == otherOptionNames[iopt])
1381 conopt->
description =
"combined from osol and .nl data";
1386 conopt->
description =
"transferred from .nl file";
1393 for (
int k=0;
k < n_con;
k++)
1398 conopt->
con[nOtherIdx]->
idx =
k;
1408 for (
int k=0;
k < n_con;
k++)
1413 conopt->
con[nOtherIdx]->
idx =
k;
1436 throw ErrorClass(
"OSnl2OS: Error transfering suffixes on constraints" );
1443 delete [] otherOptionNames;
1444 otherOptionNames = NULL;
1448 suffixType = ASL_Sufkind_obj;
1449 if ( (
asl->i.suffixes[suffixType] != NULL) )
1464 for (d=
asl->i.suffixes[suffixType]; d; d=d->next)
1469 outStr <<
"Detected suffix " << d->sufname <<
"; kind = " << d->kind << std::endl;
1476 objopt->
name = d->sufname;
1483 for (iopt=0; iopt < nOther; iopt++)
1485 if (d->sufname == otherOptionNames[iopt])
1507 d->u.i[-1 - otherOption->
obj[i]->
idx] = atoi(otherOption->
obj[i]->
value.c_str());
1510 objopt->
description =
"combined from osol and .nl data";
1515 objopt->
description =
"transferred from .nl file";
1522 for (
int k=0;
k < n_obj;
k++)
1527 objopt->
obj[nOtherIdx]->
idx = -1 -
k;
1537 for (
int k=0;
k < n_obj;
k++)
1542 objopt->
obj[nOtherIdx]->
idx = -1 -
k;
1565 throw ErrorClass(
"OSnl2OS: Error transfering suffixes on objectives" );
1571 delete [] otherOptionNames;
1572 otherOptionNames = NULL;
1577 suffixType = ASL_Sufkind_prob;
1578 if ( (
asl->i.suffixes[suffixType] != NULL) )
1580 std::string opttype, optvalue, optdesc;
1581 optdesc =
"transferred from .nl file";
1582 for (d=
asl->i.suffixes[suffixType]; d; d=d->next)
1587 outStr <<
"Detected suffix " << d->sufname <<
"; kind = " << d->kind << std::endl;
1598 opttype =
"integer";
1603 throw ErrorClass(
"OSnl2OS: Error transfering problem-indexed suffixes" );
1617 for (
int i=0; i < n_prev; i++)
1623 for (
int i=0; i < n_var; i++)
1624 if (havex0[i] != 0) n_x0++;
1633 for (
int i=0; i < n_var; i++)
1638 x_init[n_x0]->
idx = i;
1639 x_init[n_x0]->
value = X0[i];
1646 throw ErrorClass(
"OSnl2OS: Error merging initial primal variable values" );
1648 for (
int i=0; i < n_x0; i++)
1665 for (
int i=0; i < n_prev; i++)
1671 for (
int i=0; i < n_con; i++)
1672 if (havepi0[i] != 0) n_pi0++;
1681 for (
int i=0; i < n_con; i++)
1683 if (havepi0[i] != 0)
1686 pi_init[n_pi0]->
idx = i;
1695 throw ErrorClass(
"OSnl2OS: Error merging initial dual variable values" );
1697 for (
int i=0; i < n_pi0; i++)
double coef
coef is an option coefficient on the variable, the default value is 1.0
bool setQuadraticCoefficients(int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients, int begin, int end)
set quadratic coefficients into the QuadraticCoefficients->qTerm data structure
double os_strtod(const char *s00, char **se)
the OtherConstraintOption class.
bool setInitBasisStatus(int object, int status, int *i, int ni)
bool addVariable(int index, std::string name, double lowerBound, double upperBound, char type)
add a variable.
ASL * cw
Pointers to AMPL data structures.
double ubDualValue
initial upper bound
const OSSmartPtr< OSOutput > osoutput
InitVarValue ** var
initial value for each variable
IntVector * rowIdx
a pointer of row indices if the problem is stored by column
std::string value
value of the option
int numberOfCon
number of <con> children
NonlinearExpressions * nonlinearExpressions
nonlinearExpressions is a pointer to a NonlinearExpressions object
bool setLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor, double *values, int valuesBegin, int valuesEnd, int *indexes, int indexesBegin, int indexesEnd, int *starts, int startsBegin, int startsEnd)
set linear constraint coefficients
std::string value
value of the option
int getVariableNumber()
Get number of variables.
std::string printModel()
Print the infix representation of the problem.
bool setAnotherSolverOption(std::string name, std::string value, std::string solver, std::string category, std::string type, std::string description)
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
unsigned int inumberOfChildren
inumberOfChildren is the number of OSnLNode child elements If this number is not fixed, e.g., for a sum node, it is temporarily set to 0
int idx
idx is the index of the variable
bool setAnOtherVariableOption(OtherVariableOption *varOption)
IntVector * colIdx
a pointer of column indices if the problem is stored by row
ograd * og
og is a pointer to the AMPL data structure holding the objective function coefficients ...
int numberOfOtherObjectiveOptions
number of <other> child elements
bool readNl(std::string stub)
read the nl file
bool createOSObjects()
create an OSInstance and OSOption representation from the AMPL nl content (Some of the information in...
void setOsol(std::string osol)
set the osol string
int numberOfEnumerations
number of <enumeration> child elements
OtherVariableOption ** other
other variable options
InitDualVariableValues * initialDualValues
initial dual values for the constraints
Bonmin::BqpdSolver::fint fint
std::string name
name of the option
ConstraintOption * constraints
the options for the constraints
std::string name
name of the option
Take an OSOption object and write a string that validates against the OSoL schema.
bool getInitialBasisElements(int type, int status, int *elem)
Get the initial basis elements for a particular variable type and basis status.
static char integerOrBinary(real upper, real lower)
int numberOfCon
number of <con> children
bool setAnOtherObjectiveOption(OtherObjectiveOption *objOption)
std::string conType
type of the values in the con array
the OtherObjOption class.
std::string name
name of the option
IntVector * start
a pointer to the start of each row or column stored in sparse format
OSnl2OS()
the OSnl2OS class constructor
std::string varType
type of the values in the var array
the OtherVarOption class.
std::vector< double > operand
The in-memory representation of the <nonlinearExpressions> element.
The OSnLNodeNumber Class.
int numberOfEnumerations
number of <enumeration> child elements
Used to hold part of the instance in memory.
void fint fint fint real fint real real real real real real real real real * e
OSnLNode * walkTree(expr *e)
parse an nl tree structure holding a nonlinear expression
int numberOfVar
number of child elements
Bonmin::BqpdSolver::real real
The OSnLNodeNegate Class.
BasisStatus * initialBasisStatus
initial basis information
bool setConstraintNumber(int number)
set the number of constraints.
int numberOfOtherVariableOptions
number of <other> child elements
The OSnLNodeSquare Class.
Nl ** nl
nl is pointer to an array of Nl object pointers
DoubleVector * value
a pointer to the array of nonzero values being stored
OSOption * osoption
osoption is a pointer to the OSOption object that gets created from the information in the nl file (a...
the OtherObjectiveOption class.
double value
initial value
The OSnLNodeVariable Class.
std::string writeOSoL(OSOption *theosoption)
create an osol string from an OSOption object
std::string description
description of the option
bool setObjectiveNumber(int number)
set the number of objectives.
int numberOfVar
number of children
bool addConstraint(int index, std::string name, double lowerBound, double upperBound, double constant)
add a constraint.
bool addObjective(int index, std::string name, std::string maxOrMin, double constant, double weight, SparseVector *objectiveCoefficients)
add an objective.
double value
value is the value of the number
a sparse vector data structure
The OSnLNodeDivide Class.
OSnLNode ** m_mChildren
m_mChildren holds all the operands, that is, nodes that the current node operates on...
OSOption * readOSoL(const std::string &osol)
parse the OSoL solver options.
double lbDualValue
initial lower bound
std::string jobID
jobID is a string containing a jobID that may have been supplied on the command line (it may be empty...
~OSnl2OS()
the OSnl2OS class destructor
bool m_bWhiteSpace
m_bWhiteSpace is set to true if we write white space in the file
std::string value
value of the option
OtherObjectiveOption * getOtherObjectiveOption(int optionNumber)
Get one particular <other> objective option from the array of options.
OSnLNode * m_treeRoot
m_treeRoot holds the root node (of OSnLNode type) of the expression tree.
InstanceData * instanceData
A pointer to an InstanceData object.
bool deepCopyFrom(OSOption *that)
A function to make a deep copy of an OSOption object.
The in-memory representation of the <nl> element.
std::string description
description of the option
VariableOption * variables
the options for the variables
OtherVarOption ** var
array of option values
int idx
idx holds the row index of the nonlinear expression
std::string osol
osol is a string containing the content of the OS option file (it may be empty if no option file was ...
OtherConOption ** con
array of option values
std::vector< std::string > op_type
bool setInstanceDescription(std::string description)
set the instance description.
std::string writeOSiL(const OSInstance *theosinstance)
create an osil string from an OSInstance object
the InitDualVarValue class.
InitDualVarValue ** con
initial dual values for each constraint
OtherObjectiveOption ** other
other information about the objectives
bool m_bDeleteExpressionTree
m_bDeleteExpressionTree is true, if in garbage collection, we should delete the osExpression tree obj...
Used to read an OSoL string.
ASL * getASL(std::string name)
return a pointer to an ASL object
std::string objType
type of the values in the obj array
std::string os_dtoa_format(double x)
ScalarExpressionTree * osExpressionTree
osExpressionTree contains the root of the ScalarExpressionTree
double * values
values holds a double array of nonzero values.
int numberOfObj
number of <obj> children
void setIBVar(OSInstance *osinstance, int lower, int upper)
special version of the previous method because AMPL makes no distinction between integer and binary v...
bool setJobID(std::string jobID)
Set the job ID.
OptimizationOption * optimization
optimizationOption holds the fifth child of the OSOption specified by the OSoL Schema.
int numberOfOtherConstraintOptions
number of <other> child elements
int numberOfNonlinearExpressions
numberOfNonlinearExpressions is the number of <nl> elements in the <nonlinearExpressions> element...
int numberOfEnumerations
number of <enumeration> child elements
void setJobID(std::string jobID)
set the job ID
the OtherVariableOption class.
int * indexes
indexes holds an integer array of indexes whose corresponding values are nonzero. ...
bool setInitVarValuesSparse(int numberOfVar, InitVarValue **var)
std::string description
description of the option
bool setAnOtherConstraintOption(OtherConstraintOption *optionValue)
bool setVariableNumber(int number)
set the number of variables.
The in-memory representation of an OSiL instance..
ObjectiveOption * objectives
the options for the objectives
BasisStatus * initialBasisStatus
initial basis status for the slack variables
The OSnLNode Class for nonlinear expressions.
OtherObjOption ** obj
array of option values
OSInstance * osinstance
osinstance is a pointer to the OSInstance object that gets created from the information in the nl fil...
bool setInitDualVarValuesSparse(int numberOfCon, InitDualVarValue **con)
used for throwing exceptions.
the OtherConOption class.
LinearConstraintCoefficients * linearConstraintCoefficients
linearConstraintCoefficients is a pointer to a LinearConstraintCoefficients object ...
OtherConstraintOption * getOtherConstraintOption(int optionNumber)
Get one particular <other> constraint option from the array of options.
OtherVariableOption * getOtherVariableOption(int optionNumber)
Get one particular <other> variable option from the array of options.
Take an OSInstance object and write a string that validates against the OSiL schema.
int getNumberOfInitialBasisElements(int type, int status)
Get the number of initial basis elements for a particular variable type and basis status...
void setVar(OSInstance *osinstance, int lower, int upper, char vartype)
store a number of variables into an OSInstance object
OtherConstraintOption ** other
other information about the constraints
InitVariableValues * initialVariableValues
initial values for the variables
OSoLReader * osolreader
we may need to parse an OSoL file if there is suffix information indicated in the AMPL nl content ...