MatrixMath Type

Class MatrixMath provides common static methods for matrix manipulation and arithmetic in tow dimensions. Class MatrixMath provides common static methods for matrix manipulation and arithmetic in tow dimensions.

Static members

Static member Description

MatrixMath.Add(a, b, c)

Full Usage: MatrixMath.Add(a, b, c)

Parameters:
    a : IROMatrix<float> - First matrix to add..
    b : IROMatrix<float> - Second operand..
    c : IMatrix<float> - The resultant matrix a+b. Has to be of same dimension as a and b.

Calculates a+b and stores the result in matrix c.

a : IROMatrix<float>

First matrix to add..

b : IROMatrix<float>

Second operand..

c : IMatrix<float>

The resultant matrix a+b. Has to be of same dimension as a and b.

MatrixMath.AddRow(a, b, c)

Full Usage: MatrixMath.AddRow(a, b, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IReadOnlyList<float> - The vector to add.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to vector b).

Add the vector b to all rows of matrix a.

a : IROMatrix<float>

The source matrix.

b : IReadOnlyList<float>

The vector to add.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to vector b).

MatrixMath.AddRow(a, b, brow, c)

Full Usage: MatrixMath.AddRow(a, b, brow, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IROMatrix<float> - The matrix which contains the row to add.
    brow : int - The row number of matrix b.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to matrix b).

Add the row rowb of matrix b to all rows of matrix a.

a : IROMatrix<float>

The source matrix.

b : IROMatrix<float>

The matrix which contains the row to add.

brow : int

The row number of matrix b.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to matrix b).

MatrixMath.Any(a, predicate)

Full Usage: MatrixMath.Any(a, predicate)

Parameters:
    a : IROMatrix<float> - The matrix.
    predicate : Func<int, int, float, bool> - The predicate to fulfill. 1st argument is the row number, 2nd arg is the column number, 3rd arg is the element value at row and column. The return value is the predicate.

Returns: bool True if any element of the provided matrix a fulfills the given predicate; otherwise false.

Determines whether any element of the provided matrix a fulfills the given predicate.

a : IROMatrix<float>

The matrix.

predicate : Func<int, int, float, bool>

The predicate to fulfill. 1st argument is the row number, 2nd arg is the column number, 3rd arg is the element value at row and column. The return value is the predicate.

Returns: bool

True if any element of the provided matrix a fulfills the given predicate; otherwise false.

MatrixMath.Clear(matrix)

Full Usage: MatrixMath.Clear(matrix)

Parameters:

matrix : IMatrix<'T>

MatrixMath.Clear_DefaultImpl(matrix)

Full Usage: MatrixMath.Clear_DefaultImpl(matrix)

Parameters:

matrix : IMatrix<'T>

MatrixMath.ColumnToROVector(x, column)

Full Usage: MatrixMath.ColumnToROVector(x, column)

Parameters:
    x : IROMatrix<'T> - The matrix.
    column : int - The column number of the matrix that is wrapped to a vector.

Returns: IROVector<'T>

Returns a read-only vector representing a matrix column by providing the matrix and the row number of that matrix that is wrapped.

x : IROMatrix<'T>

The matrix.

column : int

The column number of the matrix that is wrapped to a vector.

Returns: IROVector<'T>

MatrixMath.ColumnToVector(x, column)

Full Usage: MatrixMath.ColumnToVector(x, column)

Parameters:
    x : IMatrix<'T> - The matrix.
    column : int - The column number of the matrix that is wrapped to a vector.

Returns: IVector<'T>

Returns a vector representing a matrix column by providing the matrix and the row number of that matrix that is wrapped.

x : IMatrix<'T>

The matrix.

column : int

The column number of the matrix that is wrapped to a vector.

Returns: IVector<'T>

MatrixMath.ColumnsToZeroMean(a, mean)

Full Usage: MatrixMath.ColumnsToZeroMean(a, mean)

Parameters:
    a : IMatrix<float> - The matrix where the columns should be centered.
    mean : IVector<float> - You can provide a matrix of dimension(1,a.Cols) where the mean row vector is stored, or null if not interested in this vector.

This will center the matrix so that the mean of each column is null.

Calling this function will change the matrix a to a column centered matrix. The original matrix data are lost.

a : IMatrix<float>

The matrix where the columns should be centered.

mean : IVector<float>

You can provide a matrix of dimension(1,a.Cols) where the mean row vector is stored, or null if not interested in this vector.

MatrixMath.ColumnsToZeroMeanAndUnitVariance(a, meanvec, scalevec)

Full Usage: MatrixMath.ColumnsToZeroMeanAndUnitVariance(a, meanvec, scalevec)

Parameters:
    a : IMatrix<float> - The matrix where the columns should be centered and normalized to standard variance.
    meanvec : IVector<float> - You can provide a vector of length(a.Cols) where the mean row vector is stored, or null if not interested in this vector.
    scalevec : IVector<float> - You can provide a vector of length(a.Cols) where the inverse of the variance of the columns is stored, or null if not interested in this vector.

This will center the matrix so that the mean of each column is null, and the variance of each column is one.

Calling this function will change the matrix a to a column centered matrix. The original matrix data are lost.

a : IMatrix<float>

The matrix where the columns should be centered and normalized to standard variance.

meanvec : IVector<float>

You can provide a vector of length(a.Cols) where the mean row vector is stored, or null if not interested in this vector.

scalevec : IVector<float>

You can provide a vector of length(a.Cols) where the inverse of the variance of the columns is stored, or null if not interested in this vector.

MatrixMath.Copy(src, dest)

Full Usage: MatrixMath.Copy(src, dest)

Parameters:
    src : IROMatrix<float> - The source matrix to copy.
    dest : IMatrix<float> - The destination matrix to copy to.

Copies matrix src to matrix dest. Both matrizes must have the same dimensions.

src : IROMatrix<float>

The source matrix to copy.

dest : IMatrix<float>

The destination matrix to copy to.

MatrixMath.Copy(src, dest, destrow, destcol)

Full Usage: MatrixMath.Copy(src, dest, destrow, destcol)

Parameters:
    src : IROMatrix<float> - The source matrix.
    dest : IMatrix<float> - The destination matrix. Must have equal or higher dim than the source matrix.
    destrow : int - The vertical origin of copy operation in the destination matrix.
    destcol : int - The horizontal origin of copy operation in the destination matrix.

Copies the matrix src into the matrix dest. Matrix dest must have equal or greater dimension than src. You can provide a destination row/column into the destination matrix where the origin of the copy operation is located.

src : IROMatrix<float>

The source matrix.

dest : IMatrix<float>

The destination matrix. Must have equal or higher dim than the source matrix.

destrow : int

The vertical origin of copy operation in the destination matrix.

destcol : int

The horizontal origin of copy operation in the destination matrix.

MatrixMath.CopyColumn(sourceMatrix, columnNumber, destinationVector)

Full Usage: MatrixMath.CopyColumn(sourceMatrix, columnNumber, destinationVector)

Parameters:
    sourceMatrix : IROMatrix<float> - Matrix to copy from
    columnNumber : int - Number of column of the matrix to be copied.
    destinationVector : float[] - Vector to copy the column data to.

Gets the column of a matrix copied into a vector.

sourceMatrix : IROMatrix<float>

Matrix to copy from

columnNumber : int

Number of column of the matrix to be copied.

destinationVector : float[]

Vector to copy the column data to.

MatrixMath.CopyColumn(sourceMatrix, columnNumber, destinationVector)

