Difference between revisions of "OptInfo"
Line 21: | Line 21: | ||
| Returns a comprehensive view inside the optimization, listing most items shown here. This is the same info you get when you double click on the «LP», «NLP», etc., cell in a result window. | | Returns a comprehensive view inside the optimization, listing most items shown here. This is the same info you get when you double click on the «LP», «NLP», etc., cell in a result window. | ||
|- | |- | ||
− | | " | + | | "DecisionVector" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Vars | | Vars | ||
Line 27: | Line 27: | ||
| This lists all scalar decision variable, where each structured decision has been "flattened" to a single vector. This same index is used to index may of the possible [[OptInfo]] results that refer to scalar decisions, e.g., "ObjCoef", "Q", "Lhs", "LhsQ", etc. | | This lists all scalar decision variable, where each structured decision has been "flattened" to a single vector. This same index is used to index may of the possible [[OptInfo]] results that refer to scalar decisions, e.g., "ObjCoef", "Q", "Lhs", "LhsQ", etc. | ||
|- | |- | ||
− | | " | + | | "ConstraintVector" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Constraints | | Constraints | ||
Line 33: | Line 33: | ||
| This lists all the scalar constraints, where each structured constraint has been flattened to a single vector. This same index is used to index many of the possible [[OptInfo]] results that refer to scalar constraints, e.g., "Lhs", "LhsQ", "Rhs", "Sense", "constraintLb", "constraintUb", etc. | | This lists all the scalar constraints, where each structured constraint has been flattened to a single vector. This same index is used to index many of the possible [[OptInfo]] results that refer to scalar constraints, e.g., "Lhs", "LhsQ", "Rhs", "Sense", "constraintLb", "constraintUb", etc. | ||
|- | |- | ||
− | | " | + | | "Decisions" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
(Structured only) | (Structured only) | ||
Line 40: | Line 40: | ||
| This lists the names of each structured decision in the optimization. This index is also used by other items of [[OptInfo]] when the result applies to the set of structured decision variables. This only applies to problems created using [[DefineOptimization]]. | | This lists the names of each structured decision in the optimization. This index is also used by other items of [[OptInfo]] when the result applies to the set of structured decision variables. This only applies to problems created using [[DefineOptimization]]. | ||
|- | |- | ||
− | | " | + | | "Constraints" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
(Structured only) | (Structured only) | ||
Line 47: | Line 47: | ||
| This lists the names of each structured constraint in the optimization. This index is also used by other items of [[OptInfo]] when the result applies to the set of structured constraints. This only applies to problems created using [[DefineOptimization]]. | | This lists the names of each structured constraint in the optimization. This index is also used by other items of [[OptInfo]] when the result applies to the set of structured constraints. This only applies to problems created using [[DefineOptimization]]. | ||
|- | |- | ||
− | | " | + | | "ObjCoef" |
| LP, QP, QCP | | LP, QP, QCP | ||
| Vars | | Vars | ||
Line 59: | Line 59: | ||
| The scalar quadratic coefficients for the objective. Dense matrix. | | The scalar quadratic coefficients for the objective. Dense matrix. | ||
|- | |- | ||
− | | " | + | | "Lhs" |
| LP, QP, QCP | | LP, QP, QCP | ||
| Vars, Constraints | | Vars, Constraints | ||
Line 65: | Line 65: | ||
| The linear coefficients for all scalar constraints. Dense matrix. You may optionally specify «constraint» to obtain the coefficients for just one constraint, in the intrinsic dimensionality of that constraint but with respect to all scalar decision variables. Or you may specify «decision» to get the coefficients for just one decision, but relative to all scalar constraints. Or you may specify both «decision» and «constraint» to get the coefficients for only one decision and only one constraint, in the dimensionality of each. | | The linear coefficients for all scalar constraints. Dense matrix. You may optionally specify «constraint» to obtain the coefficients for just one constraint, in the intrinsic dimensionality of that constraint but with respect to all scalar decision variables. Or you may specify «decision» to get the coefficients for just one decision, but relative to all scalar constraints. Or you may specify both «decision» and «constraint» to get the coefficients for only one decision and only one constraint, in the dimensionality of each. | ||
|- | |- | ||
− | | " | + | | "LhsQ", |
| QCP | | QCP | ||
| Vars, Vars2, Constraints | | Vars, Vars2, Constraints | ||
Line 71: | Line 71: | ||
| The quadratic coefficients for all scalar scalar constraints. Dense matrices, may be too large to fit in memory for some large structured QCPs. You may optionally specify «decision» and/or «constraint» to obtain the quadratic coefficients for just that structured decision and constraint. | | The quadratic coefficients for all scalar scalar constraints. Dense matrices, may be too large to fit in memory for some large structured QCPs. You may optionally specify «decision» and/or «constraint» to obtain the quadratic coefficients for just that structured decision and constraint. | ||
|- | |- | ||
− | | " | + | | "Rhs" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Constraints | | Constraints | ||
Line 77: | Line 77: | ||
| The right-hand side coefficients for all scalar constraints. You may optionally specify «constraint» to get the coefficients for a single structured constraint, in which case the result will be indexed by the constraint's intrinsic indexes. For a linear or quadratic constraint, the RHS will be the constant term. There is no guarantee of the sign, since it depends on how [[DefineOptimization]] re-arranges the constraint when it processes the coefficients. For a non-linear constraint, rhs will usually be 0. For a range constraint, e.g., <code>a <= f(x) <= b</code>, the far right constant (b) is returned. It is better to use "constraintLb" and "constraintUb" for range constraints. | | The right-hand side coefficients for all scalar constraints. You may optionally specify «constraint» to get the coefficients for a single structured constraint, in which case the result will be indexed by the constraint's intrinsic indexes. For a linear or quadratic constraint, the RHS will be the constant term. There is no guarantee of the sign, since it depends on how [[DefineOptimization]] re-arranges the constraint when it processes the coefficients. For a non-linear constraint, rhs will usually be 0. For a range constraint, e.g., <code>a <= f(x) <= b</code>, the far right constant (b) is returned. It is better to use "constraintLb" and "constraintUb" for range constraints. | ||
|- | |- | ||
− | | " | + | | "ConstraintUb" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Constraints | | Constraints | ||
Line 83: | Line 83: | ||
| Upper bound for each scalar constraint. You may optionally specify «constraint» to obtain the values for a single structured constraint in the intrinsic dimensionality of the constraint. | | Upper bound for each scalar constraint. You may optionally specify «constraint» to obtain the values for a single structured constraint in the intrinsic dimensionality of the constraint. | ||
|- | |- | ||
− | | " | + | | "ConstraintLb" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Constraints | | Constraints | ||
Line 89: | Line 89: | ||
| Lower bound for each scalar constraint. You may optionally specify «constraint» to obtain the values for a single structured constraint in the intrinsic dimensionality of the constraint. | | Lower bound for each scalar constraint. You may optionally specify «constraint» to obtain the values for a single structured constraint in the intrinsic dimensionality of the constraint. | ||
|- | |- | ||
− | | " | + | | "Sense" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Constraints | | Constraints | ||
Line 95: | Line 95: | ||
| Inequality for each constraint. 'R' for range (lb & ub). You may optionally specify «constraint» to obtain the sense for a single structured constraint. | | Inequality for each constraint. 'R' for range (lb & ub). You may optionally specify «constraint» to obtain the sense for a single structured constraint. | ||
|- | |- | ||
− | | " | + | | "Lb" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Vars | | Vars | ||
Line 101: | Line 101: | ||
| Lower bound for each scalar variable. You may optionally specify «decision» to obtain the value for a single structured decision variable, in terms of the decision's intrinsic indexes. | | Lower bound for each scalar variable. You may optionally specify «decision» to obtain the value for a single structured decision variable, in terms of the decision's intrinsic indexes. | ||
|- | |- | ||
− | | " | + | | "Ub" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Vars | | Vars | ||
Line 107: | Line 107: | ||
| Upper bound for each scalar variable. You may optionally specify «decision» to obtain the value for a single structured decision variable, in terms of the decision's intrinsic indexes. | | Upper bound for each scalar variable. You may optionally specify «decision» to obtain the value for a single structured decision variable, in terms of the decision's intrinsic indexes. | ||
|- | |- | ||
− | | " | + | | "IntegerType" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| Vars | | Vars | ||
Line 113: | Line 113: | ||
| The type of all scalar decision variables. Optionally you may specify «decision» to get the integer type(s) for the indicated structured decision, in terms of the decision's intrinsic indexes. | | The type of all scalar decision variables. Optionally you may specify «decision» to get the integer type(s) for the indicated structured decision, in terms of the decision's intrinsic indexes. | ||
|- | |- | ||
− | | " | + | | "Group" |
| LP,QP,QCP, NLP | | LP,QP,QCP, NLP | ||
| Vars | | Vars | ||
Line 119: | Line 119: | ||
| Applicable only to a grouped integer variable, returns the group number for each scalar decision variable. You may optionally specify «decision» to obtain the groups for a single structured decision, which will be indexed by the decision's intrinsic indexes. | | Applicable only to a grouped integer variable, returns the group number for each scalar decision variable. You may optionally specify «decision» to obtain the groups for a single structured decision, which will be indexed by the decision's intrinsic indexes. | ||
|- | |- | ||
− | | " | + | | "Maximize" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| atomic | | atomic | ||
Line 125: | Line 125: | ||
| Indicates whether the optimization maximizes or minimizes an objective, or whether there is no objective at all (a find any feasible problem). | | Indicates whether the optimization maximizes or minimizes an objective, or whether there is no objective at all (a find any feasible problem). | ||
|- | |- | ||
− | | " | + | | "Engine" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| atomic | | atomic | ||
Line 131: | Line 131: | ||
| The name of the engine that will be, or was, used to solve the optimization. | | The name of the engine that will be, or was, used to solve the optimization. | ||
|- | |- | ||
− | | " | + | | "Setting" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| local .Parameter | | local .Parameter | ||
Line 137: | Line 137: | ||
| A list of all solver engine control setting values. | | A list of all solver engine control setting values. | ||
|- | |- | ||
− | | " | + | | "Type" |
| LP,QP,QCP,NLP | | LP,QP,QCP,NLP | ||
| atomic | | atomic |
Revision as of 01:58, 22 February 2011
New to Analytica 4.3. Supercedes the earlier SolverInfo function.
OptInfo(opt, item, decision, constraint, asRef)
Provides access to an «item» in the definition of an optimization problem definition («opt») created by DefineOptimization.
Possible values for the «item» are:
"Item" | Used for | Indexed by | Type | Description |
---|---|---|---|---|
"All" | LP, QP, QCP, NLP | local .item | various | Returns a comprehensive view inside the optimization, listing most items shown here. This is the same info you get when you double click on the «LP», «NLP», etc., cell in a result window. |
"DecisionVector" | LP,QP,QCP,NLP | Vars | Text | This lists all scalar decision variable, where each structured decision has been "flattened" to a single vector. This same index is used to index may of the possible OptInfo results that refer to scalar decisions, e.g., "ObjCoef", "Q", "Lhs", "LhsQ", etc. |
"ConstraintVector" | LP,QP,QCP,NLP | Constraints | Text | This lists all the scalar constraints, where each structured constraint has been flattened to a single vector. This same index is used to index many of the possible OptInfo results that refer to scalar constraints, e.g., "Lhs", "LhsQ", "Rhs", "Sense", "constraintLb", "constraintUb", etc. |
"Decisions" | LP,QP,QCP,NLP
(Structured only) |
local .Decision | Text | This lists the names of each structured decision in the optimization. This index is also used by other items of OptInfo when the result applies to the set of structured decision variables. This only applies to problems created using DefineOptimization. |
"Constraints" | LP,QP,QCP,NLP
(Structured only) |
local .Constraint | Text | This lists the names of each structured constraint in the optimization. This index is also used by other items of OptInfo when the result applies to the set of structured constraints. This only applies to problems created using DefineOptimization. |
"ObjCoef" | LP, QP, QCP | Vars | numeric | The scalar objective linear coefficients. |
"Q" | QP, QCP | Vars, Vars2 | numeric | The scalar quadratic coefficients for the objective. Dense matrix. |
"Lhs" | LP, QP, QCP | Vars, Constraints | numeric | The linear coefficients for all scalar constraints. Dense matrix. You may optionally specify «constraint» to obtain the coefficients for just one constraint, in the intrinsic dimensionality of that constraint but with respect to all scalar decision variables. Or you may specify «decision» to get the coefficients for just one decision, but relative to all scalar constraints. Or you may specify both «decision» and «constraint» to get the coefficients for only one decision and only one constraint, in the dimensionality of each. |
"LhsQ", | QCP | Vars, Vars2, Constraints | numeric | The quadratic coefficients for all scalar scalar constraints. Dense matrices, may be too large to fit in memory for some large structured QCPs. You may optionally specify «decision» and/or «constraint» to obtain the quadratic coefficients for just that structured decision and constraint. |
"Rhs" | LP,QP,QCP,NLP | Constraints | numeric | The right-hand side coefficients for all scalar constraints. You may optionally specify «constraint» to get the coefficients for a single structured constraint, in which case the result will be indexed by the constraint's intrinsic indexes. For a linear or quadratic constraint, the RHS will be the constant term. There is no guarantee of the sign, since it depends on how DefineOptimization re-arranges the constraint when it processes the coefficients. For a non-linear constraint, rhs will usually be 0. For a range constraint, e.g., a <= f(x) <= b , the far right constant (b) is returned. It is better to use "constraintLb" and "constraintUb" for range constraints.
|
"ConstraintUb" | LP,QP,QCP,NLP | Constraints | numeric | Upper bound for each scalar constraint. You may optionally specify «constraint» to obtain the values for a single structured constraint in the intrinsic dimensionality of the constraint. |
"ConstraintLb" | LP,QP,QCP,NLP | Constraints | numeric | Lower bound for each scalar constraint. You may optionally specify «constraint» to obtain the values for a single structured constraint in the intrinsic dimensionality of the constraint. |
"Sense" | LP,QP,QCP,NLP | Constraints | '>=','<=', '=', 'R' | Inequality for each constraint. 'R' for range (lb & ub). You may optionally specify «constraint» to obtain the sense for a single structured constraint. |
"Lb" | LP,QP,QCP,NLP | Vars | numeric | Lower bound for each scalar variable. You may optionally specify «decision» to obtain the value for a single structured decision variable, in terms of the decision's intrinsic indexes. |
"Ub" | LP,QP,QCP,NLP | Vars | numeric | Upper bound for each scalar variable. You may optionally specify «decision» to obtain the value for a single structured decision variable, in terms of the decision's intrinsic indexes. |
"IntegerType" | LP,QP,QCP,NLP | Vars | 'Continuous', 'Integer', 'Boolean', 'Grouped Integer', or 'Semi-Continuous'. | The type of all scalar decision variables. Optionally you may specify «decision» to get the integer type(s) for the indicated structured decision, in terms of the decision's intrinsic indexes. |
"Group" | LP,QP,QCP, NLP | Vars | numeric | Applicable only to a grouped integer variable, returns the group number for each scalar decision variable. You may optionally specify «decision» to obtain the groups for a single structured decision, which will be indexed by the decision's intrinsic indexes. |
"Maximize" | LP,QP,QCP,NLP | atomic | True, False, Null | Indicates whether the optimization maximizes or minimizes an objective, or whether there is no objective at all (a find any feasible problem). |
"Engine" | LP,QP,QCP,NLP | atomic | text | The name of the engine that will be, or was, used to solve the optimization. |
"Setting" | LP,QP,QCP,NLP | local .Parameter | numeric | A list of all solver engine control setting values. |
"Type" | LP,QP,QCP,NLP | atomic | "LP","QP", "QCP", "CQCP", "NCQCP", "NLP", "NSP" | The problem type. |
"Intrinsic Indexes" | LP,QP,QCP,NLP
(Structured only) |
local .index, Local .item | Null, Handle, set of Handles | This lists in the index .index a set of handles for all the indexes treated as intrinsic indexes anywhere in the optimization. The array shows which structured decisions (result[.item='Decision'] ) and which structured constraints (result[.item='Constraint'] ) contains the index as an intrinsic index.
You may optionally specify either «decision» or «constraint» to get the intrinsic indexes for a single node. In this case the result is scalar (Null, Handle, or set of Handles. |
"Extrinsic Indexes" | LP,QP,QCP,NLP
(Structured only) |
local .index, Local .item | Null, Handle, set of Handles
Boolean (0 or 1) for objective. |
This lists in the index .index a set of handles for all the indexes treated as extrinsic indexes anywhere in the optimization. The array shows which structured decisions (result[.item='Decision'] ) and which structured constraints (result[.item='Constraint'] ) contains the index as an intrinsic index, and also whether the index is shows up as extrinsic in the objective.
You may optionally specify either «decision» or «constraint» to get the extrinsic indexes for a single node. In this case the result is scalar (Null, Handle, or set of Handles. This option is very useful when you wondering why DefineOptimization has array-abstracted over an index, producing multiple optimization problems. The result points to you exactly which component(s) of your problem the extra indexes are arising from. |
"Decision Intrinsic Indexes" | LP,QP,QCP,NLP
(Structured only) |
local .Decision | Null or set of Handles | Lists all structured decision nodes, and for each, a set containing the the indexes that are intrinsic to decision variable. You may optionally select a single decision node by specifying «decision». |
"Decision Extrinsic Indexes" | LP,QP,QCP,NLP
(Structured only) |
local .Decision | Null or set of Handles | Lists all structured decision nodes, and for each, a set containing the the indexes treated as extrinsic for the decision. You may optionally select a single decision node by specifying «decision». |
"Objective Dims" | LP,QP,QCP,NLP
(Structured only) |
scalar | Null, Handle, or set of Handles | A list of the indexes that show up in the objective (i.e., are extrinsic to the objective). These result in an array-abstraction over the indexes by DefineOptimization, resulting in an array of optimizations. |
If you include as a «decision» the identifier of a decision variable passed into the «decisions» parameter of DefineOptimization, it gives results just for that decision. The result is dimensioned by the decision variable's indexes rather than by the .Vars index. The «decision» parameter is relevant to any of the «item»s in the above table that show .Vars in the dimensionality column.
«constraint» is the identifier of a constraint node passed into the «constraints» parameter of DefineOptimization. When this is provided, only the portion of the requested item relevant to that constraint is returned, and the result is dimensioned by the constraint's OptDimensions rather than by the .Constraints index. The «constraint» parameter is relevant to any of the «item»s in the above table that show .Constraints in the dimensionality column.
Enable comment auto-refresher