Initializing help system before first use

Variable Methods

The Variable type exposes the following members.

Methods
  Name Description
Public method AbsOf Create a constraint that requires this variable to be the absolute value of x.
Public method AndOf(IEnumerableVariable) Create a constraint that requires this variable to be the and of the specified arguments.
Public method AndOf(Variable) Create a constraint that requires this variable to be the and of the specified other variables.
Public method AndOf(IEnumerableVariable, String) Create a constraint that requires this variable to be the and of the specified arguments.
Public method ChgCoef Change the coefficient for this variable in a row.
Public method ChgCoefs Change the coefficients for this variable in multiple rows.
Public method ChgObj Change objective coefficient for this variable.
Public method ChgObjN Change objective coefficient for this variable.
Public method CompareTo Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Public method Div(ConstantExpression) Create a new expression that represents the quotient of this and arg.
Public method Div(Double) Create a new expression that represents the quotient of this and arg.
(Overrides ExpressionDiv(Double))
Public method Div(Expression) Create a new expression that represents the quotient of this and arg.
(Overrides ExpressionDiv(Expression))
Public method Eq(Double) Create an "equals" constraint with this expression as left-hand side.
(Overrides ExpressionEq(Double))
Public method Eq(Expression) Create an "equals" constraint with this expression as left-hand side.
(Overrides ExpressionEq(Expression))
Public method Equals Determines whether the specified object is equal to the current object.
(Overrides ObjectEquals(Object))
Public method Evaluate Compute the value of this expression with respect to the given solution Vector (which is not required to be feasible).
(Overrides ExpressionEvaluate(Double))
Public method Extract(Double, IPostfixExtractor) Extract this expression into postfix notation.
(Overrides ExpressionExtract(Double, IPostfixExtractor))
Public method Extract(Double, XPRSprobRowCreator) Extract this expression into a row. This is for internal use only, you should never have to call this function explicitly.
(Overrides ExpressionExtract(Double, XPRSprobRowCreator))
Public method Fix Fix this variable to a value. Set the lower bound and upper bound in the XpressProblem instance to which this variable belongs.
Public method Geq(Double) Create a "greater than or equal" constraint with this expression as left-hand side.
(Overrides ExpressionGeq(Double))
Public method Geq(Expression) Create a "greater than or equal" constraint with this expression as left-hand side.
(Overrides ExpressionGeq(Expression))
Public method GetCallbackRedCost Get reduced cost value for this variable from the solution associated with the current callback.

Note: This functions uses under the hood.

Note: Calling this function for multiple variables is not efficient. If you need to get values for multiple variables then consider using to get the values for all variables and then use to extract the value for a particular variable.

Public method GetCallbackSolution Get value for this variable from the solution associated with the current callback.

Note: This functions uses under the hood.

Note: Calling this function for multiple variables is not efficient. If you need to get values for multiple variables then consider using to get the values for all variables and then use to extract the value for a particular variable.

Public method GetConstantView Get the constant value to which this expression evaluates. If this expression can be treated as a constant value then the function returns the constant value. If the expression cannot be treated as a constant then an exception is raised. In order to test whether the expression can be treated as constant, use function [!:.GetMaxDegree()] and check whether it returns 0.
(Overrides ExpressionGetConstantView)
Public method GetHashCode Serves as the default hash function.
(Overrides ObjectGetHashCode)
Public method GetIndex Get the index that this object has in the underlying model. Attention: this is a very advanced function. Use it only if you know exactly what you are doing.
Public method GetIndexForProb Get the index stored in this object but raise an exception if the problem that created this object is not prob.
Public method GetLB Get the lower bound for this variable. Queries the Optimizer.Objects.XpressProblem instance to which this variable belongs and returns the lower bound obtained from that instance.
Public method GetLinearView Get a linear read-only view on this expression. If this expression can be treated as a linear expression then the function returns a readonly view on the linear terms (including the constant term if there is any). If the expression cannot be treated as a linear expression then an exception is raised. In order to test this expression can be treated as linear, use function [!:.GetMaxDegree()] and check whether it returns 0 or 1. In the returned System.Collections.Generic.KeyValuePair instances the constant term is indicated with a key of NULL_VARIABLE. Note that depending on the actual expression class and its implementation, the terms may not be presented in the same order in which you added them. There may also be multiple elements with the same key (again depending on the implementation of the actual object).
(Overrides ExpressionGetLinearView)
Public method GetMaxDegree Get the maximum degree of any of the terms/monomials that appear in the symbolic representation of all parenthesized sub-expressions are fully expanded. The maximum degree is
  • 0 for constant expressions.
  • 1 for linear expressions.
  • 2 for quadratic expressions.
  • Int32.MaxValue for function calls or formulas.

(Overrides ExpressionGetMaxDegree)
Public method GetName Get the name of this object. Queries the problem instance that owns this object and returns the name from that instance.
Public method GetObj Get objective coefficient for this variable.
Public method GetObjN Get objective coefficient for this variable.
Public method GetProblem Get the problem to which this element belongs.
Public method GetQuadView Get a quadratic read-only view on this expression. If this expression can be treated as a quadratic expression then the function returns a readonly view on the quadratic terms (including the constant term and linear terms if there are any). If the expression cannot be treated as a linear expression then an exception is raised. In order to test this expression can be treated as quadratic, use function [!:.GetMaxDegree()] and check whether it returns 0, 1, or 2. In the returned System.Collections.Generic.KeyValuePair instances the constant term is indicated with a key with two NULL_VARIABLEs. Linear terms are represented by a QPair with NULL_VARIABLE as second variable. Note that depending on the actual expression class and its implementation, the terms may not be presented in the same order in which you added them. There may also be multiple elements with the same key (again depending on the implementation of the actual object).
(Overrides ExpressionGetQuadView)
Public method GetRedCost Get the current reduced cost value for this variable.