Full Usage: MatrixMath.CopyColumn(sourceMatrix, columnNumber, destinationVector)

Parameters:
    sourceMatrix : IROMatrix<float> - Matrix to copy from
    columnNumber : int - Number of column of the matrix to be copied.
    destinationVector : IVector<float> - Vector to copy the column data to.

Gets the column of a matrix copied into a vector.

sourceMatrix : IROMatrix<float>

Matrix to copy from

columnNumber : int

Number of column of the matrix to be copied.

destinationVector : IVector<float>

Vector to copy the column data to.

MatrixMath.DivideRow(a, b, brow, resultIfNull, c)

Full Usage: MatrixMath.DivideRow(a, b, brow, resultIfNull, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IROMatrix<float> - The matrix which contains the denominator row.
    brow : int - The row number of matrix b which serves as denominator.
    resultIfNull : float - If the denominator is null, the result is set to this number.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to matrix b).

Divides all rows of matrix a by the row rowb of matrix b (element by element).

a : IROMatrix<float>

The source matrix.

b : IROMatrix<float>

The matrix which contains the denominator row.

brow : int

The row number of matrix b which serves as denominator.

resultIfNull : float

If the denominator is null, the result is set to this number.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to matrix b).

MatrixMath.EnumerateElementsIndexed(matrix, ?zeros)

Full Usage: MatrixMath.EnumerateElementsIndexed(matrix, ?zeros)

Parameters:
Returns: IEnumerable<int * int * 'T>

matrix : IROMatrix<'T>
?zeros : Zeros
Returns: IEnumerable<int * int * 'T>

MatrixMath.GetMatrixArray(n, m)

Full Usage: MatrixMath.GetMatrixArray(n, m)

Parameters:
    n : int - First matrix dimension.
    m : int - Second matrix dimension.

Returns: float[][] Array of dimensions n x m.

Allocates an array of n x m values.

n : int

First matrix dimension.

m : int

Second matrix dimension.

Returns: float[][]

Array of dimensions n x m.

MatrixMath.GetSingularValueDecomposition(input, output)

Full Usage: MatrixMath.GetSingularValueDecomposition(input, output)

Parameters:
    input : IROMatrix<float> - The input matrix (is preserved).
    output : IMatrix<float> - The resulting matrix. Has to be of same dimensions as the input matrix.

Returns: SingularValueDecomposition

Returns the singular value decomposition for this matrix.

input : IROMatrix<float>

The input matrix (is preserved).

output : IMatrix<float>

The resulting matrix. Has to be of same dimensions as the input matrix.

Returns: SingularValueDecomposition

MatrixMath.GetSingularValueDecomposition(inout)

Full Usage: MatrixMath.GetSingularValueDecomposition(inout)

Parameters:
    inout : IMatrix<float> - The input matrix, on return the resulting decomposed matrix.

Returns: SingularValueDecomposition

Returns the singular value decomposition for this matrix.

inout : IMatrix<float>

The input matrix, on return the resulting decomposed matrix.

Returns: SingularValueDecomposition

MatrixMath.Hypotenuse(a, b)

Full Usage: MatrixMath.Hypotenuse(a, b)

Parameters:
    a : float - First parameter.
    b : float - Second parameter.

Returns: float The square root of (a^2+b^2).

Calculates the hypotenuse length of a and b, i.e. the sqrt(a^2+b^2), avoiding overflow at large values.

a : float

First parameter.

b : float

Second parameter.

Returns: float

The square root of (a^2+b^2).

MatrixMath.InvertDiagonalMatrix(a)

Full Usage: MatrixMath.InvertDiagonalMatrix(a)

Parameters:
    a : IMatrix<float> - The matrix to invert. After calling the matrix is inverted, i.e. the diagonal elements are replaced by their inverses, and the outer diagonal elements are set to zero.

This inverts the provided diagonal matrix. There is no check that the matrix is really diagonal, but the algorithm sets the elements outside the diagonal to zero, assuming that this are small arithmetic errors.

a : IMatrix<float>

The matrix to invert. After calling the matrix is inverted, i.e. the diagonal elements are replaced by their inverses, and the outer diagonal elements are set to zero.

MatrixMath.IsEqual(a, b, accuracy)

Full Usage: MatrixMath.IsEqual(a, b, accuracy)

Parameters:
    a : IROMatrix<float> - The first matrix.
    b : IROMatrix<float> - The second matrix. Basis for calculation of threshold.
    accuracy : float - The accuracy.

Returns: bool

Compares matrix a and matrix b. Takes the norm of matrix b times accuracy as threshold basis for comparing the elements.

a : IROMatrix<float>

The first matrix.

b : IROMatrix<float>

The second matrix. Basis for calculation of threshold.

accuracy : float

The accuracy.

Returns: bool

MatrixMath.IsZeroMatrix(a)

Full Usage: MatrixMath.IsZeroMatrix(a)

Parameters:
Returns: bool True if all elements are zero or if one of the two dimensions of the matrix is zero. False if the matrix contains nonzero elements.

Tests if all elements of the matrix a are equal to zero.

a : IROMatrix<float>

The matrix to test.

Returns: bool

True if all elements are zero or if one of the two dimensions of the matrix is zero. False if the matrix contains nonzero elements.

MatrixMath.LengthOf(a)

Full Usage: MatrixMath.LengthOf(a)

Parameters:
Returns: float The square root of the sum of the squares of the matrix a.

Returns the square root of the sum of the squares of the matrix a.

a : IROMatrix<float>

The matrix.

Returns: float

The square root of the sum of the squares of the matrix a.

MatrixMath.Map(src1, function, result)

Full Usage: MatrixMath.Map(src1, function, result)

Parameters:
    src1 : IROMatrix<float> - Matrix to use the values from.
    function : Func<float, float> - Function to be applied to each element of the matrix. The argument is the element of the source matrix.
    result : IMatrix<float> - Matrix to store the result. This may be the same instance as the source matrix.

Elementwise application of a function to each element of a matrix. The result is stored in another matrix or in the same matrix.

src1 : IROMatrix<float>

Matrix to use the values from.

function : Func<float, float>

Function to be applied to each element of the matrix. The argument is the element of the source matrix.

result : IMatrix<float>

Matrix to store the result. This may be the same instance as the source matrix.

MatrixMath.Map(src1, src2, function, result)

Full Usage: MatrixMath.Map(src1, src2, function, result)

Parameters:
    src1 : IROMatrix<float> - First matrix to use the values from.
    src2 : IROMatrix<float> - Second matrix to use the values from.
    function : Func<float, float, float> - Function to be applied to each element of src1 and src2.
    result : IMatrix<float> - Matrix to store the result. This may be the same instance as one of the matrices src1 or src2.

Elementwise application of a function to each element of two matrices. The result is stored in another matrix or in the same matrix.

src1 : IROMatrix<float>

First matrix to use the values from.

src2 : IROMatrix<float>

Second matrix to use the values from.

function : Func<float, float, float>

Function to be applied to each element of src1 and src2.

result : IMatrix<float>

Matrix to store the result. This may be the same instance as one of the matrices src1 or src2.

MatrixMath.MapIndexed(src1, parameter1, function, result, ?zeros)

Full Usage: MatrixMath.MapIndexed(src1, parameter1, function, result, ?zeros)

Parameters:

src1 : IROMatrix<'T>
parameter1 : 'T1
function : Func<int, int, 'T, 'T1, 'T>
result : IMatrix<'T>
?zeros : Zeros

MatrixMath.MapIndexed(src1, function, result)

