MeatAxe  2.4
Matrix Representations

Detailed Description

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_tMrAlloc (int ngen, Matrix_t **gen, int flags)
 Create a Matrix Representation. More...
 
int MrFree (MatRep_t *rep)
 Delete a Matrix Representation. More...
 
MatRep_tMrLoad (const char *basename, int ngen)
 Load a Matrix Representation. More...
 
MatRep_tMrTransposed (const MatRep_t *rep)
 Transpose a Representation. More...
 
int MrSave (const MatRep_t *rep, const char *basename)
 Save a Matrix Representation. More...
 

Function Documentation

◆ MrAddGenerator()

int MrAddGenerator ( MatRep_t rep,
Matrix_t gen,
int  flags 
)

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.

Parameters
repMatrix representation.
genMatrix to add.
flagsOptional flags (see below).
Returns
0 on success, -1 on error.

◆ MrAlloc()

MatRep_t* MrAlloc ( int  ngen,
Matrix_t **  gen,
int  flags 
)

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.

Parameters
ngenNumber of generators in gen.
genList of generators.
flagsOptional flags (see below).
Returns
Pointer to the new matrix representation or 0 on error.

◆ MrFree()

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

Parameters
repPointer to the matrix representation.
Returns
0 on success, -1 on error.

◆ MrIsValid()

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.

Parameters
repPointer to the matrix representation.
Returns
1 if rep points to a valid matrix representation, 0 otherwise.

◆ MrLoad()

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

m11 = MrLoad("m11",2);
m11 = MrLoad("m11.%d",2);
MatRep_t * MrLoad(const char *basename, int ngen)
Load a Matrix Representation.
Definition: mrread.c:40

are equivalent. In both cases, two matrices are read from "m11.2" and "m11.2", repectively.

Parameters
basenameBase file name for generators.
ngenNumber of generators.
Returns
Pointer to the representation, or 0 on error.

◆ MrSave()

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.

Parameters
repPointer to the matrix representation.
basenameBase file name for generators.
Returns
0 on success, -1 on error.

◆ MrTransposed()

MatRep_t* MrTransposed ( const MatRep_t rep)

Transpose a Representation.

This function transposes a matrix representation. A new representation is created, and the original representation is not changed.

Parameters
repMatrix representation.
Returns
Pointer to the transposed representation, or 0 on error.

MeatAxe 2.4 documentation, generated on Mon Jun 7 2021 11:42:24