MATRIX_put_row
Arguments:
Matrix m matrix to write to
int row row to be replaced
float *a data values
int n number of elements to be replacedCopies a vector into a row of a Matrix.
MATRIX_allocate_memory
Arguments:
Matrix m input matrix
int nd number of dimension of m
int np[MAXDIM] dimension values
int type matrix typeAllocate space for a matrix. The Matrix must already exist.
MATRIX_print
Arguments:
Matrix m Matrix to print
char *format C-style print formatPrints an entire matrix (lousy formating)
MATRIX_assign_name
Arguments:
Matrix m Input matrix
char *s Required nameSet the title of a matrix
MATRIX_assign_name_if_new
Arguments:
Matrix m Input matrix
char *s Required nameSet the title of a matrix, but only if the name is not already initialised.
MATRIX_copy_in
Arguments:
Matrix m matrix
float *d data to copy in
int *nd required number of dimensions
int ilim[] required dimensionsAllocates memory and stores data in the matrix
MATRIX_copy_out
Arguments:
Matrix m IN matrix
float **d OUT result array
int *limits OUT limits of matrix
char **title OUT titleAllocate an array and fill with data from the matrix Memory is also allocated for the title string
int MATRIX_set_zero
Arguments:
Matrix m matrix to be zeroedSet all elements of the matrix to zero
int MATRIX_set_unit
Arguments:
Matrix m matrix to be set to unitSet all a matrix to the unit matrix
int MATRIX_set_value
Arguments:
Matrix m Matrix to be manipulated
int *index Array of indices defining the element
float d Value of to be assignedSet a single element of a matrix to the value provided
int MATRIX_increment_value
Arguments:
Matrix m Matrix to access
int *index Array of indices
float d Value to be summed inAdd a value to an element of a matrix
int MATRIX_scale
Arguments:
Matrix m Matrix to access
float fac Scale factorMultiple all elements of a matrix by a scale factor
int MATRIX_get_value
Arguments:
Matrix m Matrix to access
int *index Array of indices
float *d pointer to variable to receive the valueAccess an element of a matrix
MATRIX_print_patch
Arguments:
Matrix m
char *format
char *rows
char *columns
int widthprint a patch of a matrix, using a sensible pattern for the rows this routine is designed for 2d matrices.
MATRIX_print_patch_v
Arguments:
Matrix m IN (nxm) matrix to be printed
Matrix v IN (nx1) Matrix to head columns
char *format IN C format statement for printing
char *rows spec of rows to print
char *columns spec of columns to print
int width number oc columns per pagePrints a patch of a matrix, with each column heading derived from another matrix
rows and column specifications are of the form 1-10
MATRIX_assign
Arguments:
Matrix to Source matrix
Matrix from Destination matrix
int rows[] list of destination rows to copy to
int cols[] list of destination columns to copy toAssigns some elements of the destination matrix from all elements of a source matrix. The source and destination matrices do not have to be the same shape, and mapping arrays are provided to indicate the rows and columns into which the data are to be copied. These should have the correct length (ie the relevant dimension of the source matrix).
MATRIX_assign_3d
Arguments:
Matrix to Source matrix
Matrix from Destination matrix
int rows[] list of destination rows to copy to
int cols[] list of destination columns to copy to
int planes[] list of destination planes to copy to3d version of MATRIX_assign. The arrays can be any number of dimensions up to 3 but mapping should be specified in 3 dimensions. (i.e. a 3x3 matrix is treated as if it is 3x3x1 - which is identical w.r.t. how the data is stored in the d array) This means that a 2d matrix can be used to assign a plane of a 3d matrix, etc.
MATRIX_copy
Arguments:
Matrix to Destination matrix
Matrix from Source matrixCopy all elements of one matrix to another, Memory is allocated in the destination matrix and the title is copied also.
float MATRIX_dot
Arguments:
Matrix m1 Matrix to access
Matrix m2 Second matrixDot product function for matrices, assumes matrices are the same shape
int MATRIX_copy_data
Arguments:
Matrix m1 Matrix to access
Matrix m2 Second matrixCopy function for matrices, assumes matrices are the same shape - only copies data, no reallocation.
int MATRIX_subtract
Arguments:
Matrix m1 Matrix to access
Matrix m2 Second matrix
Matrix m3 Result matrixSubtract function for matrices, assumes matrices are the same shape