Full Usage: MatrixMath.MapIndexed(src1, function, result)

Parameters:
    src1 : IROMatrix<float> - Matrix to use the values from.
    function : Func<int, int, float, float> - Function to be applied to each element of the matrix. 1st argument is the row number, 2nd argument the column number, 3rd argument the element of the src matrix,.
    result : IMatrix<float> - Matrix to store the result. This may be the same instance as the source matrix.

Elementwise application of a function to each element of a matrix. The result is stored in another matrix or in the same matrix.

src1 : IROMatrix<float>

Matrix to use the values from.

function : Func<int, int, float, float>

Function to be applied to each element of the matrix. 1st argument is the row number, 2nd argument the column number, 3rd argument the element of the src matrix,.

result : IMatrix<float>

Matrix to store the result. This may be the same instance as the source matrix.

MatrixMath.MapIndexed(src1, src2, function, result)

Full Usage: MatrixMath.MapIndexed(src1, src2, function, result)

Parameters:
    src1 : IROMatrix<float> - First matrix to use the values from.
    src2 : IROMatrix<float> - Second matrix to use the values from.
    function : Func<int, int, float, float, float> - Function to be applied to each element of src1 and src2. 1st argument is the row number, 2nd argument is the column number, 3rd argument is the element of matrix src1, 4th argument is the element of matrix src2.
    result : IMatrix<float> - Matrix to store the result. This may be the same instance as one of the matrices src1 or src2.

Elementwise application of a function to each element of two matrices. The result is stored in another matrix or in the same matrix.

src1 : IROMatrix<float>

First matrix to use the values from.

src2 : IROMatrix<float>

Second matrix to use the values from.

function : Func<int, int, float, float, float>

Function to be applied to each element of src1 and src2. 1st argument is the row number, 2nd argument is the column number, 3rd argument is the element of matrix src1, 4th argument is the element of matrix src2.

result : IMatrix<float>

Matrix to store the result. This may be the same instance as one of the matrices src1 or src2.

MatrixMath.MapIndexed(src1, parameter1, function, result)

Full Usage: MatrixMath.MapIndexed(src1, parameter1, function, result)

Parameters:
    src1 : IROMatrix<float> - Matrix to use the values from.
    parameter1 : 'T1 - An auxillary parameter.
    function : Func<int, int, float, 'T1, float> - Function to be applied to each element of the matrix. 1st argument is the row number, 2nd argument the column number, 3rd argument the element of the src matrix, 4th argument the auxillary parameter1.
    result : IMatrix<float> - Matrix to store the result. This may be the same instance as the source matrix.

Elementwise application of a function to each element of a matrix. The result is stored in another matrix or in the same matrix.

src1 : IROMatrix<float>

Matrix to use the values from.

parameter1 : 'T1

An auxillary parameter.

function : Func<int, int, float, 'T1, float>

Function to be applied to each element of the matrix. 1st argument is the row number, 2nd argument the column number, 3rd argument the element of the src matrix, 4th argument the auxillary parameter1.

result : IMatrix<float>

Matrix to store the result. This may be the same instance as the source matrix.

MatrixMath.MatrixToString(name, a)

Full Usage: MatrixMath.MatrixToString(name, a)

Parameters:
Returns: string

name : string
a : IROMatrix<'T>
Returns: string

MatrixMath.MatrixToString(name, a)

Full Usage: MatrixMath.MatrixToString(name, a)

Parameters:
Returns: string

name : string
a : IROMatrix<float32>
Returns: string

MatrixMath.MatrixToString(name, a)

Full Usage: MatrixMath.MatrixToString(name, a)

Parameters:
Returns: string

name : string
a : IROComplexDoubleMatrix
Returns: string

MatrixMath.MatrixToString(name, a)

Full Usage: MatrixMath.MatrixToString(name, a)

Parameters:
Returns: string

name : string
a : IROComplexFloatMatrix
Returns: string

MatrixMath.Max(a)

Full Usage: MatrixMath.Max(a)

Parameters:
Returns: float Maximum value of all elements of the specified matrix a.

Get the maximum value of all elements of the specified matrix a.

a : IROMatrix<float>

The matrix.

Returns: float

Maximum value of all elements of the specified matrix a.

MatrixMath.Min(a)

Full Usage: MatrixMath.Min(a)

Parameters:
Returns: float Minimum value of all elements of the specified matrix a.

Get the minimum value of all elements of the specified matrix a.

a : IROMatrix<float>

The matrix.

Returns: float

Minimum value of all elements of the specified matrix a.

MatrixMath.Multiply(a, b, c)

Full Usage: MatrixMath.Multiply(a, b, c)

Parameters:
    a : IROMatrix<float> - First multiplicant.
    b : IROMatrix<float> - Second multiplicant.
    c : IMatrix<float> - The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

Multiplies matrix a with matrix b and stores the result in matrix c.

a : IROMatrix<float>

First multiplicant.

b : IROMatrix<float>

Second multiplicant.

c : IMatrix<float>

The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

MatrixMath.Multiply(a, b, c)

Full Usage: MatrixMath.Multiply(a, b, c)

Parameters:
    a : IROMatrix<float> - First multiplicant.
    b : IReadOnlyList<float> - Second multiplicant. The vector must have the length of a.Columns.
    c : IVector<float> - The vector where to store the result. Has to be of dimension (a.Rows).

Multiplies matrix a with vector b and stores the result in vector c.

a : IROMatrix<float>

First multiplicant.

b : IReadOnlyList<float>

Second multiplicant. The vector must have the length of a.Columns.

c : IVector<float>

The vector where to store the result. Has to be of dimension (a.Rows).

MatrixMath.MultiplyFirstTransposed(a, b, c)

Full Usage: MatrixMath.MultiplyFirstTransposed(a, b, c)

Parameters:
    a : IROMatrix<float> - First multiplicant.
    b : IROMatrix<float> - Second multiplicant.
    c : IMatrix<float> - The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

Multiplies matrix a_transposed with matrix b and stores the result in matrix c.

a : IROMatrix<float>

First multiplicant.

b : IROMatrix<float>

Second multiplicant.

c : IMatrix<float>

The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

MatrixMath.MultiplyFirstTransposed(a, b, c)

Full Usage: MatrixMath.MultiplyFirstTransposed(a, b, c)

Parameters:
    a : IROMatrix<float> - First multiplicant.
    b : IReadOnlyList<float> - Second multiplicant.
    c : IVector<float> - The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

Multiplies matrix a_transposed with vector b and stores the result in vector c.

a : IROMatrix<float>

First multiplicant.

b : IReadOnlyList<float>

Second multiplicant.

c : IVector<float>

The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

MatrixMath.MultiplyRow(a, b, brow, c)

Full Usage: MatrixMath.MultiplyRow(a, b, brow, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IROMatrix<float> - The matrix which contains the row to multiply.
    brow : int - The row number of matrix b.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to matrix b).

Multiplies the row rowb of matrix b element by element to all rows of matrix a.

a : IROMatrix<float>

The source matrix.

b : IROMatrix<float>

The matrix which contains the row to multiply.

brow : int

The row number of matrix b.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to matrix b).

MatrixMath.MultiplyRow(a, b, c)

Full Usage: MatrixMath.MultiplyRow(a, b, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IReadOnlyList<float> - The vector which contains the row to multiply.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to matrix b).

Multiplies the row rowb of matrix b element by element to all rows of matrix a.

a : IROMatrix<float>

The source matrix.