Note: This functions uses under the hood. This is only valid to call if the `Optimizer.Objects.XpressProblem` instance owning this variable is currently not under optimization.

Note: Calling this function for multiple variables is not efficient. If you need to get values for multiple variables then consider using to get the values for all variables and then use to extract the value for a particular variable. This strategy is also valid from callbacks.

Public method GetRTTI Get runtime type identification.
(Overrides ExpressionGetRTTI)
Public method GetSerial Get the serial number of this object.
Public method GetSolution Get the current solution value for this variable.

Note: This functions uses under the hood. This is only valid to call if the `XpressProblem` instance owning this variable is currently not under optimization.

Note: Calling this function for multiple variables is not efficient. If you need to get values for multiple variables then consider using to get the values for all variables and then use to extract the value for a particular variable. This strategy is also valid from callbacks.

Public method GetType Get the type for this variable. Queries the XpressProblem instance to which this variable belongs and returns the name obtained from that instance.
Public method GetUB Get the upper bound for this variable. Queries the XpressProblem instance to which this variable belongs and returns the upper bound obtained from that instance.
Public method GetValue Get the value of this variable from an array. The function assumes that data is an array that stores a value for each variable in the underlying problem and returns the value from this array that corresponds to this variable. data arrays can be obtained for example from prob.GetSolution() or prob.GetCallbackSolution().
Public method IfNotThen Create an indicator constraint with this variable as indicator variable. The constraint will enforce implied if this variable is set to 0.
Public method IfThen Create an indicator constraint with this variable as indicator variable. The constraint will enforce implied if this variable is set to 1.
Public method In Create a range constraint that bounds this expression from below and above.
(Overrides ExpressionIn(Double, Double))
Public method Leq(Double) Create a "less than or equal" constraint with this expression as left-hand side.
(Overrides ExpressionLeq(Double))
Public method Leq(Expression) Create a "less than or equal" constraint with this expression as left-hand side.
(Overrides ExpressionLeq(Expression))
Public method MarkDeleted  
Public method MaxOf(Variable) Create a constraint that requires this variable to be the maximum of the specified other variables.
Public method MaxOf(IEnumerableVariable, IEnumerableDouble) Create a constraint that requires this variable to be the maximum of the specified arguments.
Public method MaxOf(Variable, Double) Create a constraint that requires this variable to be the maximum of the specified other variables and values.
Public method MaxOf(IEnumerableVariable, IEnumerableDouble, String) Create a constraint that requires this variable to be the maximum of the specified arguments.
Public method MinOf(Variable) Create a constraint that requires this variable to be the minimum of the specified other variables.
Public method MinOf(IEnumerableVariable, IEnumerableDouble) Create a constraint that requires this variable to be the minimum of the specified arguments.
Public method MinOf(Variable, Double) Create a constraint that requires this variable to be the minimum of the specified other variables and values.
Public method MinOf(IEnumerableVariable, IEnumerableDouble, String) Create a constraint that requires this variable to be the minimum of the specified arguments.
Public method Minus(Double) Create a new expression that represents the difference of this and arg.
(Inherited from Expression)
Public method Minus(Expression) Create a new expression that represents the difference of this and arg.
(Inherited from Expression)
Public method Mul(ConstantExpression) Create a new expression that represents the product of this and arg.
Public method Mul(Double) Create a new expression that represents the product of this and arg.
(Overrides ExpressionMul(Double))
Public method Mul(Expression) Create a new expression that represents the product of this and arg.
(Overrides ExpressionMul(Expression))
Public method Mul(LinTerm) Create a new expression that represents the product of this and arg.
Public method Mul(Variable) Create a new expression that represents the product of this and arg.
Public method OrOf(IEnumerableVariable) Create a constraint that requires this variable to be the or of the specified arguments.
Public method OrOf(Variable) Create a constraint that requires this variable to be the or of the specified other variables.
Public method OrOf(IEnumerableVariable, String) Create a constraint that requires this variable to be the or of the specified arguments.
Public method Plus(Double) Create a new expression that represents the sum of this and arg.
(Inherited from Expression)
Public method Plus(Expression) Create a new expression that represents the sum of this and arg.
(Inherited from Expression)
Public method PwlOf(Variable, PwlBreakpoint) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified by breakpoints evaluated for input.
Public method PwlOf(Variable, IEnumerablePwlBreakpoint) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified by breakpoints evaluated for input.
Public method PwlOf(Variable, IEnumerablePwlBreakpoint, String) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified by breakpoints evaluated for input.
Public method PwlOf(Variable, Double, Double) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified by xval/yval evaluated for input.
Public method PwlOf(Variable, Double, Double, String) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified by xval/yval evaluated for input.
Public method SetLB Set the lower bound for this variable. Set the lower bound in the XpressProblem instance to which this variable belongs.
Public method SetLimit Set the limit for this variable. Set the limit in the XpressProblem instance to which this variable belongs. Note that limits are ignored unless the variable is semi-continuous, semi-integer, or partial integer.
Public method SetName Set the name of this variable. Sets the name of this variable in the problem instance that owns the object.
Public method SetType Set the type for this variable. Set the type in the XpressProblem instance to which this variable belongs.
Public method SetUB Set the upper bound for this variable. Set the upper bound in the XpressProblem instance to which this variable belongs.
Public method Square Create a quadratic term by multiplying this variable with itself.
Public method ToString Returns the name from [!:.GetName()].
(Overrides ObjectToString)
Public method Uminus Create a new expression that represents the unary minus of this one.
(Overrides ExpressionUminus)
Public method UpdateIndex Add delta to this object's index.
Top
See Also

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.