8.7.13. MDOModel¶
- MDOModel¶
Represent a model in MindOpt application
Methods
Add a new linear constraint to this model
Add a new constraint to this model from a MDOTempConstr
Add an amount of constraints to this model
Add an amount of constraints to this model
Add a certain number of constraints to the specified position of this model
Add a new indicator constraint to this model
Add a new indicator constraint to this model with MDOTempConstr
Add a new PSD constraint to this model
Add a new PSD variable by indicating its dimension and name
Add a new PSD variables by indicating its objective coefficient and name
Add a new quadratic constraint to this model
Add a new quadratic constraint to this model from a MDOTempConstr
Add a new range constraint to this model
Add a new range PSD constraint to this model
Add an amount of range constraints to this model
Add an SOS constraint to the model
Add a variable to this model by indicate its lower bound, upper bound, objective coefficient, type and name
Add a variable to this model and associate it to exist constraints
Add a variable to this model and associate it with existing constraints by indicating the constraint matrix column
Add count variables of the same type to this model
Add multiple variables with different attributes
Add multiple variables with different attributes
Add multiple variables with different attributes and constraints
Change the constraint coefficient in constraint matrix
Change the constraint coefficients in the constraint matrix
Compute an IIS(Irreducible Inconsistent Subsystem)
Releases all resources associated with this model
Retrieve the value of an int attribute
Retrieve the value of the double attribute
Retrieve the value of a specific attribute associated with constraints
Retrieve the value of a specific int attribute associated with specific variables
Retrieve the value of a specific double attribute associated with specific variables
Retrieve the value of a specific char attribute associated with specific variables
Retrieve the value of a specific string attribute associated with specific variables
Retrieve the value of a specific int attribute associated with specific constraints
Retrieve the value of a specific double attribute associated with a specific constraint
Retrieve the value of a specific char attribute associated with specific constraints
Retrieve the value of a specific string attribute associated with specific constraints
Retrieve the value of an int attribute associated with a specific variable matrix
Retrieve the value of a string attribute
Retrieve the value of the double attribute associated with a specific variable matrix
Retrieve the value of the char attribute associated with a specific variable matrix
Retrieve the value of a string attribute associated with a specific variable matrix
Retrieve the value of an int attribute associated with a specific constraint matrix
Retrieve the value of the double attribute associated with a specific constraint matrix
Retrieve the value of the char attribute associated with a specific constraint matrix
Retrieve the value of a string attribute associated with a specific constraint matrix
Retrieve the value of an int attribute associated with a three-dimensional array of specific variables
Retrieve the value of the double attribute associated with a three-dimensional array of specific variables
Retrieve the value of the char attribute associated with a three-dimensional array of specific variables
Retrieve the value of a specific attribute associated with a variable
Retrieve the value of a string attribute associated with a three-dimensional array of specific variables
Retrieve the value of an int attribute associated with a specified constrained three-dimensional array
Retrieve the value of the double attribute associated with a specified constrained three-dimensional array
Retrieve the value of the char attribute associated with a specific constraint 3D array
Retrieve the value of a string attribute associated with a specified constrained three-dimensional array
Retrieve the value of an int parameter by name
Retrieve the value of the double parameter by its name
Retrieve the value of a specific attribute associated with a variable
Retrieve the value of a specific type[0] attribute associated with specific quadratic constraint
Retrieve the value of a specific type[1] attribute associated with specific quadratic constraint
Retrieve the value of a specific type[2] attribute associated with specific quadratic constraint
Retrieve the value of a specific type[3] attribute associated with specific quadratic constraint
Retrieve the value of a specific type[4] attribute associated with specific quadratic constraint
Retrieve the value of a specific type[5] attribute associated with specific quadratic constraint
Retrieve the value of a specific type[6] attribute associated with specific quadratic constraint
Retrieve the value of a specific type[7] attribute associated with specific quadratic constraint
Retrieve the value of a specific attribute associated with a variable
Retrieve the value of a specific attribute associated with a variable
Retrieve the value of a specific attribute associated with a constraint
Retrieve the value of a specific attribute associated with a constraint
Retrieve the value of a specific attribute associated with a constraint
Retrieve the values of a column from a constraint matrix
Retrieve constraints by constraint name
Retrieve all constraints in this model
Retrieve a general constraint by its object
Retrieve all general constraints in this model
Retrieve the objective function of this model
Retrieve all PSD constraints in this model
Retrieve all PSD variables in this model
Retrieve left-hand-side expression for a quadratic constraint
Retrieve all quadratic constraints in this model
Retrieve row from a constraint matrix by constraint
Retrieve the variables and coefficients contained in the SOS constraint
Retrieve all SOS constraints in the current model
Retrieve variables by name
Retrieve all variables in this model
Build models associated with the input environment
Read existing information from the file and build a model associated with the input environment
Copy from another existing model to create a new model
Start optimizing the model
Load data from a file to an existing model
Delete a variable from this model
Remove a constraint from this model
Remove an SOS constraint from this model
Remove a general constraint from this model
Remove a quadratic constraint from this model
Reset the model to the unsolved state and discard any previously calculated solutions
Set the value of the int parameter
Set the value of the double parameter
Set the value of a specific string attribute associated with a specified variable
Set the value of a specific int attribute associated with a specified constraint
Set the value of a specific double attribute associated with a specified constraint
Set the value of a specific char attribute associated with specified constraints
Set the value of a specific string attribute associated with specified constraints
Set the value of a specific int attribute associated with specified variable
Set the value of a specific double attribute associated with specified variables
Set the value of a specific attribute associated with specified variables
Set the value of a specific attribute associated with specified variables
Set the value of a specific int attribute associated with specified constraints
Set the value of a string parameter
Set the value of a specific double attribute associated with a specified constraint
Set the value of a specific char attribute associated with a specified constraint
Set the value of a specific attribute associated with a specified constraint
Set the value of the int attribute associated with a specific variable matrix
Set the value of the double attribute associated with a specific variable matrix
Set the value of the char attribute associated with a specific variable matrix
Set the value of the string attribute associated with a specific variable matrix
Set the value of the int attribute associated with a specific constraint matrix
Set the value of the double attribute associated with a specific constraint matrix
Set the value of the char attribute associated with a specific constraint matrix
Set the value of the string attribute associated with a specific constraint matrix
Set the value of the int attribute associated with a specific constraint matrix
Set the value of the double attribute associated with a specific constraint matrix
Set the value of the char attribute associated with a specific constraint matrix
Set the value of the string attribute associated with a specific constraint matrix
Set the value of the int attribute associated with a specific constraint 3D array
Set the value of the double attribute associated with a specific constraint 3D array
Set the value of the char attribute associated with a specific constraint 3D array
Set the value of the string attribute associated with a specific constraint 3D array
Set the value of the int attribute
Set the value of a specific double attribute associated with specified quadratic constraint
Set the value of a specific string attribute associated with specified quadratic constraint
Set the value of a specific double attribute associated with specified quadratic constraint
Set the value of a specific string attribute associated with specified quadratic constraint
Set the value of a specific double attribute associated with specified quadratic constraint
Set the value of a specific string attribute associated with specified quadratic constraint
Set the value of a specific double attribute associated with specified quadratic constraint
Set the value of a specific string attribute associated with specified quadratic constraint
Set the value of the double attribute
Set the value of a string attribute
Set the value of a specific attribute associated with specified variables
Set the value of a specific attribute associated with a specified variable
Set the value of a specific attribute associated with a specified variable
Set up a user defined callback class object
Set the objective function
Set the objective function
Write model data to a file
- MDOConstr AddConstr(MDOLinExpr lhsExpr, char sense, MDOLinExpr rhsExpr, string? name)¶
Add a new linear constraint to this model
- Parameters
MDOLinExpr lhsExpr – The left-hand-side linear expression of the new constraints.
char sense –
The inequality sign. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
MDOLinExpr rhsExpr – The right-hand-side linear expression
string? name – The name of the new constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
Newly added constraint
- MDOConstr AddConstr(MDOTempConstr tempConstr, string? name)¶
Add a new constraint to this model from a MDOTempConstr .
- Parameters
MDOTempConstr tempConstr – The MDOTempConstr
string? name – The name of the new constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
Newly added constraint
- MDOConstr[] AddConstrs(int count)¶
Add an amount of constraints to this model
- Parameters
int count – The number of constraints to be added
- Returns
The newly added constraint array
- MDOConstr[] AddConstrs(MDOLinExpr[] lhsExprs, char[] senses, double[] rhss, string[]? names)¶
Add an amount of constraints to this model
- Parameters
MDOLinExpr[] lhsExprs – The left-hand-side linear expressions of the new constraints. If it is NULL, 0 is used.
char[] senses –
The inequality sign of the new constraint. If it is NULL, ‘MDO.LESS_EQUAL’ will be used’. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
double[] rhss – The right-hand-side values of the new constraint. If NULL exists, ‘MDO.INFINITY’ will be used.
string[]? names – The name of the new constraints. If it is NULL, the system automatically generates the name.
- Returns
The newly added constraints
- MDOConstr[] AddConstrs(MDOLinExpr[] lhsExprs, char[] senses, double[] rhss, int start, int len, string[]? names)¶
Add a certain number of constraints to the specified position of this model
- Parameters
MDOLinExpr[] lhsExprs – The linear expression of the new constraint. If it is NULL, 0 is used.
char[] senses –
The inequality symbol of the new constraint. If it is NULL, ‘MDO.LESS_EQUAL’is used’. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
double[] rhss – The value to the right of the new constraint. If NULL exists, ‘MDO.INFINITY’is used’.
int start – The specified start index to be added.
int len – The specified length of indices to be added.
string[]? names – The name of the new constraint. If it is NULL, the system automatically generates the name.
- Returns
The newly added constraints
- MDOGenConstr AddGenConstrIndicator(MDOVar binvar, int binval, MDOLinExpr expr, char sense, double rhs, string? name)¶
Add a new indicator constraint to this model.
- Parameters
MDOVar binvar – The binary variable of this indicator constraint.
int binval – The binary value when indicator constraint take effect.
MDOLinExpr expr – The linear expression of new indicator constraint.
char sense – The constraint sense of new indicator constraint.
double rhs – The right-hand-side value of new indicator constraint.
string? name – The name of new indicator constraint.
- Returns
The newly added general constraint.
- MDOGenConstr AddGenConstrIndicator(MDOVar binvar, int binval, MDOTempConstr tempConstr, string? name)¶
Add a new indicator constraint to this model with MDOTempConstr .
- Parameters
MDOVar binvar – The binary variable of this indicator constraint.
int binval – The binary value when indicator constraint take effect.
MDOTempConstr tempConstr – The linear part of new indicator constraint.
string? name – The name of new indicator constraint.
- Returns
The newly added general constraint.
- MDOPsdConstr AddPsdConstr(MDOPsdExpr expr, char sense, double rhs, string? name)¶
Add a new PSD constraint to this model
- Parameters
MDOPsdExpr expr – The left-hand-side expression of new PSD constraint.
char sense –
The inequality symbol. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
double rhs – The right-hand-side value of the new PSD variable
string? name – The name of the new PSD constraint. If the string is empty, the system-generated name will be used.
- Returns
Newly added constraints
- MDOPsdVar AddPsdVar(int dim, string? name)¶
Add a new PSD variable by indicating its dimension and name
- Parameters
int dim – The dimension of the new PSD variable, that is, the number of matrix rows (or matrix columns , the matrix is square) associated with the new PSD variable.
string? name – The name of the new PSD variable. If the string is empty, the system-generated name will be used.
- Returns
The newly added PSD variable
- MDOPsdVar AddPsdVar(MDOMatrix obj, string? name)¶
Add a new PSD variables by indicating its objective coefficient and name
- Parameters
MDOMatrix obj – The objective coefficient of the new PSD variable, it should be a square matrix.
string? name – The name of new PSD variable, can be empty string in which case a system generated name will be given.
- Returns
Newly added PSD variable
- MDOQConstr AddQConstr(MDOQuadExpr lhsExpr, char sense, MDOQuadExpr rhsExpr, string? name)¶
Add a new quadratic constraint to this model
- Parameters
MDOQuadExpr lhsExpr – The left-hand-side quadratic expression.
char sense –
The inequality sign. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
MDOQuadExpr rhsExpr – The right-hand-side quadratic expression
string? name – The name of the new quadratic constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
Newly added quadratic constraint
- MDOQConstr AddQConstr(MDOTempConstr tempConstr, string? name)¶
Add a new quadratic constraint to this model from a MDOTempConstr .
- Parameters
MDOTempConstr tempConstr – The MDOTempConstr
string? name – The name of the new quadratic constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
Newly added quadratic constraint
- MDOConstr AddRange(MDOLinExpr expr, double lower, double upper, string? name)¶
Add a new range constraint to this model
- Parameters
MDOLinExpr expr – Linear expression
double lower – Lower bound of linear expression
double upper – Upper bound of linear expression
string? name – The name of the new constraint. If the string is empty, the system-generated name will be used.
- Returns
Newly added constraints
- MDOPsdConstr AddRangePsdConstr(MDOPsdExpr expr, double lower, double upper, string? name)¶
Add a new range PSD constraint to this model
- Parameters
MDOPsdExpr expr – The expression of new PSD constraint
double lower – The lower bound of the PSD expression
double upper – The upper bound of the PSD expression
string? name – The name of the new PSD constraint. If the string is empty, the system-generated name will be used.
- Returns
The newly added constraints
- MDOConstr[] AddRanges(MDOLinExpr[] exprs, double[] lower, double[] upper, string[]? names)¶
Add an amount of range constraints to this model
- Parameters
MDOLinExpr[] exprs – An array of linear expressions for the new constraints. If it is NULL, 0 is used as the left value.
double[] lower – The lower bound array of the linear expressions. If it is NULL, 0 is used as the lower limit.
double[] upper – The upper bound array of linear expressions. If it is NULL, ‘MDO.INFINITY’is used’.
string[]? names – The name array of the new constraints. If it is NULL, the system-generated name is used.
- Returns
The newly added constraint array
- MDOSOS AddSOS(MDOVar[] vars, double[] weights, int type)¶
Add an SOS constraint to the model
- Parameters
MDOVar[] vars – Variables included in the new SOS constraint
double[] weights – Weights of variables in new SOS constraints
int type –
The type of the new SOS constraint. Supported types include:
MDO_SOS_TYPE1(1)
A maximum of one variable in a set is not equal to 0.
MDO_SOS_TYPE2(2)
A maximum of two consecutive variables in a set are not equal to 0.
- Returns
Newly added SOS constraint
- MDOVar AddVar(double lb, double ub, double obj, char type, string? name)¶
Add a variable to this model by indicate its lower bound, upper bound, objective coefficient, type and name.
- Parameters
double lb – The lower bound of new variable.
double ub – The upper bound of new variable.
double obj – The objective coefficient of new variable.
char type –
The type of the new variable. Supported types include:
MDO.CONTINUOUS(‘C’) continuous variable,
MDO.BINARY(‘B’) binary variable,
MDO.INTEGER (‘$) integer variable,
MDO.SEMICONT (‘S’) semi-continuous variable,
MDO.SEMIINT (‘$) semi-integer variable.
string? name – The name of the new variable. If it is an empty string, the system-generated name is used.
- Returns
The newly added variable
- MDOVar AddVar(double lb, double ub, double obj, char type, MDOConstr[] constrs, double[] coeffs, string? name)¶
Add a variable to this model and associate it to exist constraints.
- Parameters
double lb – The lower bound of new variable.
double ub – The upper bound of new variable.
double obj – The objective coefficient of new variable.
char type –
The type of the new variable. Supported types include:
MDO.CONTINUOUS(‘C’) continuous variable,
MDO.BINARY(‘B’) binary variable,
MDO.INTEGER (‘$) integer variable,
MDO.SEMICONT (‘S’) semi-continuous variable,
MDO.SEMIINT (‘$) semi-integer variable.
MDOConstr[] constrs – The constraints to be associated
double[] coeffs – The constraint coefficient of each associated constraint. If NULL, all coefficients are set to zero.
string? name – The name of the new variable. If it is an empty string, the system-generated name is used.
- Returns
The newly added variable
- MDOVar AddVar(double lb, double ub, double obj, char type, MDOColumn col, string? name)¶
Add a variable to this model and associate it with existing constraints by indicating the constraint matrix column
- Parameters
double lb – The lower bound of new variable
double ub – The upper bound of new variables
double obj – The objective coefficient of new variable.
char type –
The type of the new variable. Supported types include:
MDO.CONTINUOUS(‘C’) continuous variable,
MDO.BINARY(‘B’) binary variable,
MDO.INTEGER (‘$) integer variable,
MDO.SEMICONT (‘S’) semi-continuous variable,
MDO.SEMIINT (‘$) semi-integer variable.
MDOColumn col – The constraint matrix column associated with new variables
string? name – The name of the new variable. If it is an empty string, the system-generated name is used.
- Returns
The newly added variable
- MDOVar[] AddVars(int count, char type)¶
Add count variables of the same type to this model
- Parameters
int count – Number of variables to be added.
char type –
The type of the new variables. Supported types include:
MDO.CONTINUOUS(‘C’) continuous variable,
MDO.BINARY(‘B’) binary variable,
MDO.INTEGER (‘$) integer variable,
MDO.speecht (‘S’) semi-continuous variable,
MDO.SEMIINT (‘$) semi-integer variable.
- Returns
The newly added array of variables
- MDOVar[] AddVars(double[] lb, double[] ub, double[] obj, char[]? type, string[]? names)¶
Add multiple variables with different attributes
- Parameters
double[] lb – The lower bounds of the new variables. If it is NULL, set the lower limit to 0.
double[] ub – The upper bounds of the new variable. If it is NULL, set the upper limit to ‘MDO.INFINITY’.
double[] obj – The objective coefficients of new variables, 0 will be used if NULL presents.
char[]? type –
The type of the new variable. Supported types include:
MDO.CONTINUOUS(‘C’) continuous variable,
MDO.BINARY(‘B’) binary variable,
MDO.INTEGER (‘$) integer variable,
MDO.SEMICONT (‘S’) semi-continuous variable,
MDO.SEMIINT (‘$) semi-integer variable.
string[]? names – The name of the new variable. If it is NULL, the system-generated name is used.
- Returns
The newly added array of variables
- MDOVar[] AddVars(double[] lb, double[] ub, double[] obj, char[]? type, string[]? names, int start, int len)¶
Add multiple variables with different attributes
- Parameters
double[] lb – The lower bounds of the new variable. If it is NULL, the lower limit is set to 0.
double[] ub – The upper bounds of the new variable. If it is NULL, the upper limit is set to ‘MDO.INFINITY’.
double[] obj – The objective coefficients of new variables, 0 will be used if NULL presents.
char[]? type –
The type of the new variable. Supported types include:
MDO.CONTINUOUS(‘C’) continuous variable,
MDO.BINARY(‘B’) binary variable,
MDO.INTEGER (‘$) integer variable,
MDO.SEMICONT (‘S’) semi-continuous variable,
MDO.SEMIINT (‘$) semi-integer variable.
string[]? names – The name of the new variable. If it is NULL, the system-generated name is used.
int start – Specifies the start index of the input to be added.
int len – The number of variables to add
- Returns
The newly added array of variables
- MDOVar[] AddVars(double[] lb, double[] ub, double[] obj, char[] type, string[]? names, MDOColumn[] col)¶
Add multiple variables with different attributes and constraints
- Parameters
double[] lb – The lower bounds of the new variable. If it is NULL, the lower limit is set to 0.
double[] ub – The upper bounds of the new variable. If it is NULL, the upper limit is set to ‘MDO.INFINITY’.
double[] obj – The objective coefficients of new variables. If it is NULL, the target coefficients of the new variable are all set to 0.
char[] type –
The type of the new variable. Supported types include:
MDO.CONTINUOUS(‘C’) continuous variable,
MDO.BINARY(‘B’) binary variable,
MDO.INTEGER (‘$) integer variable,
MDO.SEMICONT (‘S’) semi-continuous variable,
MDO.SEMIINT (‘$) semi-integer variable.
string[]? names – The name of the new variable. If it is NULL, the system-generated name is used.
MDOColumn[] col – The constraint matrix column to associate with the new variable
- Returns
The newly added array of variables
- void ChgCoeff(MDOConstr constr, MDOVar var, double value)¶
Change the constraint coefficient in constraint matrix
- Parameters
MDOConstr constr – The constraint to indicate the coefficient
MDOVar var – The variable to indicate the coefficient
double value – The new coefficient value
- void ChgCoeffs(MDOConstr[] constrs, MDOVar[] vars, double[] values)¶
Change the constraint coefficients in the constraint matrix
- Parameters
MDOConstr[] constrs – Constraints of coefficients
MDOVar[] vars – Variable of coefficient
double[] values – New coefficient value
- void ComputeIIS()¶
Compute an IIS(Irreducible Inconsistent Subsystem). IIS is a subset of variable bounds and constraint bounds, this subset satisfies:
The subproblem corresponding to the subset is still infeasible.
After delete any bound in this subset, the subproblem becomes feasible.
Check IIS related attributes for variable and constraint for more details.
Note
The cardinality of the subsystem is supposed to be small. Note that the problem is supposed to be infeasible.
- void Dispose()¶
Releases all resources associated with this model. Note that this model cannot be used after this method is called.
- int Get(MDO.IntAttr attr)¶
Retrieve the value of an int attribute.
- Parameters
MDO.IntAttr attr – Attribute
- Returns
The current value of the attribute to be retrieved
- double Get(MDO.DoubleAttr attr)¶
Retrieve the value of the double attribute
- Parameters
MDO.DoubleAttr attr – Attribute
- Returns
The current value of the attribute to be retrieved
- string[] Get(MDO.StringAttr attr, MDOConstr[] constrs)¶
Retrieve the value of a specific attribute associated with constraints
- Parameters
MDO.StringAttr attr – Attribute
MDOConstr[] constrs – Associated constraint
- Returns
The attribute value to be retrieved.
- int[] Get(MDO.IntAttr attr, MDOVar[] vars, int start, int len)¶
Retrieve the value of a specific int attribute associated with specific variables
- Parameters
MDO.IntAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
int start – The starting index of the array.
int len – Number of associated variables
- Returns
The attribute value to be retrieved.
- double[] Get(MDO.DoubleAttr attr, MDOVar[] vars, int start, int len)¶
Retrieve the value of a specific double attribute associated with specific variables
- Parameters
MDO.DoubleAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
int start – The starting index of the array.
int len – Number of associated variables
- Returns
The attribute value to be retrieved.
- char[] Get(MDO.CharAttr attr, MDOVar[] vars, int start, int len)¶
Retrieve the value of a specific char attribute associated with specific variables
- Parameters
MDO.CharAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
int start – The starting index of the array.
int len – Number of associated variables
- Returns
The attribute value to be retrieved.
- string[] Get(MDO.StringAttr attr, MDOVar[] vars, int start, int len)¶
Retrieve the value of a specific string attribute associated with specific variables
- Parameters
MDO.StringAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
int start – The starting index of the array.
int len – Number of associated variables
- Returns
The attribute value to be retrieved.
- int[] Get(MDO.IntAttr attr, MDOConstr[] constrs, int start, int len)¶
Retrieve the value of a specific int attribute associated with specific constraints
- Parameters
MDO.IntAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated constraints
int start – The starting index of the array.
int len – Number of associated constraints
- Returns
The attribute value to be retrieved.
- double[] Get(MDO.DoubleAttr attr, MDOConstr[] constrs, int start, int len)¶
Retrieve the value of a specific double attribute associated with a specific constraint
- Parameters
MDO.DoubleAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated constraints
int start – The starting index of the array.
int len – Number of associated constraints
- Returns
The attribute value to be retrieved.
- char[] Get(MDO.CharAttr attr, MDOConstr[] constrs, int start, int len)¶
Retrieve the value of a specific char attribute associated with specific constraints
- Parameters
MDO.CharAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated constraints
int start – The starting index of the array.
int len – Number of associated constraints
- Returns
The attribute value to be retrieved.
- string[] Get(MDO.StringAttr attr, MDOConstr[] constrs, int start, int len)¶
Retrieve the value of a specific string attribute associated with specific constraints
- Parameters
MDO.StringAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated constraints
int start – The starting index of the array.
int len – Number of associated constraints
- Returns
The attribute value to be retrieved.
- int[,] Get(MDO.IntAttr attr, MDOVar[,] vars)¶
Retrieve the value of an int attribute associated with a specific variable matrix
- Parameters
MDO.IntAttr attr – Attribute
MDOVar[,] vars – Correlation variable matrix
- Returns
The attribute value to be retrieved.
- string Get(MDO.StringAttr attr)¶
Retrieve the value of a string attribute.
- Parameters
MDO.StringAttr attr – Attribute
- Returns
The current value of the attribute to be retrieved
- double[,] Get(MDO.DoubleAttr attr, MDOVar[,] vars)¶
Retrieve the value of the double attribute associated with a specific variable matrix
- Parameters
MDO.DoubleAttr attr – Attribute
MDOVar[,] vars – Variable matrix
- Returns
The attribute value to be retrieved.
- char[,] Get(MDO.CharAttr attr, MDOVar[,] vars)¶
Retrieve the value of the char attribute associated with a specific variable matrix
- Parameters
MDO.CharAttr attr – Attribute
MDOVar[,] vars – Variable matrix
- Returns
The attribute value to be retrieved.
- string[,] Get(MDO.StringAttr attr, MDOVar[,] vars)¶
Retrieve the value of a string attribute associated with a specific variable matrix
- Parameters
MDO.StringAttr attr – Attribute
MDOVar[,] vars – Variable matrix
- Returns
The attribute value to be retrieved.
- int[,] Get(MDO.IntAttr attr, MDOConstr[,] constrs)¶
Retrieve the value of an int attribute associated with a specific constraint matrix
- Parameters
MDO.IntAttr attr – Attribute
MDOConstr[,] constrs – Constraint matrix
- Returns
The attribute value to be retrieved.
- double[,] Get(MDO.DoubleAttr attr, MDOConstr[,] constrs)¶
Retrieve the value of the double attribute associated with a specific constraint matrix
- Parameters
MDO.DoubleAttr attr – Attribute
MDOConstr[,] constrs – Constraint matrix
- Returns
The attribute value to be retrieved.
- char[,] Get(MDO.CharAttr attr, MDOConstr[,] constrs)¶
Retrieve the value of the char attribute associated with a specific constraint matrix
- Parameters
MDO.CharAttr attr – Attribute
MDOConstr[,] constrs – Constraint matrix
- Returns
The attribute value to be retrieved.
- string[,] Get(MDO.StringAttr attr, MDOConstr[,] constrs)¶
Retrieve the value of a string attribute associated with a specific constraint matrix
- Parameters
MDO.StringAttr attr – Attribute
MDOConstr[,] constrs – Constraint matrix
- Returns
The attribute value to be retrieved.
- int[,,] Get(MDO.IntAttr attr, MDOVar[,,] vars)¶
Retrieve the value of an int attribute associated with a three-dimensional array of specific variables
- Parameters
MDO.IntAttr attr – Attribute
MDOVar[,,] vars – Variable 3D array
- Returns
The attribute value to be retrieved.
- double[,,] Get(MDO.DoubleAttr attr, MDOVar[,,] vars)¶
Retrieve the value of the double attribute associated with a three-dimensional array of specific variables
- Parameters
MDO.DoubleAttr attr – Attribute
MDOVar[,,] vars – Variable 3D array
- Returns
The attribute value to be retrieved.
- char[,,] Get(MDO.CharAttr attr, MDOVar[,,] vars)¶
Retrieve the value of the char attribute associated with a three-dimensional array of specific variables
- Parameters
MDO.CharAttr attr – Attribute
MDOVar[,,] vars – Variable 3D array
- Returns
The attribute value to be retrieved.
- int[] Get(MDO.IntAttr attr, MDOVar[] vars)¶
Retrieve the value of a specific attribute associated with a variable
- Parameters
MDO.IntAttr attr – Attribute
MDOVar[] vars – Associated variable
- Returns
The attribute value to be retrieved.
- string[,,] Get(MDO.StringAttr attr, MDOVar[,,] vars)¶
Retrieve the value of a string attribute associated with a three-dimensional array of specific variables
- Parameters
MDO.StringAttr attr – Attribute
MDOVar[,,] vars – Variable 3D array
- Returns
The attribute value to be retrieved.
- int[,,] Get(MDO.IntAttr attr, MDOConstr[,,] constrs)¶
Retrieve the value of an int attribute associated with a specified constrained three-dimensional array.
- Parameters
MDO.IntAttr attr – Attribute
MDOConstr[,,] constrs – Constrained 3D array
- Returns
The attribute value to be retrieved.
- double[,,] Get(MDO.DoubleAttr attr, MDOConstr[,,] constrs)¶
Retrieve the value of the double attribute associated with a specified constrained three-dimensional array.
- Parameters
MDO.DoubleAttr attr – Attribute
MDOConstr[,,] constrs – Constrained 3D array
- Returns
The attribute value to be retrieved.
- char[,,] Get(MDO.CharAttr attr, MDOConstr[,,] constrs)¶
Retrieve the value of the char attribute associated with a specific constraint 3D array
- Parameters
MDO.CharAttr attr – Attribute
MDOConstr[,,] constrs – Constrained 3D array
- Returns
The attribute value to be retrieved.
- string[,,] Get(MDO.StringAttr attr, MDOConstr[,,] constrs)¶
Retrieve the value of a string attribute associated with a specified constrained three-dimensional array.
- Parameters
MDO.StringAttr attr – Attribute
MDOConstr[,,] constrs – Constrained 3D array
- Returns
The attribute value to be retrieved.
- int Get(MDO.IntParam param)¶
Retrieve the value of an int parameter by name
- Parameters
MDO.IntParam param – Parameter name
- Returns
The current value of the parameter to be retrieved.
- double Get(MDO.DoubleParam param)¶
Retrieve the value of the double parameter by its name
- Parameters
MDO.DoubleParam param – Parameter name
- Returns
The current value of the parameter to be retrieved.
- double[] Get(MDO.DoubleAttr attr, MDOVar[] vars)¶
Retrieve the value of a specific attribute associated with a variable
- Parameters
MDO.DoubleAttr attr – Attribute
MDOVar[] vars – Associated variable
- Returns
The attribute value to be retrieved.
- double[] Get(MDO.DoubleAttr attr, MDOQConstr[] qc)¶
Retrieve the value of a specific type[0] attribute associated with specific quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[] qc – The quadratic constraint array.
- Returns
The attribute value to be retrieved.
- string[] Get(MDO.StringAttr attr, MDOQConstr[] qc)¶
Retrieve the value of a specific type[1] attribute associated with specific quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[] qc – The quadratic constraint array.
- Returns
The attribute value to be retrieved.
- double[] Get(MDO.DoubleAttr attr, MDOQConstr[] qc, int start, int len)¶
Retrieve the value of a specific type[2] attribute associated with specific quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[] qc – The quadratic constraint array.
int start – The starting index of the array.
int len – Number of associated variables.
- Returns
The attribute value to be retrieved.
- string[] Get(MDO.StringAttr attr, MDOQConstr[] qc, int start, int len)¶
Retrieve the value of a specific type[3] attribute associated with specific quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[] qc – The quadratic constraint array.
int start – The starting index of the array.
int len – Number of associated variables.
- Returns
The attribute value to be retrieved.
- double[,] Get(MDO.DoubleAttr attr, MDOQConstr[,] qc)¶
Retrieve the value of a specific type[4] attribute associated with specific quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[,] qc – The quadratic constraint array.
- Returns
The attribute value to be retrieved.
- string[,] Get(MDO.StringAttr attr, MDOQConstr[,] qc)¶
Retrieve the value of a specific type[5] attribute associated with specific quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[,] qc – The quadratic constraint array.
- Returns
The attribute value to be retrieved.
- double[,,] Get(MDO.DoubleAttr attr, MDOQConstr[,,] qc)¶
Retrieve the value of a specific type[6] attribute associated with specific quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[,,] qc – The quadratic constraint array.
- Returns
The attribute value to be retrieved.
- string[,,] Get(MDO.StringAttr attr, MDOQConstr[,,] qc)¶
Retrieve the value of a specific type[7] attribute associated with specific quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[,,] qc – The quadratic constraint array.
- Returns
The attribute value to be retrieved.
- char[] Get(MDO.CharAttr attr, MDOVar[] vars)¶
Retrieve the value of a specific attribute associated with a variable
- Parameters
MDO.CharAttr attr – Attribute
MDOVar[] vars – Associated variable
- Returns
The attribute value to be retrieved.
- string[] Get(MDO.StringAttr attr, MDOVar[] vars)¶
Retrieve the value of a specific attribute associated with a variable
- Parameters
MDO.StringAttr attr – Attribute
MDOVar[] vars – Associated variable
- Returns
The attribute value to be retrieved.
- int[] Get(MDO.IntAttr attr, MDOConstr[] constrs)¶
Retrieve the value of a specific attribute associated with a constraint
- Parameters
MDO.IntAttr attr – Attribute
MDOConstr[] constrs – Associated constraint
- Returns
The attribute value to be retrieved.
- double[] Get(MDO.DoubleAttr attr, MDOConstr[] constrs)¶
Retrieve the value of a specific attribute associated with a constraint.
- Parameters
MDO.DoubleAttr attr – Attribute
MDOConstr[] constrs – Associated constraint
- Returns
The attribute value to be retrieved.
- char[] Get(MDO.CharAttr attr, MDOConstr[] constrs)¶
Retrieve the value of a specific attribute associated with a constraint
- Parameters
MDO.CharAttr attr – Attribute
MDOConstr[] constrs – Associated constraint
- Returns
The attribute value to be retrieved.
- MDOColumn GetCol(MDOVar var)¶
Retrieve the values of a column from a constraint matrix
- Parameters
MDOVar var – Variables that represent columns
- Returns
Constraint matrix columns to be retrieved
- MDOConstr GetConstrByName(string name)¶
Retrieve constraints by constraint name
- Parameters
string name – The name of the constraint to be retrieved.
- Returns
Constraints to be retrieved
- MDOConstr[] GetConstrs()¶
Retrieve all constraints in this model
- Returns
All constraints in this model
- MDOGenConstr.Indicator GetGenConstrIndicator(MDOGenConstr genconstr)¶
Retrieve a general constraint by its object.
- Parameters
MDOGenConstr genconstr – The general constraint object.
- Returns
The general constraint detailed data structure with 5 fields:
binVar: The binary variable of the indicator constraint.
binVal: The binary value when indicator constraint take effect.
expr: The linear expression of indicator constraint.
sense: The constraint sense of indicator constraint.
rhs: The right-hand-side value of indicator constraint.
- MDOGenConstr[] GetGenConstrs()¶
Retrieve all general constraints in this model
- Returns
All general constraints in this model
- MDOExpr GetObjective()¶
Retrieve the objective function of this model
- Returns
Objective function
- MDOPsdConstr[] GetPsdConstrs()¶
Retrieve all PSD constraints in this model
- Returns
All PSD constraints in this model
- MDOPsdVar[] GetPsdVars()¶
Retrieve all PSD variables in this model
- Returns
All PSD variables in this model
- MDOQuadExpr GetQCRow(MDOQConstr qconstr)¶
Retrieve left-hand-side expression for a quadratic constraint.
- Parameters
MDOQConstr qconstr – Quadratic constraint to be retrieved
- Returns
The left-hand-side expression
- MDOQConstr[] GetQConstrs()¶
Retrieve all quadratic constraints in this model
- Returns
All quadratic constraints in this model
- MDOLinExpr GetRow(MDOConstr constr)¶
Retrieve row from a constraint matrix by constraint
- Parameters
MDOConstr constr – Constraint to be retrieved
- Returns
Constraint matrix row to be retrieved
- MDOSOS.Value GetSOS(MDOSOS sos)¶
Retrieve the variables and coefficients contained in the SOS constraint.
- Parameters
MDOSOS sos – [in] SOS constraint
- Returns
The value of specified SOS constraint. It consists of 3 fields:
An int SOS type (MDO.SOS_TYPE1 or MDO.SOS_TYPE2).
- MDO_SOS_TYPE1(1)
A maximum of one variable in a set is not equal to 0.
- MDO_SOS_TYPE2(2)
A maximum of two consecutive variables in a set are not equal to 0.
All variables contained
Wights associated to variables
- MDOSOS[] GetSOSs()¶
Retrieve all SOS constraints in the current model
- Returns
Return a list of all SOS constraints in the model.
- MDOVar GetVarByName(string name)¶
Retrieve variables by name
- Parameters
string name – The name of the variable to be retrieved
- Returns
Variable
- MDOModel(MDOEnv env)¶
Build models associated with the input environment
- Parameters
MDOEnv env – Associated environment
- MDOModel(MDOEnv env, string filename)¶
Read existing information from the file and build a model associated with the input environment
- Parameters
MDOEnv env – Associated environment
string filename – The file name from which you want to read the model. The file format and compression type should be displayed after the filename. Valid file formats include. lp, .mps, and. qps, .dat-s. Supported compression types include. gz and. bz2.
- MDOModel(MDOModel model)¶
Copy from another existing model to create a new model
- Parameters
MDOModel model – Existing models to be copied
- void Optimize()¶
Start optimizing the model
- void Read(string filename)¶
Load data from a file to an existing model
- Parameters
string filename – The file name. Note that the file format and its compression type (optional) are encoded in the file name suffix. Valid suffixes are .prm and .mst. Valid compression types are .gz or .bz2.
- void Remove(MDOVar v)¶
Delete a variable from this model
- Parameters
MDOVar v – The variable to delete
- void Remove(MDOConstr c)¶
Remove a constraint from this model
- Parameters
MDOConstr c – The constraint to remove
- void Remove(MDOSOS sos)¶
Remove an SOS constraint from this model
- Parameters
MDOSOS sos – The SOS constraint to remove
- void Remove(MDOGenConstr genconstr)¶
Remove a general constraint from this model
- Parameters
MDOGenConstr genconstr – The general constraint to remove
- void Remove(MDOQConstr qconstr)¶
Remove a quadratic constraint from this model.
- Parameters
MDOQConstr qconstr – The quadratic constraint to remove.
- void Reset(int clearall)¶
Reset the model to the unsolved state and discard any previously calculated solutions
- Parameters
int clearall – Whether to clear all information instead of only the solution. 1 indicates yes, and 0 indicates that only the solution is cleared.
- void Set(MDO.IntParam param, int value)¶
Set the value of the int parameter.
- Parameters
MDO.IntParam param – Parameter
int value – The new value of the parameter.
- void Set(MDO.DoubleParam param, double value)¶
Set the value of the double parameter
- Parameters
MDO.DoubleParam param – Parameter
double value – The new value of the parameter.
- void Set(MDO.StringAttr attr, MDOVar[] vars, string[] values)¶
Set the value of a specific string attribute associated with a specified variable
- Parameters
MDO.StringAttr attr – Attribute
MDOVar[] vars – Variable array
string[] values – New value array
- void Set(MDO.IntAttr attr, MDOConstr[] constrs, int[] values)¶
Set the value of a specific int attribute associated with a specified constraint
- Parameters
MDO.IntAttr attr – Attribute
MDOConstr[] constrs – Associated constraint
int[] values – The new value of the attribute.
- void Set(MDO.DoubleAttr attr, MDOConstr[] constrs, double[] val)¶
Set the value of a specific double attribute associated with a specified constraint
- Parameters
MDO.DoubleAttr attr – Attribute
MDOConstr[] constrs – Associated constraint
double[] val – The new value of the attribute.
- void Set(MDO.CharAttr attr, MDOConstr[] constrs, char[] values)¶
Set the value of a specific char attribute associated with specified constraints
- Parameters
MDO.CharAttr attr – Attribute
MDOConstr[] constrs – Associated constraints
char[] values – The new value of the attribute.
- void Set(MDO.StringAttr attr, MDOConstr[] xconstrs, string[] values)¶
Set the value of a specific string attribute associated with specified constraints
- Parameters
MDO.StringAttr attr – Attribute
MDOConstr[] xconstrs – Associated constraints
string[] values – The new value of the attribute.
- void Set(MDO.IntAttr attr, MDOVar[] vars, int[] values, int start, int len)¶
Set the value of a specific int attribute associated with specified variable
- Parameters
MDO.IntAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
int[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.DoubleAttr attr, MDOVar[] vars, double[] values, int start, int len)¶
Set the value of a specific double attribute associated with specified variables
- Parameters
MDO.DoubleAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
double[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.CharAttr attr, MDOVar[] vars, char[] values, int start, int len)¶
Set the value of a specific attribute associated with specified variables
- Parameters
MDO.CharAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
char[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.StringAttr attr, MDOVar[] vars, string[] values, int start, int len)¶
Set the value of a specific attribute associated with specified variables
- Parameters
MDO.StringAttr attr – Attribute
MDOVar[] vars – An array of variables, some of which are associated variables.
string[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.IntAttr attr, MDOConstr[] constrs, int[] values, int start, int len)¶
Set the value of a specific int attribute associated with specified constraints
- Parameters
MDO.IntAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated constraints
int[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.StringParam param, string value)¶
Set the value of a string parameter
- Parameters
MDO.StringParam param – Parameter name
string value – The new value of the parameter.
- void Set(MDO.DoubleAttr attr, MDOConstr[] constrs, double[] values, int start, int len)¶
Set the value of a specific double attribute associated with a specified constraint
- Parameters
MDO.DoubleAttr attr – Attribute name
MDOConstr[] constrs – Constraint array, some of which are associated constraints
double[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.CharAttr attr, MDOConstr[] constrs, char[] values, int start, int len)¶
Set the value of a specific char attribute associated with a specified constraint
- Parameters
MDO.CharAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated constraints
char[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.StringAttr attr, MDOConstr[] constrs, string[] values, int start, int len)¶
Set the value of a specific attribute associated with a specified constraint
- Parameters
MDO.StringAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated constraints
string[] values – An array of values, some of which are new values of the attribute.
int start – The starting index of the array.
int len – The number of attributes to be set
- void Set(MDO.IntAttr attr, MDOVar[,] vars, int[,] values)¶
Set the value of the int attribute associated with a specific variable matrix
- Parameters
MDO.IntAttr attr – Attribute to be modified
MDOVar[,] vars – Associated variable matrix
int[,] values – The new value of the attribute to be set.
- void Set(MDO.DoubleAttr attr, MDOVar[,] vars, double[,] values)¶
Set the value of the double attribute associated with a specific variable matrix
- Parameters
MDO.DoubleAttr attr – Attribute to be modified
MDOVar[,] vars – Associated variable matrix
double[,] values – The new value of the attribute to be set.
- void Set(MDO.CharAttr attr, MDOVar[,] vars, char[,] values)¶
Set the value of the char attribute associated with a specific variable matrix
- Parameters
MDO.CharAttr attr – Attribute to be modified
MDOVar[,] vars – Associated variable matrix
char[,] values – The new value of the attribute to be set.
- void Set(MDO.StringAttr attr, MDOVar[,] vars, string[,] values)¶
Set the value of the string attribute associated with a specific variable matrix
- Parameters
MDO.StringAttr attr – Attribute to be modified
MDOVar[,] vars – Associated variable matrix
string[,] values – The new value of the attribute to be set.
- void Set(MDO.IntAttr attr, MDOConstr[,] constrs, int[,] values)¶
Set the value of the int attribute associated with a specific constraint matrix
- Parameters
MDO.IntAttr attr – Attribute to be modified
MDOConstr[,] constrs – Associated constraint matrix
int[,] values – The new value of the attribute to be set.
- void Set(MDO.DoubleAttr attr, MDOConstr[,] constrs, double[,] values)¶
Set the value of the double attribute associated with a specific constraint matrix
- Parameters
MDO.DoubleAttr attr – Attribute to be modified
MDOConstr[,] constrs – Associated constraint matrix
double[,] values – The new value of the attribute to be set.
- void Set(MDO.CharAttr attr, MDOConstr[,] constrs, char[,] values)¶
Set the value of the char attribute associated with a specific constraint matrix
- Parameters
MDO.CharAttr attr – Attribute to be modified
MDOConstr[,] constrs – Associated constraint matrix
char[,] values – The new value of the attribute to be set.
- void Set(MDO.StringAttr attr, MDOConstr[,] constrs, string[,] values)¶
Set the value of the string attribute associated with a specific constraint matrix
- Parameters
MDO.StringAttr attr – Attribute to be modified
MDOConstr[,] constrs – Associated constraint matrix
string[,] values – The new value of the attribute to be set.
- void Set(MDO.IntAttr attr, MDOVar[,,] vars, int[,,] values)¶
Set the value of the int attribute associated with a specific constraint matrix
- Parameters
MDO.IntAttr attr – Attribute to be modified
MDOVar[,,] vars – 3D array of associated variables
int[,,] values – The new value of the attribute to be set.
- void Set(MDO.DoubleAttr attr, MDOVar[,,] vars, double[,,] values)¶
Set the value of the double attribute associated with a specific constraint matrix
- Parameters
MDO.DoubleAttr attr – Attribute to be modified
MDOVar[,,] vars – 3D array of associated variables
double[,,] values – The new value of the attribute to be set.
- void Set(MDO.CharAttr attr, MDOVar[,,] vars, char[,,] values)¶
Set the value of the char attribute associated with a specific constraint matrix
- Parameters
MDO.CharAttr attr – Attribute to be modified
MDOVar[,,] vars – 3D array of associated variables
char[,,] values – The new value of the attribute to be set.
- void Set(MDO.StringAttr attr, MDOVar[,,] vars, string[,,] values)¶
Set the value of the string attribute associated with a specific constraint matrix
- Parameters
MDO.StringAttr attr – Attribute to be modified
MDOVar[,,] vars – 3D array of associated variables
string[,,] values – The new value of the attribute to be set.
- void Set(MDO.IntAttr attr, MDOConstr[,,] constrs, int[,,] values)¶
Set the value of the int attribute associated with a specific constraint 3D array
- Parameters
MDO.IntAttr attr – Attribute to be modified
MDOConstr[,,] constrs – Associated constraint 3D array
int[,,] values – The new value of the attribute to be set.
- void Set(MDO.DoubleAttr attr, MDOConstr[,,] constrs, double[,,] values)¶
Set the value of the double attribute associated with a specific constraint 3D array
- Parameters
MDO.DoubleAttr attr – Attribute to be modified
MDOConstr[,,] constrs – Associated constraint 3D array
double[,,] values – The new value of the attribute to be set.
- void Set(MDO.CharAttr attr, MDOConstr[,,] constrs, char[,,] values)¶
Set the value of the char attribute associated with a specific constraint 3D array
- Parameters
MDO.CharAttr attr – Attribute to be modified
MDOConstr[,,] constrs – Associated constraint 3D array
char[,,] values – The new value of the attribute to be set.
- void Set(MDO.StringAttr attr, MDOConstr[,,] constrs, string[,,] values)¶
Set the value of the string attribute associated with a specific constraint 3D array
- Parameters
MDO.StringAttr attr – Attribute to be modified
MDOConstr[,,] constrs – Associated constraint 3D array
string[,,] values – The new value of the attribute to be set.
- void Set(MDO.IntAttr attr, int value)¶
Set the value of the int attribute
- Parameters
MDO.IntAttr attr – Attribute
int value – New value
- void Set(MDO.DoubleAttr attr, MDOQConstr[] qc, double[] values)¶
Set the value of a specific double attribute associated with specified quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[] qc – The array of quadratic constraints.
double[] values – The array of values
- void Set(MDO.StringAttr attr, MDOQConstr[] qc, string[] values)¶
Set the value of a specific string attribute associated with specified quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[] qc – The array of quadratic constraints.
string[] values – The array of values
- void Set(MDO.DoubleAttr attr, MDOQConstr[] qc, double[] values, int start, int len)¶
Set the value of a specific double attribute associated with specified quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[] qc – The array of quadratic constraints.
double[] values – The array of values
int start – The starting index of the array.
int len – The number of attributes to be set.
- void Set(MDO.StringAttr attr, MDOQConstr[] qc, string[] values, int start, int len)¶
Set the value of a specific string attribute associated with specified quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[] qc – The array of quadratic constraints.
string[] values – The array of values
int start – The starting index of the array.
int len – The number of attributes to be set.
- void Set(MDO.DoubleAttr attr, MDOQConstr[,] qc, double[,] values)¶
Set the value of a specific double attribute associated with specified quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[,] qc – The array of quadratic constraints.
double[,] values – The array of values
- void Set(MDO.StringAttr attr, MDOQConstr[,] qc, string[,] values)¶
Set the value of a specific string attribute associated with specified quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[,] qc – The array of quadratic constraints.
string[,] values – The array of values
- void Set(MDO.DoubleAttr attr, MDOQConstr[,,] qc, double[,,] values)¶
Set the value of a specific double attribute associated with specified quadratic constraint.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[,,] qc – The array of quadratic constraints.
double[,,] values – The array of values
- void Set(MDO.StringAttr attr, MDOQConstr[,,] qc, string[,,] values)¶
Set the value of a specific string attribute associated with specified quadratic constraint.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[,,] qc – The array of quadratic constraints.
string[,,] values – The array of values
- void Set(MDO.DoubleAttr attr, double value)¶
Set the value of the double attribute.
- Parameters
MDO.DoubleAttr attr – Attribute name
double value – New value
- void Set(MDO.StringAttr attr, string val)¶
Set the value of a string attribute.
- Parameters
MDO.StringAttr attr – Attribute name
string val – New value
- Set(MDO.IntAttr attr, MDOVar[] vars, int[] values)¶
Set the value of a specific attribute associated with specified variables
- Parameters
MDO.IntAttr attr – Attribute
MDOVar[] vars – Associated variables
int[] values – The new value of the attribute.
- void Set(MDO.DoubleAttr attr, MDOVar[] vars, double[] values)¶
Set the value of a specific attribute associated with a specified variable
- Parameters
MDO.DoubleAttr attr – Attribute
MDOVar[] vars – Associated variables
double[] values – The new value of the attribute.
- void Set(MDO.CharAttr attr, MDOVar[] vars, char[] values)¶
Set the value of a specific attribute associated with a specified variable
- Parameters
MDO.CharAttr attr – Attribute
MDOVar[] vars – Associated variables
char[] values – The new value of the attribute.
- void SetCallback(MDOCallback? callback)¶
Set up a user defined callback class object.
- Parameters
MDOCallback? callback – The user defined callback class object.
- void SetObjective(MDOExpr expr, int sense)¶
Set the objective function
- Parameters
MDOExpr expr – Objective function to be set
int sense – The optimization direction. MDO.MAXIMIZE(-1) refers to maximization and MDO.MINIMIZE(1) refers to minimization. If you enter other values, the current optimization direction will not be changed. The default optimization sense is MDO_MINIMIZE.
- void SetObjective(MDOExpr expr)¶
Set the objective function
- Parameters
MDOExpr expr – Objective function to be set
- void Write(string filename)¶
Write model data to a file
- Parameters
string filename – The path to file where data serialized. Note that data type and its compression type (optionally) is encoded in the file name suffix. Valid suffixes are .lp, .mps and .qps for model itself, .sol, .bas, .prm and .mst for solution data, basis data, parameter settings and MIP starts. optionally followed by its compression type .gz or .bz2.