b : IReadOnlyList<float>

The vector which contains the row to multiply.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to matrix b).

MatrixMath.MultiplyScalar(a, b, c)

Full Usage: MatrixMath.MultiplyScalar(a, b, c)

Parameters:
    a : IROMatrix<float> - The first multiplicant.
    b : float - The second multiplicant.
    c : IMatrix<float> - The resulting matrix.

Multiplies the matrix a with a scalar value b and stores the result in c. Matrix a and c are allowed to be the same matrix.

a : IROMatrix<float>

The first multiplicant.

b : float

The second multiplicant.

c : IMatrix<float>

The resulting matrix.

MatrixMath.MultiplySecondTransposed(a, b, c)

Full Usage: MatrixMath.MultiplySecondTransposed(a, b, c)

Parameters:
    a : IROMatrix<float> - First multiplicant.
    b : IROMatrix<float> - Second multiplicant.
    c : IMatrix<float> - The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

Multiplies matrix a with matrix b_transposed and stores the result in matrix c.

a : IROMatrix<float>

First multiplicant.

b : IROMatrix<float>

Second multiplicant.

c : IMatrix<float>

The matrix where to store the result. Has to be of dimension (a.Rows, b.Columns).

MatrixMath.MultiplyVectorFromLeftAndRight(a, b)

Full Usage: MatrixMath.MultiplyVectorFromLeftAndRight(a, b)

Parameters:
    a : IROMatrix<float> - Matrix. Must be a square matrix with both number of rows and columns the same as the vector length.
    b : IReadOnlyList<float> - Vector. The vector must have the length as the rows and columns of the matrix.

Returns: float

Multiplies matrix a with vector b from left and right: b* A b.

a : IROMatrix<float>

Matrix. Must be a square matrix with both number of rows and columns the same as the vector length.

b : IReadOnlyList<float>

Vector. The vector must have the length as the rows and columns of the matrix.

Returns: float

MatrixMath.NIPALS_HO(X, numFactors, accuracy, factors, loads, residualVarianceVector)

Full Usage: MatrixMath.NIPALS_HO(X, numFactors, accuracy, factors, loads, residualVarianceVector)

Parameters:
    X : IMatrix<float> - The matrix to which the decomposition is applied to. A row of the matrix is one spectrum (or a single measurement giving multiple resulting values). The different rows of the matrix represent measurements under different conditions.
    numFactors : int - The number of factors to be calculated. If 0 is provided, factors are calculated until the provided accuracy is reached.
    accuracy : float - The relative residual variance that should be reached.
    factors : IRightExtensibleMatrix<float> - Resulting matrix of factors. You have to provide a extensible matrix of dimension(0,0) as the vertical score vectors are appended to the matrix.
    loads : IBottomExtensibleMatrix<float> - Resulting matrix consiting of horizontal load vectors (eigenspectra). You have to provide a extensible matrix of dimension(0,0) here.
    residualVarianceVector : IBottomExtensibleMatrix<float> - Residual variance. Element[0] is the original variance, element[1] the residual variance after the first factor subtracted and so on. You can provide null if you don't need this result.

Calculates eigenvectors (loads) and the corresponding eigenvalues (scores) by means of the NIPALS algorithm

X : IMatrix<float>

The matrix to which the decomposition is applied to. A row of the matrix is one spectrum (or a single measurement giving multiple resulting values). The different rows of the matrix represent measurements under different conditions.

numFactors : int

The number of factors to be calculated. If 0 is provided, factors are calculated until the provided accuracy is reached.

accuracy : float

The relative residual variance that should be reached.

factors : IRightExtensibleMatrix<float>

Resulting matrix of factors. You have to provide a extensible matrix of dimension(0,0) as the vertical score vectors are appended to the matrix.

loads : IBottomExtensibleMatrix<float>

Resulting matrix consiting of horizontal load vectors (eigenspectra). You have to provide a extensible matrix of dimension(0,0) here.

residualVarianceVector : IBottomExtensibleMatrix<float>

Residual variance. Element[0] is the original variance, element[1] the residual variance after the first factor subtracted and so on. You can provide null if you don't need this result.

MatrixMath.Norm(a, ntype)

Full Usage: MatrixMath.Norm(a, ntype)

Parameters:
Returns: float

a : IROMatrix<float>
ntype : MatrixNorm
Returns: float

MatrixMath.NormalizeCols(a)

Full Usage: MatrixMath.NormalizeCols(a)

Parameters:
    a : IMatrix<float> - The matrix which should be column normalized.

Normalizes each column (each vertical vector) of the matrix. After normalization, each column has the norm 1, i.e. the sum of squares of the elements of each column is 1 (one).

a : IMatrix<float>

The matrix which should be column normalized.

MatrixMath.NormalizeOneColumn(a, col)

Full Usage: MatrixMath.NormalizeOneColumn(a, col)

Parameters:
    a : IMatrix<float> - The matrix for which the column col is normalized.
    col : int - The number of the column which should be normalized.

Returns: float Square root of the sum of squares of the column, i.e. the original length of the column vector before normalization.

Normalizes the column col of a matrix to unit length.

a : IMatrix<float>

The matrix for which the column col is normalized.

col : int

The number of the column which should be normalized.

Returns: float

Square root of the sum of squares of the column, i.e. the original length of the column vector before normalization.

MatrixMath.NormalizeRows(a)

Full Usage: MatrixMath.NormalizeRows(a)

Parameters:
    a : IMatrix<float> - The matrix which should be row normalized.

Normalizes each row (each horizontal vector) of the matrix. After normalization, each row has the norm 1, i.e. the sum of squares of the elements of each row is 1 (one).

a : IMatrix<float>

The matrix which should be row normalized.

MatrixMath.PseudoInverse(input)

Full Usage: MatrixMath.PseudoInverse(input)

Parameters:
Returns: IMatrix<float> The pseudo inverse of matrix input.

Calculates the pseudo inverse of the matrix input by means of singular value decomposition. A relative value of 100*DBL_EPSILON is used to chop the singular values before calculation.

input : IROMatrix<float>

Input matrix

Returns: IMatrix<float>

The pseudo inverse of matrix input.

MatrixMath.PseudoInverse(input, rank)

Full Usage: MatrixMath.PseudoInverse(input, rank)

Parameters:
    input : IROMatrix<float> - Input matrix
    rank : byref<int> - Returns the rank of the input matrix.

Returns: IMatrix<float> The pseudo inverse of matrix input.

Calculates the pseudo inverse of the matrix input by means of singular value decomposition. A relative value of 100*DBL_EPSILON is used to chop the singular values before calculation.

input : IROMatrix<float>

Input matrix

rank : byref<int>

Returns the rank of the input matrix.

Returns: IMatrix<float>

The pseudo inverse of matrix input.

MatrixMath.ReplaceNaNAndInfiniteElementsWith(m, replacementValue)

Full Usage: MatrixMath.ReplaceNaNAndInfiniteElementsWith(m, replacementValue)

Parameters:
    m : IMatrix<float> - The matrix to modify.
    replacementValue : float - The replacement value. This value is assigned to any matrix element that has the value NaN (Not a Number) or that is infinite.

Replaces all matrix elements that are NaN (Not a Number) or infinite with the value of replacementValue.

m : IMatrix<float>

The matrix to modify.

replacementValue : float

The replacement value. This value is assigned to any matrix element that has the value NaN (Not a Number) or that is infinite.

MatrixMath.ReplaceNaNElementsWith(m, replacementValue)

