double slap_MatrixNormedDifference(Matrix *A, Matrix *B)
Return the normed difference between 2 matrices of the same size.
Definition: matrix.c:147
int slap_FreeMatrix(Matrix *mat)
Free the data for a matrix.
Definition: matrix.c:35
int slap_MatrixScaleByConst(Matrix *mat, double alpha)
Scale a matrix by a constant factor.
Definition: matrix.c:137
int slap_MatrixGetLinearIndex(const Matrix *mat, int row, int col)
Get the linear index for a given row and column in the matrix.
Definition: matrix.c:53
int slap_MatrixCopyFromArray(Matrix *mat, const double *data)
Copy the data from an array into the matrix, columnwise.
Definition: matrix.c:107
Matrix slap_NewMatrixZeros(int rows, int cols)
Allocate a new matrix on the heap, initialized with zeros.
Definition: matrix.c:19
int slap_MatrixNumElements(const Matrix *mat)
Get the number of elements in a matrix, i.e. m * n.
Definition: matrix.c:46
double * slap_MatrixGetElementTranspose(const Matrix *mat, int row, int col, bool istranposed)
Get the element of a matrix or its transpose.
Definition: matrix.c:70
int slap_PrintRowVector(const Matrix *mat)
Print the entire matrix as a row vector.
Definition: matrix.c:198
int slap_SetMatrixSize(Matrix *mat, int rows, int cols)
Set the dimensions of the matrix.
Definition: matrix.c:210
int slap_MatrixFlattenToRow(Matrix *mat)
Flatten a 2D matrix to a row vector.
Definition: matrix.c:175
Represents a matrix of double-precision data.
Definition: matrix.h:71
int slap_MatrixFlatten(Matrix *mat)
Flatten a 2D matrix to a column vector.
Definition: matrix.c:165
int slap_MatrixSetConst(Matrix *mat, double val)
Sets all of the elements in a matrix to a single value.
Definition: matrix.c:25
int slap_MatrixSetElement(Matrix *mat, int row, int col, double val)
The a matrix element to a given value.
Definition: matrix.c:82
Matrix slap_NewMatrix(int rows, int cols)
Allocate a new matrix on the heap.
Definition: matrix.c:13
double * slap_MatrixGetElement(const Matrix *mat, int row, int col)
Get the element of a matrix given row, column indices.
Definition: matrix.c:63
int slap_MatrixCopyTranspose(Matrix *dest, Matrix *src)
Copy a matrix to another matrix, transposed.
Definition: matrix.c:118
int slap_PrintMatrix(const Matrix *mat)
Print the elements of a matrix to stdout.
Definition: matrix.c:185
int slap_MatrixCopy(Matrix *dest, Matrix *src)
Copy a matrix to another matrix.
Definition: matrix.c:95