Sparse Vector<T> Constructor
Constructs a new sparse vector with the specified components.
Definition
Namespace: Numerics.NET.LinearAlgebra
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
C#
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
public SparseVector(
int length,
int[] indexes,
T[] values,
bool verifyIndexes,
ArrayAttributes attributes
)
Parameters
- length Int32
- The length of the new vector.
- indexes Int32[]
- An integer array containing the zero-based indexes of the nonzero components.
- values T[]
- A Double array containing the corresponding values.
- verifyIndexes Boolean
- Indicates whether the values in indexes should be validated.
- attributes ArrayAttributes
- The array attributes of the new vector.
Remarks
If an index occurs more than once in indexes, the actual value is the sum of the corresponding values.
Exceptions
Argument | length is less than zero. |
Argument | indexes is null. -or- values is null. |
Dimension | The length of values is not equal to the length of indexes. |
Argument | One or more elements of indexes is less than zero or greater than or equal to length. |