Full Usage: MatrixMath.ReplaceNaNElementsWith(m, replacementValue)

Parameters:
    m : IMatrix<float> - The matrix to modify.
    replacementValue : float - The replacement value. This value is assigned to any matrix element that has the value NaN (Not a Number).

Replaces all matrix elements that are NaN (not a number) with the value of replacementValue.

m : IMatrix<float>

The matrix to modify.

replacementValue : float

The replacement value. This value is assigned to any matrix element that has the value NaN (Not a Number).

MatrixMath.RowToROVector(x, row)

Full Usage: MatrixMath.RowToROVector(x, row)

Parameters:
    x : IROMatrix<'T> - The matrix.
    row : int - The row number of the matrix that is wrapped to a vector.

Returns: IROVector<'T>

Returns a vector representing a matrix row by providing the matrix and the row number of that matrix that is wrapped.

x : IROMatrix<'T>

The matrix.

row : int

The row number of the matrix that is wrapped to a vector.

Returns: IROVector<'T>

MatrixMath.RowToROVector(x, row, columnoffset, length)

Full Usage: MatrixMath.RowToROVector(x, row, columnoffset, length)

Parameters:
    x : IROMatrix<'T> - The matrix.
    row : int - The row number of the matrix that is wrapped to a vector.
    columnoffset : int - The column of the matrix that corresponds to the first element of the vector.
    length : int - The length of the resulting vector.

Returns: IROVector<'T>

Returns a vector representing a matrix row by providing the matrix and the row number of that matrix that is wrapped.

x : IROMatrix<'T>

The matrix.

row : int

The row number of the matrix that is wrapped to a vector.

columnoffset : int

The column of the matrix that corresponds to the first element of the vector.

length : int

The length of the resulting vector.

Returns: IROVector<'T>

MatrixMath.RowToVector(x, row)

Full Usage: MatrixMath.RowToVector(x, row)

Parameters:
    x : IMatrix<'T> - The matrix.
    row : int - The row number of the matrix that is wrapped to a vector.

Returns: IVector<'T>

Returns a vector representing a matrix row by providing the matrix and the row number of that matrix that is wrapped.

x : IMatrix<'T>

The matrix.

row : int

The row number of the matrix that is wrapped to a vector.

Returns: IVector<'T>

MatrixMath.RowToVector(x, row, columnoffset, length)

Full Usage: MatrixMath.RowToVector(x, row, columnoffset, length)

Parameters:
    x : IMatrix<'T> - The matrix.
    row : int - The row number of the matrix that is wrapped to a vector.
    columnoffset : int - The column of the matrix that corresponds to the first element of the vector.
    length : int - The length of the resulting vector.

Returns: IVector<'T>

Returns a vector representing a matrix row by providing the matrix and the row number of that matrix that is wrapped.

x : IMatrix<'T>

The matrix.

row : int

The row number of the matrix that is wrapped to a vector.

columnoffset : int

The column of the matrix that corresponds to the first element of the vector.

length : int

The length of the resulting vector.

Returns: IVector<'T>

MatrixMath.SetColumn(src, srccol, dest, destcol)

Full Usage: MatrixMath.SetColumn(src, srccol, dest, destcol)

Parameters:
    src : IROMatrix<float> - The source matrix. Must be a vertical vector (cols=1) with the same number of rows than the destination matrix.
    srccol : int - The column in the source matrix to copy from.
    dest : IMatrix<float> - The destination matrix where to copy the vertical vector into.
    destcol : int - The column in the destination matrix where to copy the vector to.

Sets one column in the destination matrix equal to the vertical vector provided by src matix.

src : IROMatrix<float>

The source matrix. Must be a vertical vector (cols=1) with the same number of rows than the destination matrix.

srccol : int

The column in the source matrix to copy from.

dest : IMatrix<float>

The destination matrix where to copy the vertical vector into.

destcol : int

The column in the destination matrix where to copy the vector to.

MatrixMath.SetColumn(src, dest, col)

Full Usage: MatrixMath.SetColumn(src, dest, col)

Parameters:
    src : IROMatrix<float> - The source matrix. Must be a vertical vector (cols=1) with the same number of rows than the destination matrix.
    dest : IMatrix<float> - The destination matrix where to copy the vertical vector into.
    col : int - The column in the destination matrix where to copy the vector to.

Sets one column in the destination matrix equal to the vertical vector provided by src matix.

src : IROMatrix<float>

The source matrix. Must be a vertical vector (cols=1) with the same number of rows than the destination matrix.

dest : IMatrix<float>

The destination matrix where to copy the vertical vector into.

col : int

The column in the destination matrix where to copy the vector to.

MatrixMath.SetColumn(src, dest, destColumn)

Full Usage: MatrixMath.SetColumn(src, dest, destColumn)

Parameters:
    src : IReadOnlyList<float> - The source vector. Must be of same length as the number of columns of the destination matrix.
    dest : IMatrix<float> - The destination matrix where to copy the horizontal vector into.
    destColumn : int - The row in the destination matrix where to copy the vector to.

Sets one row in the destination matrix equal to the vector provided by src.

src : IReadOnlyList<float>

The source vector. Must be of same length as the number of columns of the destination matrix.

dest : IMatrix<float>

The destination matrix where to copy the horizontal vector into.

destColumn : int

The row in the destination matrix where to copy the vector to.

MatrixMath.SetMatrixElements(a, scalar)

Full Usage: MatrixMath.SetMatrixElements(a, scalar)

Parameters:
    a : IMatrix<float> - The matrix where to set the elements.
    scalar : float - The value which is used to set each element with.

Set all matrix elements to the provided value scalar.

a : IMatrix<float>

The matrix where to set the elements.

scalar : float

The value which is used to set each element with.

MatrixMath.SetMatrixElements(a, Setter)

Full Usage: MatrixMath.SetMatrixElements(a, Setter)

Parameters:
    a : IMatrix<float> - The matrix for which to set the elements.
    Setter : Func<int, int, float> - The setter function. First arg is the row index, 2nd arg the column index. The return value is used to set the matrix element.

Sets the matrix elements to the value provided by a setter function Setter.

a : IMatrix<float>

The matrix for which to set the elements.

Setter : Func<int, int, float>

The setter function. First arg is the row index, 2nd arg the column index. The return value is used to set the matrix element.

MatrixMath.SetRow(src, srcRow, dest, destRow)

Full Usage: MatrixMath.SetRow(src, srcRow, dest, destRow)

Parameters:
    src : IROMatrix<float> - The source matrix. Must be a horizontal vector (rows=1) with the same number of columns than the destination matrix.
    srcRow : int - The row in the source matrix where to copy from.
    dest : IMatrix<float> - The destination matrix where to copy the horizontal vector into.
    destRow : int - The row in the destination matrix where to copy the vector to.

Sets one row in the destination matrix equal to the horizontal vector provided by src matix.

src : IROMatrix<float>

The source matrix. Must be a horizontal vector (rows=1) with the same number of columns than the destination matrix.

srcRow : int

The row in the source matrix where to copy from.

dest : IMatrix<float>

The destination matrix where to copy the horizontal vector into.

destRow : int

The row in the destination matrix where to copy the vector to.

MatrixMath.SetRow(src, dest, destRow)

Full Usage: MatrixMath.SetRow(src, dest, destRow)

Parameters:
    src : IReadOnlyList<float> - The source vector. Must be of same length as the number of columns of the destination matrix.
    dest : IMatrix<float> - The destination matrix where to copy the horizontal vector into.
    destRow : int - The row in the destination matrix where to copy the vector to.

