Matrix.Wrap Diagonal Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.5.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.5.0
Overload List
| Wrap | Creates a new DiagonalMatrix<T> that wraps the specified diagonal values. |
| Wrap | 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.
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
| Argument | diagonal is null. |
WrapDiagonal<T>(Vector<T>, Int32, Int32)
Creates a new diagonal matrix that wraps the specified diagonal values.
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
| Argument | values is null. |