TermModel.AddVariable Method (Object, Int32%, IEnumerable<Rational>)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Adds a variable that has a fixed set of possible values to a model.
Namespace: Microsoft.SolverFoundation.Services
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
Syntax
'Declaration
Public Function AddVariable ( _
key As Object, _
<OutAttribute> ByRef vid As Integer, _
possibleValues As IEnumerable(Of Rational) _
) As Boolean
public bool AddVariable(
Object key,
out int vid,
IEnumerable<Rational> possibleValues
)
public:
virtual bool AddVariable(
Object^ key,
[OutAttribute] int% vid,
IEnumerable<Rational>^ possibleValues
) sealed
abstract AddVariable :
key:Object *
vid:int byref *
possibleValues:IEnumerable<Rational> -> bool
override AddVariable :
key:Object *
vid:int byref *
possibleValues:IEnumerable<Rational> -> bool
public final function AddVariable(
key : Object,
vid : int,
possibleValues : IEnumerable<Rational>
) : boolean
Parameters
- key
Type: System.Object
Optional. The key for the variable, or nulla null reference (Nothing in Visual Basic).
- vid
Type: System.Int32%
The index of the new variable or of an existing variable that has the same key.
- possibleValues
Type: System.Collections.Generic.IEnumerable<Rational>
An array of possible values for the new variable. The caller must not modify the array after passing it to this function.
Return Value
Type: System.Boolean
true if a new variable is added; false if an existing variable has the specified key.
Implements
ITermModel.AddVariable(Object, Int32%, IEnumerable<Rational>)
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.