Sets one row in the destination matrix equal to the vector provided by src.

src : IReadOnlyList<float>

The source vector. Must be of same length as the number of columns of the destination matrix.

dest : IMatrix<float>

The destination matrix where to copy the horizontal vector into.

destRow : int

The row in the destination matrix where to copy the vector to.

MatrixMath.Square(x)

Full Usage: MatrixMath.Square(x)

Parameters:
    x : float - The value.

Returns: float x*x.

Calculates the Square of the value x.

x : float

The value.

Returns: float

x*x.

MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Full Usage: MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Parameters:
    a : IROMatrix<float> - The original matrix.
    selectedRows : bool[] - Selected rows. The rows of the submatrix consist of all rows of the original matrix where selectedRows[row] is true.
    selectedColumns : bool[] - Selected columns. The columns of the submatrix consist of all columns of the original matrix where selectedColumns[col] is true.
    MatrixGenerator : Func<int, int, '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.

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

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

a : IROMatrix<float>

The original matrix.

selectedRows : bool[]

Selected rows. The rows of the submatrix consist of all rows of the original matrix where selectedRows[row] is true.

selectedColumns : bool[]

Selected columns. The columns of the submatrix consist of all columns of the original matrix where selectedColumns[col] is true.

MatrixGenerator : Func<int, int, '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.

Returns: 'T

The submatrix containing selected elements of the original matrix a.

MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Full Usage: MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Parameters:
    a : IROMatrix<float> - The original matrix.
    selectedRows : int[] - Selected rows. The rows of the submatrix consist of all rows of the original matrix whose index is contained in selectedRows.
    selectedColumns : int[] - Selected columns. The columns of the submatrix consist of all columns of the original matrix whose index is contained in selectedColumns.
    MatrixGenerator : Func<int, int, '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.

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

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

a : IROMatrix<float>

The original matrix.

selectedRows : int[]

Selected rows. The rows of the submatrix consist of all rows of the original matrix whose index is contained in selectedRows.

selectedColumns : int[]

Selected columns. The columns of the submatrix consist of all columns of the original matrix whose index is contained in selectedColumns.

MatrixGenerator : Func<int, int, '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.

Returns: 'T

The submatrix containing selected elements of the original matrix a.

MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Full Usage: MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Parameters:
    a : IROMatrix<float> - The original matrix.
    selectedRows : int[] - Selected rows. The rows of the submatrix consist of all rows whose index is contained in selectedRows.
    selectedColumns : bool[] - Selected columns. The columns of the submatrix consist of all columns of the original matrix where selectedColumns[col] is true.
    MatrixGenerator : Func<int, int, '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.

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

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

a : IROMatrix<float>

The original matrix.

selectedRows : int[]

Selected rows. The rows of the submatrix consist of all rows whose index is contained in selectedRows.

selectedColumns : bool[]

Selected columns. The columns of the submatrix consist of all columns of the original matrix where selectedColumns[col] is true.

MatrixGenerator : Func<int, int, '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.

Returns: 'T

The submatrix containing selected elements of the original matrix a.

MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Full Usage: MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)

Parameters:
    a : IROMatrix<float> - The original matrix.
    selectedRows : bool[] - Selected rows. The rows of the submatrix consist of all rows of the original matrix where selectedRows[row] is true.
    selectedColumns : int[] - Selected columns. The columns of the submatrix consist of all columns of the original matrix whose index is contained in selectedColumns.
    MatrixGenerator : Func<int, int, '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.

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

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

a : IROMatrix<float>

The original matrix.

selectedRows : bool[]

Selected rows. The rows of the submatrix consist of all rows of the original matrix where selectedRows[row] is true.

selectedColumns : int[]

Selected columns. The columns of the submatrix consist of all columns of the original matrix whose index is contained in selectedColumns.

MatrixGenerator : Func<int, int, '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.

Returns: 'T

The submatrix containing selected elements of the original matrix a.

MatrixMath.SubMatrix(a, selectedRows, selectedColumn, MatrixGenerator)

Full Usage: MatrixMath.SubMatrix(a, selectedRows, selectedColumn, MatrixGenerator)

Parameters:
    a : IROMatrix<float> - The original matrix.
    selectedRows : bool[] - Selected rows. The rows of the submatrix consist of all rows of the original matrix where selectedRows[row] is true.
    selectedColumn : int - Selected column. The submatrix consists of one column, whose values originate from the original matrix selectedColumn.
    MatrixGenerator : Func<int, int, '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.

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

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

a : IROMatrix<float>

The original matrix.

selectedRows : bool[]

Selected rows. The rows of the submatrix consist of all rows of the original matrix where selectedRows[row] is true.

selectedColumn : int

Selected column. The submatrix consists of one column, whose values originate from the original matrix selectedColumn.

MatrixGenerator : Func<int, int, '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.

Returns: 'T

The submatrix containing selected elements of the original matrix a.

MatrixMath.SubMatrix(a, selectedRow, selectedColumns, MatrixGenerator)

Full Usage: MatrixMath.SubMatrix(a, selectedRow, selectedColumns, MatrixGenerator)

Parameters:
    a : IROMatrix<float> - The original matrix.
    selectedRow : int - Selected row. The submatrix consists of one row, whose values originate from the original matrix selectedRow.
    selectedColumns : bool[] - Selected columns. The columns of the submatrix consist of all columns of the original matrix where selectedColumns[col] is true.
    MatrixGenerator : Func<int, int, '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.

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

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

a : IROMatrix<float>

The original matrix.

selectedRow : int

Selected row. The submatrix consists of one row, whose values originate from the original matrix selectedRow.

selectedColumns : bool[]

Selected columns. The columns of the submatrix consist of all columns of the original matrix where selectedColumns[col] is true.

MatrixGenerator : Func<int, int, '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.

Returns: 'T

The submatrix containing selected elements of the original matrix a.

MatrixMath.Submatrix(src, dest, rowoffset, coloffset)

Full Usage: MatrixMath.Submatrix(src, dest, rowoffset, coloffset)

Parameters:
    src : IROMatrix<float> - The source matrix.
    dest : IMatrix<float> - The destination matrix where to store the submatrix. It's dimensions are the dimensions of the submatrix.
    rowoffset : int - The row offset = vertical origin of the submatrix in the source matrix.
    coloffset : int - The column offset = horizontal origin of the submatrix in the source matrix.

Gets a submatrix out of the source matrix a. The dimensions of the submatrix are given by the provided matrix dest.

src : IROMatrix<float>

The source matrix.

dest : IMatrix<float>

The destination matrix where to store the submatrix. It's dimensions are the dimensions of the submatrix.

rowoffset : int

The row offset = vertical origin of the submatrix in the source matrix.

coloffset : int

The column offset = horizontal origin of the submatrix in the source matrix.

MatrixMath.Submatrix(src, dest)

Full Usage: MatrixMath.Submatrix(src, dest)

Parameters:
    src : IROMatrix<float> - The source matrix.
    dest : IMatrix<float> - The destination matrix where to store the submatrix. It's dimensions are the dimensions of the submatrix.

Gets a submatrix out of the source matrix a. The dimensions of the submatrix are given by the provided matrix dest. The origin of the submatrix in the source matrix is (0,0), i.e. the left upper corner.

src : IROMatrix<float>

The source matrix.

dest : IMatrix<float>

The destination matrix where to store the submatrix. It's dimensions are the dimensions of the submatrix.

MatrixMath.Subtract(a, b, c)

