Click or drag to resize

CreateMatrixSparseDiagonalT(Int32, Int32, FuncInt32, T) Method

Create a new diagonal sparse matrix and initialize each diagonal value using the provided init function.

Namespace: Altaxo.Calc.LinearAlgebra
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3572.0 (4.8.3572.0)
Syntax
C#
public static Matrix<T> SparseDiagonal<T>(
	int rows,
	int columns,
	Func<int, T> init
)
where T : struct, new(), IEquatable<T>, IFormattable

Parameters

rows  Int32
The number of rows.
columns  Int32
The number of columns.
init  FuncInt32, T
The function to initialize each diagonal element.

Type Parameters

T
The element type of the matrix to create.

Return Value

MatrixT
A new diagonal sparse matrix.
See Also