Click or drag to resize

MatrixMathSubMatrixT(IROMatrixDouble, Int32, Boolean, FuncInt32, Int32, T) Method

Gets a new submatrix, i.e. a matrix containing selected elements of the original matrix a.

Namespace: Altaxo.Calc.LinearAlgebra
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static T SubMatrix<T>(
	this IROMatrix<double> a,
	int selectedRow,
	bool[] selectedColumns,
	Func<int, int, T> MatrixGenerator
)
where T : Object, IMatrix<double>

Parameters

a  IROMatrixDouble
The original matrix.
selectedRow  Int32
Selected row. The submatrix consists of one row, whose values originate from the original matrix selectedRow.
selectedColumns  Boolean
Selected columns. The columns of the submatrix consist of all columns of the original matrix where selectedColumns[col] is true.
MatrixGenerator  FuncInt32, Int32, T
Function to generate the returned matrix. 1st arg is the number of rows, 2nd arg the number of columns. The function have to generate a new matrix with the given number of rows and columns.

Type Parameters

T
Type of matrix to return.

Return Value

T
The submatrix containing selected elements of the original matrix a.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IROMatrixDouble. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also