Full Usage: MatrixMath.Subtract(a, b, c)

Parameters:
    a : IROMatrix<float> - Minuend.
    b : IROMatrix<float> - Subtrahend.
    c : IMatrix<float> - The resultant matrix a-b. Has to be of same dimension as a and b.

Calculates a-b and stores the result in matrix c.

a : IROMatrix<float>

Minuend.

b : IROMatrix<float>

Subtrahend.

c : IMatrix<float>

The resultant matrix a-b. Has to be of same dimension as a and b.

MatrixMath.SubtractColumn(a, b, bcol, c)

Full Usage: MatrixMath.SubtractColumn(a, b, bcol, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IROMatrix<float> - The matrix which contains the row to subtract.
    bcol : int - The column number of matrix b.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to matrix b).

Subtracts the column bcol of matrix b from all columns of matrix a.

a : IROMatrix<float>

The source matrix.

b : IROMatrix<float>

The matrix which contains the row to subtract.

bcol : int

The column number of matrix b.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to matrix b).

MatrixMath.SubtractProductFromSelf(a, b, c)

Full Usage: MatrixMath.SubtractProductFromSelf(a, b, c)

Parameters:
    a : IROMatrix<float> - First multiplicant.
    b : IROMatrix<float> - Second multiplicant.
    c : IMatrix<float> - The matrix where to subtract the result of the multipication from. Has to be of dimension (a.Rows, b.Columns).

Calculates c = c - ab

a : IROMatrix<float>

First multiplicant.

b : IROMatrix<float>

Second multiplicant.

c : IMatrix<float>

The matrix where to subtract the result of the multipication from. Has to be of dimension (a.Rows, b.Columns).

MatrixMath.SubtractProductFromSelf(a, b, c)

Full Usage: MatrixMath.SubtractProductFromSelf(a, b, c)

Parameters:
    a : IROMatrix<float> - First multiplicant.
    b : float - Second multiplicant.
    c : IMatrix<float> - The matrix where to subtract the result of the multipication from. Has to be of dimension (a.Rows, b.Columns).

Calculates c = c - ab

a : IROMatrix<float>

First multiplicant.

b : float

Second multiplicant.

c : IMatrix<float>

The matrix where to subtract the result of the multipication from. Has to be of dimension (a.Rows, b.Columns).

MatrixMath.SubtractRow(a, b, brow, c)

Full Usage: MatrixMath.SubtractRow(a, b, brow, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IROMatrix<float> - The matrix which contains the row to subtract.
    brow : int - The row number of matrix b.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to matrix b).

Subtracts the row rowb of matrix b from all rows of matrix a.

a : IROMatrix<float>

The source matrix.

b : IROMatrix<float>

The matrix which contains the row to subtract.

brow : int

The row number of matrix b.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to matrix b).

MatrixMath.SubtractRow(a, b, c)

Full Usage: MatrixMath.SubtractRow(a, b, c)

Parameters:
    a : IROMatrix<float> - The source matrix.
    b : IReadOnlyList<float> - The vector which contains the row to subtract.
    c : IMatrix<float> - The destination matrix. Can be equivalent to matrix a (but not to matrix b).

Subtracts the row rowb of matrix b from all rows of matrix a.

a : IROMatrix<float>

The source matrix.

b : IReadOnlyList<float>

The vector which contains the row to subtract.

c : IMatrix<float>

The destination matrix. Can be equivalent to matrix a (but not to matrix b).

MatrixMath.SumOfSquaredDifferences(a, b)

Full Usage: MatrixMath.SumOfSquaredDifferences(a, b)

Parameters:
    a : IROMatrix<float> - The first matrix.
    b : IROMatrix<float> - The second matrix. Must have same dimensions than a.

Returns: float The sum of the squared differences of each element in a to the corresponding element in b, i.e. Sum[(a[i,j]-b[i,j])²].

Returns the sum of the squares of differences of elements of a and b.

a : IROMatrix<float>

The first matrix.

b : IROMatrix<float>

The second matrix. Must have same dimensions than a.

Returns: float

The sum of the squared differences of each element in a to the corresponding element in b, i.e. Sum[(a[i,j]-b[i,j])²].

MatrixMath.SumOfSquares(a)

Full Usage: MatrixMath.SumOfSquares(a)

Parameters:
Returns: float The sum of the squares of all elements in the matrix a.

Returns the sum of the squares of all elements.

a : IROMatrix<float>

The matrix.

Returns: float

The sum of the squares of all elements in the matrix a.

MatrixMath.ToMatrix(wrapper)

Full Usage: MatrixMath.ToMatrix(wrapper)

Parameters:
Returns: IBottomExtensibleMatrix<'T>

wrapper : MatrixWrapperStructForLeftSpineJaggedArray<'T>
Returns: IBottomExtensibleMatrix<'T>

MatrixMath.ToMatrix(wrapper)

Full Usage: MatrixMath.ToMatrix(wrapper)

Parameters:
Returns: IRightExtensibleMatrix<'T>

Constructs an RE matrix from an array of double vectors. Attention! The double vectors (the second) dimensions are here the columns (!) of the matrix. The data is not copied.

wrapper : MatrixWrapperStructForTopSpineJaggedArray<'T>

Wrapper around a top spine jagged array matrix.

Returns: IRightExtensibleMatrix<'T>

MatrixMath.ToMatrix(wrapper)

Full Usage: MatrixMath.ToMatrix(wrapper)

Parameters:
Returns: IROMatrix<'T> The read-only matrix wrappage of the linear array.

Wraps a linear array (column major order) into a read-write matrix. The array is packed in column major order, i.e. the first elements belong to the first column of the matrix.

wrapper : MatrixWrapperStructForColumnMajorOrderLinearArray<'T>

Wrapper around a linear array in column major order, which provides number of rows and columns.

Returns: IROMatrix<'T>

The read-only matrix wrappage of the linear array.

MatrixMath.ToMatrix(array)

Full Usage: MatrixMath.ToMatrix(array)

Parameters:
    array : 'T[,]

Returns: IMatrix<'T>

array : 'T[,]
Returns: IMatrix<'T>

MatrixMath.ToMatrixFromColumnMajorLinearArray(x, nRows)

Full Usage: MatrixMath.ToMatrixFromColumnMajorLinearArray(x, nRows)

Parameters:
    x : 'T[] - Linear array. The length has to be a multiple of nRows.
    nRows : int - Number of rows of the resulting matrix.

Returns: IMatrix<'T> The read-only matrix wrappage of the linear array.

Wraps a linear array into a read-write matrix. The array is packed column-wise, i.e. the first elements belong to the first column of the matrix.

x : 'T[]

Linear array. The length has to be a multiple of nRows.

nRows : int

Number of rows of the resulting matrix.

Returns: IMatrix<'T>

The read-only matrix wrappage of the linear array.

MatrixMath.ToMatrixFromLeftSpineJaggedArray(x)

Full Usage: MatrixMath.ToMatrixFromLeftSpineJaggedArray(x)

Parameters:
    x : 'T[][] - The jagged array. Each double[] vector is a row of the matrix.

Returns: IBottomExtensibleMatrix<'T>

This wraps a jagged double array to the IMatrix interface. The data is not copied!

x : 'T[][]

The jagged array. Each double[] vector is a row of the matrix.

Returns: IBottomExtensibleMatrix<'T>

MatrixMath.ToMatrixFromTopSpineJaggedArray(x)

Full Usage: MatrixMath.ToMatrixFromTopSpineJaggedArray(x)

