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> CreateSparse<T>(
int length,
int capacity
)
Public Shared Function CreateSparse(Of T) (
length As Integer,
capacity As Integer
) As SparseVector(Of T)
public:
generic<typename T>
static SparseVector<T>^ CreateSparse(
int length,
int capacity
)
static member CreateSparse :
length : int *
capacity : int -> SparseVector<'T>
Parameters
- length
- Type: SystemInt32
The length of the SparseVectorT. - capacity
- Type: SystemInt32
An integer specifying the expected number
of nonzero elements of the vector.
Type Parameters
- T
Return Value
Type:
SparseVectorTA
SparseVectorT.
The effective capacity is never greater than
length
even if
capacity is larger.
Reference