Matrix.CreateSparseSymmetric Method

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.0

Overload List

CreateSparseSymmetric<T>(Int32) Constructs a new symmetric sparse matrix.
CreateSparseSymmetric<T>(Int32, Double) Constructs a new symmetric sparse matrix.
CreateSparseSymmetric<T>(Int32, Int32) Constructs a new symmetric sparse matrix.
CreateSparseSymmetric<T>(Int32, Int32[], Int32[], T[]) Constructs a new sparse matrix.

CreateSparseSymmetric<T>(Int32)

Constructs a new symmetric sparse matrix.
C#
public static SparseCompressedColumnMatrix<T> CreateSparseSymmetric<T>(
	int dimension
)

Parameters

dimension  Int32
The number of rows and columns.

Type Parameters

T

Return Value

SparseCompressedColumnMatrix<T>
A SparseCompressedColumnMatrix<T>.

Exceptions

ArgumentOutOfRangeException

dimension is less than zero.

CreateSparseSymmetric<T>(Int32, Double)

Constructs a new symmetric sparse matrix.
C#
public static SparseCompressedColumnMatrix<T> CreateSparseSymmetric<T>(
	int dimension,
	double fillFactor
)

Parameters

dimension  Int32
The number of rows and columns.
fillFactor  Double
A value between 0 and 1 that specifies the initial capacity of nonzero elements as a proportion of the total number of elements of the matrix.

Type Parameters

T

Return Value

SparseCompressedColumnMatrix<T>
A SparseCompressedColumnMatrix<T>.

Exceptions

ArgumentOutOfRangeException

dimension is less than zero.

-or-

fillFactor is less than or equal to zero or greater than 1.

CreateSparseSymmetric<T>(Int32, Int32)

Constructs a new symmetric sparse matrix.
C#
public static SparseCompressedColumnMatrix<T> CreateSparseSymmetric<T>(
	int dimension,
	int nonzeroCount
)

Parameters

dimension  Int32
The number of rows and columns.
nonzeroCount  Int32
The expected number of nonzero elements.

Type Parameters

T

Return Value

SparseCompressedColumnMatrix<T>
A SparseCompressedColumnMatrix<T>.

Exceptions

ArgumentOutOfRangeException

dimension is less than zero.

-or-

nonzeroCount is less than zero.

CreateSparseSymmetric<T>(Int32, Int32[], Int32[], T[])

Constructs a new sparse matrix.
C#
public static SparseCompressedColumnMatrix<T> CreateSparseSymmetric<T>(
	int rowCount,
	int[] rowIndexes,
	int[] columnIndexes,
	T[] values
)

Parameters

rowCount  Int32
The number of rows and columns.
rowIndexes  Int32[]
An integer array that contains the row indexes of the nonzero elements.
columnIndexes  Int32[]
An integer array that contains the column indexes of the nonzero elements.
values  T[]
An array that contains the values of the nonzero elements.

Type Parameters

T

Return Value

SparseCompressedColumnMatrix<T>
A SparseCompressedColumnMatrix<T>.

Remarks

Only the elements on or above the diagonal should be included.

Exceptions

ArgumentOutOfRangeException

rowCount is less than zero.

ArgumentNullException

values is null.

-or-

rowIndexes is null.

-or-

columnIndexes is null.

DimensionMismatchException

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

-or-

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

See Also