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 member | Description |
|
Calculates a+b and stores the result in matrix c. |
Full Usage:
MatrixMath.AddRow(a, b, c)
Parameters:
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
|
Full Usage:
MatrixMath.AddRow(a, b, brow, c)
Parameters:
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 |
Full Usage:
MatrixMath.Any(a, predicate)
Parameters:
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.
|
|
|
|
|
|
Returns a read-only vector representing a matrix column by providing the matrix and the row number of that matrix that is wrapped.
|
|
Returns a vector representing a matrix column by providing the matrix and the row number of that matrix that is wrapped.
|
|
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. |
Full Usage:
MatrixMath.ColumnsToZeroMeanAndUnitVariance(a, meanvec, scalevec)
Parameters:
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.
|
|
Copies matrix src to matrix dest. Both matrizes must have the same dimensions. |
Full Usage:
MatrixMath.Copy(src, dest, destrow, destcol)
Parameters:
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.
|
Full Usage:
MatrixMath.CopyColumn(sourceMatrix, columnNumber, destinationVector)
Parameters:
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.
|
Gets the column of a matrix copied into a vector. |
|
Full Usage:
MatrixMath.DivideRow(a, b, brow, resultIfNull, c)
Parameters:
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
|
Full Usage:
MatrixMath.EnumerateElementsIndexed(matrix, ?zeros)
Parameters: Returns: IEnumerable<int * int * 'T>
|
|
Full Usage:
MatrixMath.GetMatrixArray(n, m)
Parameters:
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.
|
Full Usage:
MatrixMath.GetSingularValueDecomposition(input, output)
Parameters:
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.
|
Full Usage:
MatrixMath.GetSingularValueDecomposition(inout)
Parameters:
IMatrix<float>
-
The input matrix, on return the resulting decomposed matrix.
Returns: SingularValueDecomposition
|
Returns the singular value decomposition for this matrix.
|
Full Usage:
MatrixMath.Hypotenuse(a, b)
Parameters:
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.
|
Full Usage:
MatrixMath.InvertDiagonalMatrix(a)
Parameters:
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.
|
|
Compares matrix a and matrix b. Takes the norm of matrix b times accuracy as threshold basis for comparing the elements.
|
Full Usage:
MatrixMath.IsZeroMatrix(a)
Parameters:
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.
|
Tests if all elements of the matrix a are equal to zero.
|
Full Usage:
MatrixMath.LengthOf(a)
Parameters:
IROMatrix<float>
-
The matrix.
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.
|
Full Usage:
MatrixMath.Map(src1, function, result)
Parameters:
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. |
Full Usage:
MatrixMath.Map(src1, src2, function, result)
Parameters:
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.
|
|
|
Full Usage:
MatrixMath.MapIndexed(src1, function, result)
Parameters:
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.
|
Full Usage:
MatrixMath.MapIndexed(src1, src2, function, result)
Parameters:
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.
|
Full Usage:
MatrixMath.MapIndexed(src1, parameter1, function, result)
Parameters:
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.
|
Full Usage:
MatrixMath.MatrixToString(name, a)
Parameters:
string
a : IROMatrix<'T>
Returns: string
|
|
Full Usage:
MatrixMath.MatrixToString(name, a)
Parameters:
string
a : IROMatrix<float32>
Returns: string
|
|
Full Usage:
MatrixMath.MatrixToString(name, a)
Parameters:
string
a : IROComplexDoubleMatrix
Returns: string
|
|
Full Usage:
MatrixMath.MatrixToString(name, a)
Parameters:
string
a : IROComplexFloatMatrix
Returns: string
|
|
Full Usage:
MatrixMath.Max(a)
Parameters:
IROMatrix<float>
-
The matrix.
Returns: float
Maximum value of all elements of the specified matrix a.
|
Get the maximum value of all elements of the specified matrix a.
|
Full Usage:
MatrixMath.Min(a)
Parameters:
IROMatrix<float>
-
The matrix.
Returns: float
Minimum value of all elements of the specified matrix a.
|
Get the minimum value of all elements of the specified matrix a.
|
|
Multiplies matrix a with matrix b and stores the result in matrix c. |
Full Usage:
MatrixMath.Multiply(a, b, c)
Parameters:
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.
|
|
Multiplies matrix a_transposed with matrix b and stores the result in matrix c. |
Full Usage:
MatrixMath.MultiplyFirstTransposed(a, b, c)
Parameters:
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.
|
Full Usage:
MatrixMath.MultiplyRow(a, b, brow, c)
Parameters:
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 |
Full Usage:
MatrixMath.MultiplyRow(a, b, c)
Parameters:
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
|
|
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. |
|
Multiplies matrix a with matrix b_transposed and stores the result in matrix c. |
Full Usage:
MatrixMath.MultiplyVectorFromLeftAndRight(a, b)
Parameters:
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.
|
Full Usage:
MatrixMath.NIPALS_HO(X, numFactors, accuracy, factors, loads, residualVarianceVector)
Parameters:
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
|
Full Usage:
MatrixMath.Norm(a, ntype)
Parameters:
IROMatrix<float>
ntype : MatrixNorm
Returns: float
|
|
Full Usage:
MatrixMath.NormalizeCols(a)
Parameters:
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).
|
Full Usage:
MatrixMath.NormalizeOneColumn(a, col)
Parameters:
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.
|
Full Usage:
MatrixMath.NormalizeRows(a)
Parameters:
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).
|
|
Calculates the pseudo inverse of the matrix
|
|
Calculates the pseudo inverse of the matrix
|
Full Usage:
MatrixMath.ReplaceNaNAndInfiniteElementsWith(m, replacementValue)
Parameters:
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.
|
Full Usage:
MatrixMath.ReplaceNaNElementsWith(m, replacementValue)
Parameters:
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.
|
|
Returns a vector representing a matrix row by providing the matrix and the row number of that matrix that is wrapped.
|
Full Usage:
MatrixMath.RowToROVector(x, row, columnoffset, length)
Parameters:
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.
|
|
Returns a vector representing a matrix row by providing the matrix and the row number of that matrix that is wrapped.
|
Full Usage:
MatrixMath.RowToVector(x, row, columnoffset, length)
Parameters:
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.
|
Full Usage:
MatrixMath.SetColumn(src, srccol, dest, destcol)
Parameters:
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.
|
Full Usage:
MatrixMath.SetColumn(src, dest, col)
Parameters:
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. |
Full Usage:
MatrixMath.SetColumn(src, dest, destColumn)
Parameters:
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.
|
Full Usage:
MatrixMath.SetMatrixElements(a, scalar)
Parameters:
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.
|
|
Sets the matrix elements to the value provided by a setter function Setter. |
Full Usage:
MatrixMath.SetRow(src, srcRow, dest, destRow)
Parameters:
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.
|
Full Usage:
MatrixMath.SetRow(src, dest, destRow)
Parameters:
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.
|
Full Usage:
MatrixMath.Square(x)
Parameters:
float
-
The value.
Returns: float
x*x.
|
Calculates the Square of the value x.
|
Full Usage:
MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)
Parameters:
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.
|
Full Usage:
MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)
Parameters:
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.
|
Full Usage:
MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)
Parameters:
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.
|
Full Usage:
MatrixMath.SubMatrix(a, selectedRows, selectedColumns, MatrixGenerator)
Parameters:
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.
|
Full Usage:
MatrixMath.SubMatrix(a, selectedRows, selectedColumn, MatrixGenerator)
Parameters:
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.
|
Full Usage:
MatrixMath.SubMatrix(a, selectedRow, selectedColumns, MatrixGenerator)
Parameters:
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.
|
Full Usage:
MatrixMath.Submatrix(src, dest, rowoffset, coloffset)
Parameters:
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.
|
|
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. |
|
Calculates a-b and stores the result in matrix c. |
Full Usage:
MatrixMath.SubtractColumn(a, b, bcol, c)
Parameters:
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 |
|
Calculates c = c - ab |
|
Calculates c = c - ab |
Full Usage:
MatrixMath.SubtractRow(a, b, brow, c)
Parameters:
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 |
Full Usage:
MatrixMath.SubtractRow(a, b, c)
Parameters:
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
|
Full Usage:
MatrixMath.SumOfSquaredDifferences(a, b)
Parameters:
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.
|
Full Usage:
MatrixMath.SumOfSquares(a)
Parameters:
IROMatrix<float>
-
The matrix.
Returns: float
The sum of the squares of all elements in the matrix a.
|
Returns the sum of the squares of all elements.
|
Full Usage:
MatrixMath.ToMatrix(wrapper)
Parameters:
MatrixWrapperStructForLeftSpineJaggedArray<'T>
Returns: IBottomExtensibleMatrix<'T>
|
|
Full Usage:
MatrixMath.ToMatrix(wrapper)
Parameters:
MatrixWrapperStructForTopSpineJaggedArray<'T>
-
Wrapper around a top spine jagged array 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.
|
Full Usage:
MatrixMath.ToMatrix(wrapper)
Parameters:
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.
|
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.
|
|
|
Full Usage:
MatrixMath.ToMatrixFromColumnMajorLinearArray(x, nRows)
Parameters:
'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.
|
Full Usage:
MatrixMath.ToMatrixFromLeftSpineJaggedArray(x)
Parameters:
'T[][]
-
The jagged array. Each double[] vector is a row of the matrix.
Returns: IBottomExtensibleMatrix<'T>
|
|
Full Usage:
MatrixMath.ToMatrixFromTopSpineJaggedArray(x)
Parameters:
'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.
|
Full Usage:
MatrixMath.ToRODiagonalMatrix(vector, vectoroffset, matrixdimensions)
Parameters:
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.
|
Full Usage:
MatrixMath.ToROMatrix(wrapper)
Parameters:
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.
|
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.
|
|
|
Full Usage:
MatrixMath.ToROMatrixFromColumnMajorLinearArray(arrayInColumMajorOrder, rows)
Parameters:
'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.
|
Full Usage:
MatrixMath.ToROMatrixFromLeftSpineJaggedArray(x)
Parameters:
'T[][]
-
The jagged array. Each double[] vector is a row of the matrix.
Returns: IBottomExtensibleMatrix<'T>
|
|
Full Usage:
MatrixMath.ToROMatrixFromTopSpineJaggedArray(x)
Parameters:
'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.
|
Full Usage:
MatrixMath.ToROSubMatrix(matrix, rowOffset, columnOffset, rows, columns)
Parameters:
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).
|
Full Usage:
MatrixMath.ToSubMatrix(matrix, rowoffset, columnoffset, rows, columns)
Parameters:
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.
|
Full Usage:
MatrixMath.ToZeroMean(a, mean)
Parameters:
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.
|
|
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.
|
Full Usage:
MatrixMath.Trace(a)
Parameters:
IROMatrix<float>
-
The matrix.
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.
|
|
Set all elements in the matrix to 0 (zero)
|