SparseVector<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#
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

ArgumentOutOfRangeException

length is less than zero.

ArgumentNullException

indexes is null.

-or-

values is null.

DimensionMismatchException

The length of values is not equal to the length of indexes.

ArgumentException

One or more elements of indexes is less than zero or greater than or equal to length.

See Also