LinearModel.AddVariable Method

Returns a value that indicates whether a user variable is added to the model.

Namespace:  Microsoft.SolverFoundation.Services
Assembly:  Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)

Syntax

'Declaration
Public Overridable Function AddVariable ( _
    key As Object, _
    <OutAttribute> ByRef vid As Integer _
) As Boolean
public virtual bool AddVariable(
    Object key,
    out int vid
)
public:
virtual bool AddVariable(
    Object^ key, 
    [OutAttribute] int% vid
)
abstract AddVariable : 
        key:Object * 
        vid:int byref -> bool 
override AddVariable : 
        key:Object * 
        vid:int byref -> bool 
public function AddVariable(
    key : Object, 
    vid : int
) : boolean

Parameters

Return Value

Type: System.Boolean
true if the user variable is added to the model successfully; false if the model already includes a user variable referenced by key or the model already includes a user variable referenced by key.

Implements

ILinearModel.AddVariable(Object, Int32%)

Remarks

The following table shows the value of vid depending on the key.

key in the model

Value of vid

Model already includes a user variabile referenced by key.

vid is set to the variable's index.

Model already includes a user variable referenced by key.

vid is set to -1.

A new row associated with the key is added to the model.

vid is set to the new row index.

.NET Framework Security

See Also

Reference

LinearModel Class

LinearModel Members

Microsoft.SolverFoundation.Services Namespace