Class ArrayHelper
Helpful methods used by generated code.
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Quality(QualityBand.Stable)]
public class ArrayHelper
Methods
CopyStorage<T>(T)
Copies the storage of the passed in argument, without caring about its value.
Declaration
public static T CopyStorage<T>(T result)
where T : ICloneable
Parameters
Type |
Name |
Description |
T |
result |
|
Returns
Type Parameters
Fill<T>(T[], T)
Fill an array with copies of an object.
Declaration
public static T[] Fill<T>(T[] array, T margprot)
where T : ICloneable
Parameters
Type |
Name |
Description |
T[] |
array |
The array to modify.
|
T |
margprot |
The object to copy into each element
|
Returns
Type |
Description |
T[] |
The modified array
|
Type Parameters
Fill2D<T>(T[,], T)
Fill a 2D array with copies of an object.
Declaration
public static T[, ] Fill2D<T>(T[, ] array, T margprot)
where T : ICloneable
Parameters
Type |
Name |
Description |
T[,] |
array |
The array to modify
|
T |
margprot |
The object to copy into each element
|
Returns
Type |
Description |
T[,] |
The modified array
|
Type Parameters
MakeCopy<T>(T)
Make a deep copy of an object.
Declaration
public static T MakeCopy<T>(T obj)
where T : ICloneable
Parameters
Type |
Name |
Description |
T |
obj |
|
Returns
Type Parameters
Create a clone of obj with uniform value.
Declaration
public static T MakeUniform<T>(T obj)
where T : ICloneable, SettableToUniform
Parameters
Type |
Name |
Description |
T |
obj |
|
Returns
Type Parameters
SetAllElementsTo<T>(T[], T)
Set all elements of an array to the same value.
Declaration
public static T[] SetAllElementsTo<T>(T[] result, T item)
Parameters
Type |
Name |
Description |
T[] |
result |
The array to modify
|
T |
item |
The desired value
|
Returns
Type |
Description |
T[] |
The modified array
|
Type Parameters
SetAllElementsTo<T, T2>(T, T2)
Set all elements of an array to the same value.
Declaration
public static T SetAllElementsTo<T, T2>(T result, T2 item)
where T : CanSetAllElementsTo<T2>
Parameters
Type |
Name |
Description |
T |
result |
The array to modify
|
T2 |
item |
The desired value
|
Returns
Type |
Description |
T |
The modified array
|
Type Parameters
SetTo<T>(T, T)
Call result.SetTo(value) and return result.
Declaration
public static T SetTo<T>(T result, T value)
where T : SettableTo<T>
Parameters
Type |
Name |
Description |
T |
result |
The object to modify
|
T |
value |
The desired value
|
Returns
Type |
Description |
T |
The modified object
|
Type Parameters
SetTo<T>(T[], T[])
Call result.SetTo(value) and return result.
Declaration
public static T[] SetTo<T>(T[] result, T[] values)
where T : SettableTo<T>
Parameters
Type |
Name |
Description |
T[] |
result |
The array to modify
|
T[] |
values |
The desired values
|
Returns
Type |
Description |
T[] |
The modified array
|
Type Parameters
SetToProductWith<T>(T, T)
Declaration
public static T SetToProductWith<T>(T result, T value)
where T : SettableToProduct<T>
Parameters
Type |
Name |
Description |
T |
result |
|
T |
value |
|
Returns
Type Parameters
Call obj.SetToUniform() and return the object.
Declaration
public static T SetToUniform<T>(T obj)
where T : SettableToUniform
Parameters
Type |
Name |
Description |
T |
obj |
|
Returns
Type Parameters