Parameters:
    x : 'T[][] - Array of columns (!) of the matrix.

Returns: IRightExtensibleMatrix<'T>

Constructs an RE matrix from an array of double vectors. Attention! The double vectors (the second) dimensions are here the columns (!) of the matrix. The data is not copied.

x : 'T[][]

Array of columns (!) of the matrix.

Returns: IRightExtensibleMatrix<'T>

MatrixMath.ToRODiagonalMatrix(vector, vectoroffset, matrixdimensions)

Full Usage: MatrixMath.ToRODiagonalMatrix(vector, vectoroffset, matrixdimensions)

Parameters:
    vector : IReadOnlyList<'T> - The vector to wrap.
    vectoroffset : int - The index of the vector that is the first matrix element(0,0).
    matrixdimensions : int - The number of rows = number of columns of the diagonal matrix.

Returns: IROMatrix<'T>

Wraps a read-only vector to a read-only diagonal matrix.

vector : IReadOnlyList<'T>

The vector to wrap.

vectoroffset : int

The index of the vector that is the first matrix element(0,0).

matrixdimensions : int

The number of rows = number of columns of the diagonal matrix.

Returns: IROMatrix<'T>

MatrixMath.ToROMatrix(wrapper)

Full Usage: MatrixMath.ToROMatrix(wrapper)

Parameters:
Returns: IROMatrix<'T> The read-only matrix wrappage of the linear array.

Wraps a linear array (column major order) into a read-only matrix. The array is packed in column major order, i.e. the first elements belong to the first column of the matrix.

wrapper : MatrixWrapperStructForColumnMajorOrderLinearArray<'T>

Wrapper around a linear array in column major order, which provides number of rows and columns.

Returns: IROMatrix<'T>

The read-only matrix wrappage of the linear array.

MatrixMath.ToROMatrix(array)

Full Usage: MatrixMath.ToROMatrix(array)

Parameters:
    array : 'T[,]

Returns: IROMatrix<'T>

array : 'T[,]
Returns: IROMatrix<'T>

MatrixMath.ToROMatrixFromColumnMajorLinearArray(arrayInColumMajorOrder, rows)

Full Usage: MatrixMath.ToROMatrixFromColumnMajorLinearArray(arrayInColumMajorOrder, rows)

Parameters:
    arrayInColumMajorOrder : 'T[] - Linear array in column major order. The length has to be a multiple of nRows.
    rows : int - Number of rows of the resulting matrix.

Returns: IROMatrix<'T> The read-only matrix wrappage of the linear array.

Wraps a linear array (column major order) into a read-only matrix. The array is packed in column major order, i.e. the first elements belong to the first column of the matrix.

arrayInColumMajorOrder : 'T[]

Linear array in column major order. The length has to be a multiple of nRows.

rows : int

Number of rows of the resulting matrix.

Returns: IROMatrix<'T>

The read-only matrix wrappage of the linear array.

MatrixMath.ToROMatrixFromLeftSpineJaggedArray(x)

Full Usage: MatrixMath.ToROMatrixFromLeftSpineJaggedArray(x)

Parameters:
    x : 'T[][] - The jagged array. Each double[] vector is a row of the matrix.

Returns: IBottomExtensibleMatrix<'T>

This wraps a jagged double array to the IROMatrix interface. The data is not copied!

x : 'T[][]

The jagged array. Each double[] vector is a row of the matrix.

Returns: IBottomExtensibleMatrix<'T>

MatrixMath.ToROMatrixFromTopSpineJaggedArray(x)

Full Usage: MatrixMath.ToROMatrixFromTopSpineJaggedArray(x)

Parameters:
    x : 'T[][] - Array of columns (!) of the matrix.

Returns: IRightExtensibleMatrix<'T>

Constructs an RE matrix from an array of double vectors. Attention! The double vectors (the second) dimensions are here the columns (!) of the matrix. The data is not copied.

x : 'T[][]

Array of columns (!) of the matrix.

Returns: IRightExtensibleMatrix<'T>

MatrixMath.ToROSubMatrix(matrix, rowOffset, columnOffset, rows, columns)

Full Usage: MatrixMath.ToROSubMatrix(matrix, rowOffset, columnOffset, rows, columns)

Parameters:
    matrix : IROMatrix<'T> - The matrix from which a submatrix part should be wrapped.
    rowOffset : int - Starting row of the submatrix.
    columnOffset : int - Starting column of the submatrix.
    rows : int - Number of rows of the submatrix.
    columns : int - Number of columns of the submatrix.

Returns: IROMatrix<'T> A read-only wrapper matrix that represents the submatrix part of the matrix.

Wraps a submatrix part, so that this part can be used as a matrix in operations (read-only).

matrix : IROMatrix<'T>

The matrix from which a submatrix part should be wrapped.

rowOffset : int

Starting row of the submatrix.

columnOffset : int

Starting column of the submatrix.

rows : int

Number of rows of the submatrix.

columns : int

Number of columns of the submatrix.

Returns: IROMatrix<'T>

A read-only wrapper matrix that represents the submatrix part of the matrix.

MatrixMath.ToSubMatrix(matrix, rowoffset, columnoffset, rows, columns)

Full Usage: MatrixMath.ToSubMatrix(matrix, rowoffset, columnoffset, rows, columns)

Parameters:
    matrix : IMatrix<'T> - The matrix from which a submatrix part should be wrapped.
    rowoffset : int - Starting row of the submatrix.
    columnoffset : int - Starting column of the submatrix.
    rows : int - Number of rows of the submatrix.
    columns : int - Number of columns of the submatrix.

Returns: IMatrix<'T> A wrapper matrix that represents the submatrix part of the matrix.

Wraps a submatrix part, so that this part can be used as a matrix in operations.

matrix : IMatrix<'T>

The matrix from which a submatrix part should be wrapped.

rowoffset : int

Starting row of the submatrix.

columnoffset : int

Starting column of the submatrix.

rows : int

Number of rows of the submatrix.

columns : int

Number of columns of the submatrix.

Returns: IMatrix<'T>

A wrapper matrix that represents the submatrix part of the matrix.

MatrixMath.ToZeroMean(a, mean)

Full Usage: MatrixMath.ToZeroMean(a, mean)

Parameters:
    a : IMatrix<float> - The matrix.
    mean : byref<float> - The calculated mean value of the original matrix.

Calculates the mean value of all matrix elements and then subtracts the mean value from each matrix element, so that the mean value of the resulting matrix is zero.

a : IMatrix<float>

The matrix.

mean : byref<float>

The calculated mean value of the original matrix.

MatrixMath.ToZeroMean(a)

Full Usage: MatrixMath.ToZeroMean(a)

Parameters:

Calculates the mean value of all matrix elements and then subtracts the mean value from each matrix element, so that the mean value of the resulting matrix is zero.

a : IMatrix<float>

The matrix.

MatrixMath.Trace(a)

Full Usage: MatrixMath.Trace(a)

Parameters:
Returns: float Trace of square matrix a, i.e. the sum of diagonal elements.

Get the trace of square matrix a, i.e. the sum of diagonal elements.

a : IROMatrix<float>

The matrix.

Returns: float

Trace of square matrix a, i.e. the sum of diagonal elements.

MatrixMath.ZeroMatrix(a)

Full Usage: MatrixMath.ZeroMatrix(a)

Parameters:
    a : IMatrix<float> - The matrix to zero.

Set all elements in the matrix to 0 (zero)

a : IMatrix<float>

The matrix to zero.