Constructs a new sparse vector of the specified length.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static SparseVector<T> CreateSparseUnitVector<T>(
int length,
int position,
ArrayMutability mutability = ArrayMutability.Immutable
)
Public Shared Function CreateSparseUnitVector(Of T) (
length As Integer,
position As Integer,
Optional mutability As ArrayMutability = ArrayMutability.Immutable
) As SparseVector(Of T)
public:
generic<typename T>
static SparseVector<T>^ CreateSparseUnitVector(
int length,
int position,
ArrayMutability mutability = ArrayMutability::Immutable
)
static member CreateSparseUnitVector :
length : int *
position : int *
?mutability : ArrayMutability
(* Defaults:
let _mutability = defaultArg mutability ArrayMutability.Immutable
*)
-> SparseVector<'T>
Parameters
- length
- Type: SystemInt32
The length of the SparseVectorT. - position
- Type: SystemInt32
The position of the non-zero element of the unit vector. - mutability (Optional)
- Type: Extreme.MathematicsArrayMutability
Specifies how the vector's values may be changed.
The default is mutable values.
Type Parameters
- T
Return Value
Type:
SparseVectorTA
SparseVectorT.
Exception | Condition |
---|
ArgumentOutOfRangeException | length is less than zero. -or- position is less than zero
or greater than or equal to length. |
Reference