CMR
1.3.0
|
#include <stddef.h>
#include <inttypes.h>
#include <cmr/env.h>
#include <cmr/matrix.h>
#include "hashtable.h"
Go to the source code of this file.
Classes | |
struct | _ListMat8Nonzero |
Nonzero of a ListMat8. More... | |
struct | ListMat8Element |
Row/column information of a ListMat8. More... | |
struct | ListMat8 |
Linked-list representation of a matrix with 8-bit integer values. More... | |
struct | _ListMat64Nonzero |
Nonzero of a ListMat64. More... | |
struct | ListMat64Element |
Row/column information of a ListMat64. More... | |
struct | ListMat64 |
Linked-list representation of a matrix with 64-bit integer values. More... | |
Typedefs | |
typedef struct _ListMat8Nonzero | ListMat8Nonzero |
Nonzero of a ListMat8. More... | |
typedef struct _ListMat64Nonzero | ListMat64Nonzero |
Nonzero of a ListMat64. More... | |
Functions | |
CMR_ERROR | CMRlistmat8Alloc (CMR *cmr, size_t memRows, size_t memColumns, size_t memNonzeros, ListMat8 **presult) |
Allocates memory for an 8-bit list matrix. More... | |
CMR_ERROR | CMRlistmat64Alloc (CMR *cmr, size_t memRows, size_t memColumns, size_t memNonzeros, ListMat64 **presult) |
Allocates memory for a 64-bit list matrix. More... | |
CMR_ERROR | CMRlistmat8Free (CMR *cmr, ListMat8 **plistmatrix) |
Frees an 8-bit list matrix. More... | |
CMR_ERROR | CMRlistmat64Free (CMR *cmr, ListMat64 **plistmatrix) |
Frees a 64-bit list matrix. More... | |
CMR_ERROR | CMRlistmat8InitializeZero (CMR *cmr, ListMat8 *listmatrix, size_t numRows, size_t numColumns) |
Initializes a zero 8-bit list matrix. More... | |
CMR_ERROR | CMRlistmat64InitializeZero (CMR *cmr, ListMat64 *listmatrix, size_t numRows, size_t numColumns) |
Initializes a zero 64-bit list matrix. More... | |
CMR_ERROR | CMRlistmat8InitializeFromChrMatrix (CMR *cmr, ListMat8 *listmatrix, CMR_CHRMAT *matrix) |
Copies matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat64InitializeFromIntMatrix (CMR *cmr, ListMat64 *listmatrix, CMR_INTMAT *matrix) |
Copies matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat8InitializeFromDoubleMatrix (CMR *cmr, ListMat8 *listmatrix, CMR_DBLMAT *matrix, double epsilon) |
Copies matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat64InitializeFromDoubleMatrix (CMR *cmr, ListMat64 *listmatrix, CMR_DBLMAT *matrix, double epsilon) |
Copies matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat8InitializeFromChrSubmatrix (CMR *cmr, ListMat8 *listmatrix, CMR_CHRMAT *matrix, CMR_SUBMAT *submatrix) |
Copies submatrix of matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat64InitializeFromIntSubmatrix (CMR *cmr, ListMat64 *listmatrix, CMR_INTMAT *matrix, CMR_SUBMAT *submatrix) |
Copies submatrix of matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat8InitializeFromSubmatrixComplement (CMR *cmr, ListMat8 *listmatrix, CMR_CHRMAT *matrix, CMR_SUBMAT *submatrix) |
Copies all but submatrix of matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat64InitializeFromIntSubmatrixComplement (CMR *cmr, ListMat64 *listmatrix, CMR_INTMAT *matrix, CMR_SUBMAT *submatrix) |
Copies all but submatrix of matrix into listmatrix . More... | |
CMR_ERROR | CMRlistmat8PrintDense (CMR *cmr, ListMat8 *listmatrix, FILE *stream) |
Prints the 8-bit list matrix as a dense matrix. More... | |
CMR_ERROR | CMRlistmat64PrintDense (CMR *cmr, ListMat64 *listmatrix, FILE *stream) |
Prints the 64-bit list matrix as a dense matrix. More... | |
CMR_ERROR | CMRlistmat8Insert (CMR *cmr, ListMat8 *listmatrix, size_t row, size_t column, int8_t value, long special, ptrdiff_t *pmemoryShift) |
Creates a new element and inserts it into the doubly-linked lists. More... | |
CMR_ERROR | CMRlistmat64Insert (CMR *cmr, ListMat64 *listmatrix, size_t row, size_t column, int64_t value, long special, ptrdiff_t *pmemoryShift) |
Creates a new element and inserts it into the doubly-linked lists. More... | |
CMR_ERROR | CMRlistmat8Delete (CMR *cmr, ListMat8 *listmatrix, ListMat8Nonzero *nz) |
Delete a nonzero element. More... | |
CMR_ERROR | CMRlistmat64Delete (CMR *cmr, ListMat64 *listmatrix, ListMat64Nonzero *nz) |
Delete a nonzero element. More... | |
typedef struct _ListMat64Nonzero ListMat64Nonzero |
Nonzero of a ListMat64.
typedef struct _ListMat8Nonzero ListMat8Nonzero |
Nonzero of a ListMat8.
CMR_ERROR CMRlistmat64Alloc | ( | CMR * | cmr, |
size_t | memRows, | ||
size_t | memColumns, | ||
size_t | memNonzeros, | ||
ListMat64 ** | presult | ||
) |
Allocates memory for a 64-bit list matrix.
cmr | CMR environment. |
memRows | Memory for rows. |
memColumns | Memory for columns. |
memNonzeros | Memory for nonzeros. |
presult | Pointer for storing the created list matrix. |
CMR_ERROR CMRlistmat64Delete | ( | CMR * | cmr, |
ListMat64 * | listmatrix, | ||
ListMat64Nonzero * | nz | ||
) |
Delete a nonzero element.
cmr | CMR environment. |
listmatrix | List matrix. |
nz | Nonzero to delete. |
Frees a 64-bit list matrix.
cmr | CMR environment. |
plistmatrix | Pointer to list matrix. |
CMR_ERROR CMRlistmat64InitializeFromDoubleMatrix | ( | CMR * | cmr, |
ListMat64 * | listmatrix, | ||
CMR_DBLMAT * | matrix, | ||
double | epsilon | ||
) |
Copies matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
epsilon | Tolerance to consider as exact integer. |
CMR_ERROR CMRlistmat64InitializeFromIntMatrix | ( | CMR * | cmr, |
ListMat64 * | listmatrix, | ||
CMR_INTMAT * | matrix | ||
) |
Copies matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
CMR_ERROR CMRlistmat64InitializeFromIntSubmatrix | ( | CMR * | cmr, |
ListMat64 * | listmatrix, | ||
CMR_INTMAT * | matrix, | ||
CMR_SUBMAT * | submatrix | ||
) |
Copies submatrix
of matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
submatrix | Submatrix of matrix . |
CMR_ERROR CMRlistmat64InitializeFromIntSubmatrixComplement | ( | CMR * | cmr, |
ListMat64 * | listmatrix, | ||
CMR_INTMAT * | matrix, | ||
CMR_SUBMAT * | submatrix | ||
) |
Copies all but submatrix
of matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
submatrix | Submatrix of matrix . |
CMR_ERROR CMRlistmat64InitializeZero | ( | CMR * | cmr, |
ListMat64 * | listmatrix, | ||
size_t | numRows, | ||
size_t | numColumns | ||
) |
Initializes a zero 64-bit list matrix.
cmr | CMR environment. |
listmatrix | List matrix. |
numRows | Number of rows. |
numColumns | Number of columns. |
CMR_ERROR CMRlistmat64Insert | ( | CMR * | cmr, |
ListMat64 * | listmatrix, | ||
size_t | row, | ||
size_t | column, | ||
int64_t | value, | ||
long | special, | ||
ptrdiff_t * | pmemoryShift | ||
) |
Creates a new element and inserts it into the doubly-linked lists.
The function may reallocate the array of nonzeros.
cmr | CMR environment. |
listmatrix | List matrix. |
row | Row of new element. |
column | Column of new element. |
value | Value of new element. |
special | Special entry of new element. |
pmemoryShift | If not NULL , each nonzero's address is shifted by this value. |
Prints the 64-bit list matrix as a dense matrix.
cmr | CMR environment. |
listmatrix | List matrix. |
stream | Stream to print to. |
CMR_ERROR CMRlistmat8Alloc | ( | CMR * | cmr, |
size_t | memRows, | ||
size_t | memColumns, | ||
size_t | memNonzeros, | ||
ListMat8 ** | presult | ||
) |
Allocates memory for an 8-bit list matrix.
cmr | CMR environment. |
memRows | Memory for rows. |
memColumns | Memory for columns. |
memNonzeros | Memory for nonzeros. |
presult | Pointer for storing the created list matrix. |
CMR_ERROR CMRlistmat8Delete | ( | CMR * | cmr, |
ListMat8 * | listmatrix, | ||
ListMat8Nonzero * | nz | ||
) |
Delete a nonzero element.
cmr | CMR environment. |
listmatrix | List matrix. |
nz | Nonzero to delete. |
Frees an 8-bit list matrix.
cmr | CMR environment. |
plistmatrix | Pointer to list matrix. |
CMR_ERROR CMRlistmat8InitializeFromChrMatrix | ( | CMR * | cmr, |
ListMat8 * | listmatrix, | ||
CMR_CHRMAT * | matrix | ||
) |
Copies matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
CMR_ERROR CMRlistmat8InitializeFromChrSubmatrix | ( | CMR * | cmr, |
ListMat8 * | listmatrix, | ||
CMR_CHRMAT * | matrix, | ||
CMR_SUBMAT * | submatrix | ||
) |
Copies submatrix
of matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
submatrix | Submatrix of matrix . |
CMR_ERROR CMRlistmat8InitializeFromDoubleMatrix | ( | CMR * | cmr, |
ListMat8 * | listmatrix, | ||
CMR_DBLMAT * | matrix, | ||
double | epsilon | ||
) |
Copies matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
epsilon | Tolerance to consider as exact integer. |
CMR_ERROR CMRlistmat8InitializeFromSubmatrixComplement | ( | CMR * | cmr, |
ListMat8 * | listmatrix, | ||
CMR_CHRMAT * | matrix, | ||
CMR_SUBMAT * | submatrix | ||
) |
Copies all but submatrix
of matrix
into listmatrix
.
cmr | CMR environment. |
listmatrix | List matrix. |
matrix | Matrix to be copied to listmatrix . |
submatrix | Submatrix of matrix . |
CMR_ERROR CMRlistmat8InitializeZero | ( | CMR * | cmr, |
ListMat8 * | listmatrix, | ||
size_t | numRows, | ||
size_t | numColumns | ||
) |
Initializes a zero 8-bit list matrix.
cmr | CMR environment. |
listmatrix | List matrix. |
numRows | Number of rows. |
numColumns | Number of columns. |
CMR_ERROR CMRlistmat8Insert | ( | CMR * | cmr, |
ListMat8 * | listmatrix, | ||
size_t | row, | ||
size_t | column, | ||
int8_t | value, | ||
long | special, | ||
ptrdiff_t * | pmemoryShift | ||
) |
Creates a new element and inserts it into the doubly-linked lists.
The function may reallocate the array of nonzeros.
cmr | CMR environment. |
listmatrix | List matrix. |
row | Row of new element. |
column | Column of new element. |
value | Value of new element. |
special | Special entry of new element. |
pmemoryShift | If not NULL , each nonzero's address is shifted by this value. |