8.9.13. MDOModel¶
- MDOModel¶
Represent a model in MindOpt application
Methods
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
Add a new linear constraint to this model
Add a new linear constraint to this model
Add a new linear constraint to this model
Add a new linear constraint to this model
Add new linear constraints to this model
Add a new linear constraint to this model
Add a new linear constraint to this model
Add new linear constraints to this model
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 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 model
Add a new quadratic constraint to model
Add a new quadratic constraint to model
Add a new quadratic constraint to model
Add a new quadratic constraint to model
Add a new quadratic constraint to model
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 String parameter by name
Retrieve the value of a specific int attribute associated with specific general constraints
Retrieve the value of a specific attribute associated with general constraints
Retrieve the value of a specific attribute associated with a variable
Retrieve the value of a specific int attribute associated with specific general constraints
Retrieve the value of a specific attribute associated with general constraints
Retrieve the value of a specific int attribute associated with specific general constraints
Retrieve the value of a specific attribute associated with general constraints
Retrieve the value of a specific int attribute associated with specific general constraints
Retrieve the value of a specific attribute associated with general constraints
Retrieve the value of a specific double attribute associated with specific quadratic constraints
Retrieve the value of a specific string attribute associated with specific quadratic constraints
Retrieve the value of a specific double attribute associated with specific quadratic constraints
Retrieve the value of a specific string attribute associated with specific quadratic constraints
Retrieve the value of a specific attribute associated with a variable
Retrieve the value of a specific double attribute associated with specific quadratic constraints
Retrieve the value of a specific string attribute associated with specific quadratic constraints
Retrieve the value of a specific double attribute associated with specific quadratic constraints
Retrieve the value of a specific string attribute associated with specific quadratic constraints
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 coefficient values of variables from constraint matrices
Retrieve the values of a column from a constraint matrix
Retrieve the ith constraint in this model
Retrieve constraint by constraint name
Retrieve all constraints in this model
Retrieve the environment associated with this model
Retrieve a general constraint by its object
Retrieve all general constraints in this model
Retrieve the objective function of this model
Retrieve the ith PSD constraint in this model
Retrieve all PSD constraints in this model
Retrieve the ith PSD variable
Retrieve all PSD variables in this model
Retrieve left-hand-side quadratic expression for a quadratic constraint
Retrieve quadratic constraint by constraint name
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 the ith variable in this model
Retrieve variables by name
Retrieve all variables in this 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 an quadratic constraint from this model
Reset the model to the unsolved state, discard any previously calculated solutions, and clear only the solutions
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 parameter
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 String attribute associated with a specific general constraint list
Set the value of the int attribute
Set the value of a specific attribute associated with specified a general constraint list
Set the value of the String attribute associated with a specific general constraint matrix
Set the value of the String attribute associated with a specific general constraint cube
设置和指定二次约束关联的特定double属性的值
设置和指定二次约束关联的特定string属性的值
设置和指定二次约束关联的特定double属性的值
设置和指定二次约束关联的特定string属性的值
Set the value of the double attribute
设置和指定二次约束关联的特定double属性的值
设置和指定二次约束关联的特定string属性的值
设置和指定二次约束关联的特定double属性的值
设置和指定二次约束关联的特定string属性的值
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
Write model data to a file
- 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
- 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. If it is NULL, 0 is used.
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used’. 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(MDOLinExpr lhsExpr, char sense, MDOVar rhsVar, String name)¶
Add a new linear constraint to this model
- Parameters
MDOLinExpr lhsExpr – The left-hand-side linear expression
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used’. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
MDOVar rhsVar – The right-hand-side variable
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 constraints
- MDOConstr addConstr(MDOVar lhsVar, char sense, MDOLinExpr rhsExpr, String name)¶
Add a new linear constraint to this model
- Parameters
MDOVar lhsVar – The left-hand-side variable
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used’. 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 constraints
- MDOConstr addConstr(MDOVar v, char sense, MDOVar rhsVar, String name)¶
Add a new linear constraint to this model
- Parameters
MDOVar v – The left-hand-side variable
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used’. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
MDOVar rhsVar – The right-hand-side variable
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 constraints
- MDOConstr addConstr(MDOVar lhsVar, char sense, double rhs, String name)¶
Add new linear constraints to this model
- Parameters
MDOVar lhsVar – Left-hand-side variable
char sense –
The inequality sign. Supported flags include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
double rhs – The right-hand-side value.
String name – The name of the new constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
The newly added constraints
- MDOConstr addConstr(double lhs, char sense, MDOVar rhsVar, String name)¶
Add a new linear constraint to this model
- Parameters
double lhs – The left-hand-side value
char sense –
The inequality sign. Supported flags include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
MDOVar rhsVar – The right-hand-side variable
String name – The name of the new constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
The Newly added constraints
- MDOConstr addConstr(MDOLinExpr lhsExpr, char sense, double rhs, String name)¶
Add a new linear constraint to this model.
- Parameters
MDOLinExpr lhsExpr – The left-hand-side linear expression
char sense –
An inequality flag. Supported flags include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
double rhs – The right-hand-side value.
String name – The name of the new constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
The newly added constraints
- MDOConstr addConstr(double lhs, char sense, MDOLinExpr rhsExpr, String name)¶
Add new linear constraints to this model
- Parameters
double lhs – The left-hand-side value
char sense –
An inequality flag. Supported flags 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
The newly added constraints
- 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, String[] names, int start, int len)¶
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’.
String[] names – The name of the new constraint. If it is NULL, the system automatically generates the name.
int start – The specified start index to be added.
int len – The specified number of indices to be added.
- 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.
- 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, MDOVar rhsVar, String name)¶
Add a new quadratic constraint to model.
- Parameters
MDOQuadExpr lhsExpr – The left-hand-side quadratic expression.
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
MDOVar rhsVar – The right-hand-side variable
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(MDOQuadExpr lhsExpr, char sense, MDOLinExpr rhsExpr, String name)¶
Add a new quadratic constraint to model.
- Parameters
MDOQuadExpr lhsExpr – The left-hand-side quadratic expression.
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used. 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 quadratic constraint. An empty string is allowed. In this case, the system-generated name is given.
- Returns
Newly added quadratic constraint.
- MDOQConstr addQConstr(MDOQuadExpr lhsExpr, char sense, double rhs, String name)¶
Add a new quadratic constraint to model.
- Parameters
MDOQuadExpr lhsExpr – The left-hand-side quadratic expression.
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used. Supported symbols include:
MDO.EQUAL
MDO.LESS_EQUAL
MDO.GREATER_EQUAL
double rhs – The right-hand-side constant
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(MDOLinExpr lhsExpr, char sense, MDOQuadExpr rhsExpr, String name)¶
Add a new quadratic constraint to model.
- Parameters
MDOLinExpr lhsExpr – The left-hand-side linear expression.
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used. 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(MDOVar var, char sense, MDOQuadExpr rhsExpr, String name)¶
Add a new quadratic constraint to model.
- Parameters
MDOVar var – The left-hand-side variable.
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used. 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(double lhs, char sense, MDOQuadExpr rhsExpr, String name)¶
Add a new quadratic constraint to model.
- Parameters
double lhs – The left-hand-side constant.
char sense –
The inequality sign. If it is NULL, ‘MDO.LESS_EQUAL’ will be used. 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.
- 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.
- String get(MDO.StringParam param)¶
Retrieve the value of a String parameter by name
- Parameters
MDO.StringParam param – Parameter name
- Returns
The current value of the parameter to be retrieved.
- int[] get(MDO.IntAttr attr, MDOGenConstr[] genconstrs)¶
Retrieve the value of a specific int attribute associated with specific general constraints
- Parameters
MDO.IntAttr attr – Attribute
MDOGenConstr[] genconstrs – Associated general constraints
- Returns
The attribute value to be retrieved.
- String[] get(MDO.StringAttr attr, MDOGenConstr[] genconstrs)¶
Retrieve the value of a specific attribute associated with general constraints
- Parameters
MDO.StringAttr attr – Attribute
MDOGenConstr[] genconstrs – Associated general constraints
- Returns
The attribute value 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.
- int[] get(MDO.IntAttr attr, MDOGenConstr[] genconstrs, int start, int len)¶
Retrieve the value of a specific int attribute associated with specific general constraints
- Parameters
MDO.IntAttr attr – Attribute
MDOGenConstr[] genconstrs – 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, MDOGenConstr[] genconstrs, int start, int len)¶
Retrieve the value of a specific attribute associated with general constraints
- Parameters
MDO.StringAttr attr – Attribute
MDOGenConstr[] genconstrs – Associated general 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, MDOGenConstr[][] genconstrs)¶
Retrieve the value of a specific int attribute associated with specific general constraints
- Parameters
MDO.IntAttr attr – Attribute
MDOGenConstr[][] genconstrs – Associated general constraints
- Returns
The attribute value to be retrieved.
- String[][] get(MDO.StringAttr attr, MDOGenConstr[][] genconstrs)¶
Retrieve the value of a specific attribute associated with general constraints
- Parameters
MDO.StringAttr attr – Attribute
MDOGenConstr[][] genconstrs – Associated general constraints
- Returns
The attribute value to be retrieved.
- int[][][] get(MDO.IntAttr attr, MDOGenConstr[][][] genconstrs)¶
Retrieve the value of a specific int attribute associated with specific general constraints
- Parameters
MDO.IntAttr attr – Attribute
MDOGenConstr[][][] genconstrs – Associated general constraints
- Returns
The attribute value to be retrieved.
- String[][][] get(MDO.StringAttr attr, MDOGenConstr[][][] genconstrs)¶
Retrieve the value of a specific attribute associated with general constraints
- Parameters
MDO.StringAttr attr – Attribute
MDOGenConstr[][][] genconstrs – Associated general constraints
- Returns
The attribute value to be retrieved.
- double[] get(MDO.DoubleAttr attr, MDOQConstr[] qconstrs)¶
Retrieve the value of a specific double attribute associated with specific quadratic constraints.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[] qconstrs – Quadratic constraint array.
- Returns
The attribute value to be retrieved.
- string[] get(MDO.StringAttr attr, MDOQConstr[] qconstrs)¶
Retrieve the value of a specific string attribute associated with specific quadratic constraints.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[] qconstrs – Quadratic constraint array.
- Returns
The attribute value to be retrieved.
- double[] get(MDO.DoubleAttr attr, MDOQConstr[] qconstrs, int start, int len)¶
Retrieve the value of a specific double attribute associated with specific quadratic constraints.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[] qconstrs – Quadratic constraint array.
int start – The starting index of the array.
int len – Number of associated quadratic constraints.
- Returns
The attribute value to be retrieved.
- string[] get(MDO.StringAttr attr, MDOQConstr[] qconstrs, int start, int len)¶
Retrieve the value of a specific string attribute associated with specific quadratic constraints.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[] qconstrs – Quadratic constraint array.
int start – The starting index of the array.
int len – Number of associated quadratic constraints.
- 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.
- double[][] get(MDO.DoubleAttr attr, MDOQConstr[][] qconstrs)¶
Retrieve the value of a specific double attribute associated with specific quadratic constraints.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[][] qconstrs – Quadratic constraint array.
- Returns
The attribute value to be retrieved.
- string[][] get(MDO.StringAttr attr, MDOQConstr[][] qconstrs)¶
Retrieve the value of a specific string attribute associated with specific quadratic constraints.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[][] qconstrs – Quadratic constraint array.
- Returns
The attribute value to be retrieved.
- double[][][] get(MDO.DoubleAttr attr, MDOQConstr[][][] qconstrs)¶
Retrieve the value of a specific double attribute associated with specific quadratic constraints.
- Parameters
MDO.DoubleAttr attr – Attribute name.
MDOQConstr[][][] qconstrs – Quadratic constraint array.
- Returns
The attribute value to be retrieved.
- string[][][] get(MDO.StringAttr attr, MDOQConstr[][][] qconstrs)¶
Retrieve the value of a specific string attribute associated with specific quadratic constraints.
- Parameters
MDO.StringAttr attr – Attribute name.
MDOQConstr[][][] qconstrs – Quadratic constraint array.
- 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.
- double getCoeff(MDOConstr constr, MDOVar var)¶
Retrieve coefficient values of variables from constraint matrices
- Parameters
MDOConstr constr – Constraints to be queried
MDOVar var – The name of the variable to be queried.
- Returns
The coefficient 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 getConstr(int i)¶
Retrieve the ith constraint in this model
- Parameters
int i – The index of the constraint to be retrieved.
- Returns
Constraint to be retrieved
- MDOConstr getConstrByName(String name)¶
Retrieve constraint by constraint name.
- Parameters
String name – The name of the constraint to be retrieved.
- Returns
Constraint to be retrieved.
- MDOConstr[] getConstrs()¶
Retrieve all constraints in this model
- Returns
All constraints in this model
- MDOEnv getEnv()¶
Retrieve the environment associated with this model
- Returns
The environment associated with the 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 getPsdConstr(int i)¶
Retrieve the ith PSD constraint in this model
- Parameters
int i – The index of the PSD constraint to be retrieved.
- Returns
PSD constraint to be retrieved
- MDOPsdConstr[] getPsdConstrs()¶
Retrieve all PSD constraints in this model
- Returns
All PSD constraints in this model
- MDOPsdVar getPsdVar(int i)¶
Retrieve the ith PSD variable
- Parameters
int i – The index of the PSD variable to be retrieved.
- Returns
PSD variable
- MDOPsdVar[] getPsdVars()¶
Retrieve all PSD variables in this model
- Returns
All PSD variables in this model
- MDOQuadExpr getQCRow(MDOQConstr qconstr)¶
Retrieve left-hand-side quadratic expression for a quadratic constraint.
- Parameters
MDOQConstr qconstr – Quadratic constraints to be retrieved.
- Returns
The quadratic expression.
- MDOQConstr getQConstrByName(String name)¶
Retrieve quadratic constraint by constraint name.
- Parameters
String name – The name of the quadratic constraint to be retrieved.
- Returns
Quadratic constraint to be retrieved.
- 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 getVar(int i)¶
Retrieve the ith variable in this model
- Parameters
int i – The index of the variable to be retrieved.
- Returns
The ith variable in this model
- MDOVar getVarByName(String name)¶
Retrieve variables by name
- Parameters
String name – The name of the variable to be retrieved
- Returns
Variable
- 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 qc)¶
Remove an quadratic constraint from this model.
- Parameters
MDOQConstr qc – The quadratic constraint to remove.
- void reset()¶
Reset the model to the unsolved state, discard any previously calculated solutions, and clear only the solutions.
- 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(String param, String value)¶
Set the value of the parameter. The type of the input parameter depends on the parameter itself.
- Parameters
String param – Parameter
String value – The string representation of the new value of the parameter.
- 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.StringAttr attr, MDOGenConstr[] genconstrs, String[] values)¶
Set the value of the String attribute associated with a specific general constraint list
- Parameters
MDO.StringAttr attr – Attribute to be modified
MDOGenConstr[] genconstrs – Associated general constraint list
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.StringAttr attr, MDOConstr[] constrs, String[] values, int start, int len)¶
Set the value of a specific attribute associated with specified a general constraint list
- Parameters
MDO.StringAttr attr – Attribute
MDOConstr[] constrs – Constraint array, some of which are associated general 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.StringAttr attr, MDOGenConstr[][] genconstrs, String[][] values)¶
Set the value of the String attribute associated with a specific general constraint matrix
- Parameters
MDO.StringAttr attr – Attribute to be modified
MDOGenConstr[][] genconstrs – Associated constraint matrix
String[][] values – The new value of the attribute to be set.
- void set(MDO.StringAttr attr, MDOGenConstr[][][] genconstrs, String[][][] values)¶
Set the value of the String attribute associated with a specific general constraint cube.
- Parameters
MDO.StringAttr attr – Attribute to be modified
MDOGenConstr[][][] genconstrs – Associated constraint cube
String[][][] values – The new value of the attribute to be set.
- void set(MDO.DoubleAttr attr, MDOQConstr[] qconstrs, double[] values)¶
设置和指定二次约束关联的特定double属性的值。
- Parameters
MDO.DoubleAttr attr – 属性名称。
MDOQConstr[] qconstrs – 二次约束数组。
double[] values – 值数组。
- void set(MDO.StringAttr attr, MDOQConstr[] qconstrs, String[] values)¶
设置和指定二次约束关联的特定string属性的值。
- Parameters
MDO.StringAttr attr – 属性名称。
MDOQConstr[] qconstrs – 二次约束数组。
String[] values – 值数组。
- void set(MDO.DoubleAttr attr, MDOQConstr[] qconstrs, double[] values, int start, int len)¶
设置和指定二次约束关联的特定double属性的值。
- Parameters
MDO.DoubleAttr attr – 属性名称。
MDOQConstr[] qconstrs – 二次约束数组。
double[] values – 值数组。
int start – 数组的起始索引
int len – 要设置的属性的数量
- void set(MDO.StringAttr attr, MDOQConstr[] qconstrs, String[] values, int start, int len)¶
设置和指定二次约束关联的特定string属性的值。
- Parameters
MDO.StringAttr attr – 属性名称。
MDOQConstr[] qconstrs – 二次约束数组。
String[] values – 值数组。
int start – 数组的起始索引
int len – 要设置的属性的数量
- 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.DoubleAttr attr, MDOQConstr[][] qconstrs, double[][] values)¶
设置和指定二次约束关联的特定double属性的值。
- Parameters
MDO.DoubleAttr attr – 属性名称。
MDOQConstr[][] qconstrs – 二次约束数组。
double[][] values – 值数组。
- void set(MDO.StringAttr attr, MDOQConstr[][] qconstrs, String[][] values)¶
设置和指定二次约束关联的特定string属性的值。
- Parameters
MDO.StringAttr attr – 属性名称。
MDOQConstr[][] qconstrs – 二次约束数组。
String[][] values – 值数组。
- void set(MDO.DoubleAttr attr, MDOQConstr[][][] qconstrs, double[][][] values)¶
设置和指定二次约束关联的特定double属性的值。
- Parameters
MDO.DoubleAttr attr – 属性名称。
MDOQConstr[][][] qconstrs – 二次约束数组。
double[][][] values – 值数组。
- void set(MDO.StringAttr attr, MDOQConstr[][][] qconstrs, String[][][] values)¶
设置和指定二次约束关联的特定string属性的值。
- Parameters
MDO.StringAttr attr – 属性名称。
MDOQConstr[][][] qconstrs – 二次约束数组。
String[][][] values – 值数组。
- 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 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.