MeatAxe
2.4
|
Data Structures | |
class | IntMatrix_t |
An Integer Matrix. More... | |
Functions | |
int | ImatIsValid (const IntMatrix_t *mat) |
Check an Integer Matrix. More... | |
IntMatrix_t * | ImatAlloc (int nor, int noc) |
Create a New Integer Matrix. More... | |
int | ImatFree (IntMatrix_t *mat) |
Delete an Integer Matrix. More... | |
IntMatrix_t * | ImatRead (FILE *f) |
Read an integer matrix from a file. More... | |
IntMatrix_t * | ImatLoad (const char *fn) |
Read an Integer Matrix From a File. More... | |
int | ImatWrite (const IntMatrix_t *mat, FILE *f) |
Write an integer matrix to a file. More... | |
int | ImatSave (const IntMatrix_t *mat, const char *file_name) |
Write an Integer Matrix to a File. More... | |
IntMatrix_t* ImatAlloc | ( | int | nor, |
int | noc | ||
) |
Create a New Integer Matrix.
This function creates a new integer matrix with |nor| rows and |noc| columns. To destroy an integer matrix, use ImatFree(), not SysFree().
nor | Number of rows. |
noc | Number of columns. |
int ImatFree | ( | IntMatrix_t * | mat | ) |
Delete an Integer Matrix.
This function frees a matrix which has beed created by ImatAlloc(). This implies freeing the internal data buffers as well as the IntMatrix_t structure itself.
mat | Pointer to the matrix. |
int ImatIsValid | ( | const IntMatrix_t * | mat | ) |
Check an Integer Matrix.
This function checks if the argument is a pointer to a valid integer matrix. If the matrix is o.k., the function returns 1. Otherwise, an error is signalled and, if the error handler does not terminate the program, the function returns 0.
mat | Pointer to the matrix. |
IntMatrix_t* ImatLoad | ( | const char * | fn | ) |
Read an Integer Matrix From a File.
This function opens a file, reads a single integer matrix, and closes the file. To read more than one matrix from a file, use ImatRead().
fn | File name. |
IntMatrix_t* ImatRead | ( | FILE * | f | ) |
Read an integer matrix from a file.
This function reads an integer matrix from a file.
f | File to read from. |
int ImatSave | ( | const IntMatrix_t * | mat, |
const char * | file_name | ||
) |
Write an Integer Matrix to a File.
This function writes an integer matrix to a named file. If the file exists, it is destroyed.
mat | Pointer to the matrix. |
file_name | File name. |
int ImatWrite | ( | const IntMatrix_t * | mat, |
FILE * | f | ||
) |
Write an integer matrix to a file.
mat | Pointer to the matrix. |
f | Pointer to the file. |