Class VariableArray2D<TItem, TArray>
Two-dimensional jagged variable array.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Models
Assembly: Microsoft.ML.Probabilistic.Compiler.dll
Syntax
public class VariableArray2D<TItem, TArray> : VariableArrayBase<TItem, TArray>, CanGetContainers, IModelExpression<TArray>, SettableTo<Variable<TArray>>, ICloneable, HasItemVariables, IVariableJaggedArray, SettableTo<VariableArray2D<TItem, TArray>>, IVariableArray, IVariable, IModelExpression, HasObservedValue where TItem : Variable, ICloneable, SettableTo<TItem>
Type Parameters
Name | Description |
---|---|
TItem | |
TArray |
Constructors
VariableArray2D(VariableArray2D<TItem, TArray>)
Copy constructor.
Declaration
protected VariableArray2D(VariableArray2D<TItem, TArray> that)
Parameters
Type | Name | Description |
---|---|---|
VariableArray2D<TItem, TArray> | that |
Properties
Item[Range, Range]
Get or set elements of the array.
Declaration
public TItem this[Range range0, Range range1] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Range | range0 | The first range used to create the array. |
Range | range1 | The second range used to create the array. |
Property Value
Type | Description |
---|---|
TItem | A derived variable that indexes |
Remarks
When setting the elements of an array, the right hand side must be a fresh variable with no other uses. The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
Item[Range, Variable<Int32>]
Get or set elements of the array.
Declaration
public TItem this[Range index0, Variable<int> index1] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Range | index0 | The first range used to create the array. |
Variable<Int32> | index1 | The second index. |
Property Value
Type | Description |
---|---|
TItem | A derived variable that indexes |
Remarks
When setting the elements of an array, the right hand side must be a fresh variable with no other uses. The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
Item[Variable<Int32>, Range]
Get or set elements of the array.
Declaration
public TItem this[Variable<int> index0, Range index1] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Variable<Int32> | index0 | The first index. |
Range | index1 | The second range used to create the array. |
Property Value
Type | Description |
---|---|
TItem | A derived variable that indexes |
Remarks
When setting the elements of an array, the right hand side must be a fresh variable with no other uses. The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
Item[Variable<Int32>, Variable<Int32>]
Get or set elements of the array.
Declaration
public TItem this[Variable<int> index0, Variable<int> index1] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Variable<Int32> | index0 | The first index. |
Variable<Int32> | index1 | The second index. |
Property Value
Type | Description |
---|---|
TItem | A derived variable that indexes |
Remarks
When setting the elements of an array, the right hand side must be a fresh variable with no other uses. The right-hand side must be an item variable indexed by exactly the ranges of the array, but possibly in a different order.
Range0
Range for first index
Declaration
public Range Range0 { get; }
Property Value
Type | Description |
---|---|
Range |
Range1
Range for second index
Declaration
public Range Range1 { get; }
Property Value
Type | Description |
---|---|
Range |
Methods
Attrib(ICompilerAttribute)
Inline method for adding an attribute to a random variable. This method returns the random variable object, so that is can be used in an inline expression. e.g. Variable.GaussianFromMeanAndVariance(0,1).Attrib(new MyAttribute());
Declaration
public VariableArray2D<TItem, TArray> Attrib(ICompilerAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
ICompilerAttribute | attr | The attribute to add |
Returns
Type | Description |
---|---|
VariableArray2D<TItem, TArray> | The random variable object |
Attrib(QueryType)
Helper to add a query type attribute to this variable.
Declaration
public VariableArray2D<TItem, TArray> Attrib(QueryType queryType)
Parameters
Type | Name | Description |
---|---|---|
QueryType | queryType | The query type to use to create the attribute |
Returns
Type | Description |
---|---|
VariableArray2D<TItem, TArray> |
Clone()
Clone the 2-D jagged array
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
Object |
Overrides
Named(String)
Inline method to name the array.
Declaration
public VariableArray2D<TItem, TArray> Named(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name |
Returns
Type | Description |
---|---|
VariableArray2D<TItem, TArray> |
|
SetTo(VariableArray2D<TItem, TArray>)
Set the 2-D jagged array to a specified value
Declaration
public void SetTo(VariableArray2D<TItem, TArray> that)
Parameters
Type | Name | Description |
---|---|---|
VariableArray2D<TItem, TArray> | that |
Explicit Interface Implementations
IVariableArray.ReplaceRanges(Dictionary<Range, Range>, Dictionary<IModelExpression, IModelExpression>, Boolean)
Declaration
IVariableArray IVariableArray.ReplaceRanges(Dictionary<Range, Range> rangeReplacements, Dictionary<IModelExpression, IModelExpression> expressionReplacements, bool deepCopy)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<Range, Range> | rangeReplacements | |
Dictionary<IModelExpression, IModelExpression> | expressionReplacements | |
Boolean | deepCopy |
Returns
Type | Description |
---|---|
IVariableArray |