SharedMeatAxe
1.0
|
Data Structures | |
class | MatRep_t |
A matrix representation. More... | |
Functions | |
int | MrAddGenerator (MatRep_t *rep, Matrix_t *gen, int flags) |
Add a Matrix to a Representation. More... | |
int | MrIsValid (const MatRep_t *rep) |
Check a Matrix Representation. More... | |
MatRep_t * | MrAlloc (int ngen, Matrix_t **gen, int flags) |
Create a Matrix Representation. More... | |
int | MrFree (MatRep_t *rep) |
Delete a Matrix Representation. More... | |
MatRep_t * | MrLoad (const char *basename, int ngen) |
Load a Matrix Representation. More... | |
MatRep_t * | MrTransposed (const MatRep_t *rep) |
Transpose a Representation. More... | |
int | MrSave (const MatRep_t *rep, const char *basename) |
Save a Matrix Representation. More... | |
Add a Matrix to a Representation.
This function adds a generator, i.e., a matrix, to a matrix representation. The matrix must be square. If there are already generators in the represenatation, the new matrix must be over the same field and have the same number of rows. flags may be zero or the special value MR_COPY_GENERATORS. In the latter case, a local copy of the generator is made, and gen can be safely destroyed. Otherwise, only a reference to the matrix is stored in the MatRep_t structure. Consequently, the application must not modify or destroy the matrix after calling MrAddGenerator(). It will be destroyed by MrFree() together with the representation.
rep | Matrix representation. |
gen | Matrix to add. |
flags | Optional flags (see below). |
Create a Matrix Representation.
This function creates a new matrix representation. Matrices representing the generators must be passed in gen. The matrices in gen must all be square, over the same field, and with the same dimensions. flags may be zero or the special value MR_COPY_GENERATORS. In the latter case, a local copy of the generators is made, and the matrices in |gen| can be safely destroyed. If flags is 0, only references to the matrices are stored in the MatRep_t structure. Consequently, the application must not modify or destroy the matrices after calling MrAlloc(). They will be destroyed automatically when MrFree() is called to destroy the representation.
ngen | Number of generators in gen. |
gen | List of generators. |
flags | Optional flags (see below). |
int MrFree | ( | MatRep_t * | rep | ) |
Delete a Matrix Representation.
This function frees a matrix representation which has beed created by MrAlloc(). This implies freeing the internal data buffers as well as the MatRep_t structure itself. Note: Even if the representation was created without MR_COPY_GENERATORS, the matrices that were passed to MrAlloc() are now destroyed. The same applies to matrices added to the representation with MrAddGenerator().
rep | Pointer to the matrix representation. |
int MrIsValid | ( | const MatRep_t * | rep | ) |
Check a Matrix Representation.
This function checks if the argument is a pointer to a valid matrix representation. If the representation is o.k., the function returns 1. Otherwise, an error is signaled and, if the error handler does not terminate the program, the function returns 0.
rep | Pointer to the matrix representation. |
MatRep_t* MrLoad | ( | const char * | basename, |
int | ngen | ||
) |
Load a Matrix Representation.
This function creates a new matrix representation and reads the generators from files. Each generator ist expected in a different file. The file name is constructed by appending ".1", ".2" etc. to basename or, if basename contains a "%d" placeholder, by replacing the "%d" with "1", "2", etc. For example, the following lines
are equivalent. In both cases, two matrices are read from "m11.2" and "m11.2", repectively.
basename | Base file name for generators. |
ngen | Number of generators. |
int MrSave | ( | const MatRep_t * | rep, |
const char * | basename | ||
) |
Save a Matrix Representation.
This function saves all generators of a matrix representation. Each generator ist written to different file. The file name is constructed by appending ".1", ".2" etc. to basename or, if basename contains a "%d" placeholder, by replacing the "%d" with "1", "2", etc.
rep | Pointer to the matrix representation. |
basename | Base file name for generators. |
Transpose a Representation.
This function transposes a matrix representation. A new representation is created, and the original representation is not changed.
rep | Matrix representation. |