Matrix.WrapDiagonal Method

Definition

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

Overload List

WrapDiagonal<T>(Vector<T>) Creates a new DiagonalMatrix<T> that wraps the specified diagonal values.
WrapDiagonal<T>(Vector<T>, Int32, Int32) Creates a new diagonal matrix that wraps the specified diagonal values.

WrapDiagonal<T>(Vector<T>)

Creates a new DiagonalMatrix<T> that wraps the specified diagonal values.
C#
public static DiagonalMatrix<T> WrapDiagonal<T>(
	Vector<T> diagonal
)

Parameters

diagonal  Vector<T>
A vector containing the diagonal values.

Type Parameters

T
The element type of the matrix.

Return Value

DiagonalMatrix<T>
A new DiagonalMatrix<T> that shares storage with diagonal.

Exceptions

ArgumentNullExceptiondiagonal is null.

WrapDiagonal<T>(Vector<T>, Int32, Int32)

Creates a new diagonal matrix that wraps the specified diagonal values.
C#
public static DiagonalMatrix<T> WrapDiagonal<T>(
	Vector<T> values,
	int rowCount,
	int columnCount
)

Parameters

values  Vector<T>
A vector containing the diagonal elements of the matrix.
rowCount  Int32
The number of rows.
columnCount  Int32
The number of columns.

Type Parameters

T

Return Value

DiagonalMatrix<T>
A diagonal matrix.

Remarks

The returned matrix shares storage with values. The matrix may be rectangular; the length of values supplies the stored diagonal.

Exceptions

ArgumentNullException

values is null.

See Also