MeatAxe  2.4
Programs for working with modular representations
Integer matrices

Detailed Description

Data Structures

class  IntMatrix_t
 An integer matrix. More...
 

Functions

int ImatIsValid (const IntMatrix_t *mat)
 Check an integer matrix. More...
 
IntMatrix_tImatAlloc (int nor, int noc)
 Create a new integer matrix. More...
 
int ImatFree (IntMatrix_t *mat)
 Delete an integer matrix. More...
 
IntMatrix_tImatRead (FILE *f)
 Read an integer matrix from a file. More...
 
IntMatrix_tImatLoad (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...
 

Function Documentation

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().

Parameters
norNumber of rows.
nocNumber of columns.
Returns
Pointer to the new matrix or 0 on error.
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.

Parameters
matPointer to the matrix.
Returns
0 on success, -1 on error.
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.

Parameters
matPointer to the matrix.
Returns
1 if mat points to a valid matrix, 0 otherwise.
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().

Parameters
fnFile name.
Returns
Pointer to the matrix, or 0 on error.
IntMatrix_t* ImatRead ( FILE *  f)

Read an integer matrix from a file.

This function reads an integer matrix from a file.

See also
ImatLoad()
Parameters
fFile to read from.
Returns
Pointer to the matrix, or 0 on error.
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.

See also
ImatWrite()
Parameters
matPointer to the matrix.
file_nameFile name.
Returns
0 on success, -1 on error.
int ImatWrite ( const IntMatrix_t mat,
FILE *  f 
)

Write an integer matrix to a file.

See also
ImatSave
Parameters
matPointer to the matrix.
fPointer to the file.
Returns
0 on success, -1 on error.

MeatAxe 2.4 documentation, generated on Wed Jan 7 2015 08:38:36