CMR  1.3.0
Classes | Typedefs | Functions
listmatrix.h File Reference
#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 Documentation

◆ ListMat64Nonzero

Nonzero of a ListMat64.

◆ ListMat8Nonzero

Nonzero of a ListMat8.

Function Documentation

◆ CMRlistmat64Alloc()

CMR_ERROR CMRlistmat64Alloc ( CMR cmr,
size_t  memRows,
size_t  memColumns,
size_t  memNonzeros,
ListMat64 **  presult 
)

Allocates memory for a 64-bit list matrix.

Parameters
cmrCMR environment.
memRowsMemory for rows.
memColumnsMemory for columns.
memNonzerosMemory for nonzeros.
presultPointer for storing the created list matrix.

◆ CMRlistmat64Delete()

CMR_ERROR CMRlistmat64Delete ( CMR cmr,
ListMat64 listmatrix,
ListMat64Nonzero nz 
)

Delete a nonzero element.

Parameters
cmrCMR environment.
listmatrixList matrix.
nzNonzero to delete.

◆ CMRlistmat64Free()

CMR_ERROR CMRlistmat64Free ( CMR cmr,
ListMat64 **  plistmatrix 
)

Frees a 64-bit list matrix.

Parameters
cmrCMR environment.
plistmatrixPointer to list matrix.

◆ CMRlistmat64InitializeFromDoubleMatrix()

CMR_ERROR CMRlistmat64InitializeFromDoubleMatrix ( CMR cmr,
ListMat64 listmatrix,
CMR_DBLMAT matrix,
double  epsilon 
)

Copies matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.
epsilonTolerance to consider as exact integer.

◆ CMRlistmat64InitializeFromIntMatrix()

CMR_ERROR CMRlistmat64InitializeFromIntMatrix ( CMR cmr,
ListMat64 listmatrix,
CMR_INTMAT matrix 
)

Copies matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.

◆ CMRlistmat64InitializeFromIntSubmatrix()

CMR_ERROR CMRlistmat64InitializeFromIntSubmatrix ( CMR cmr,
ListMat64 listmatrix,
CMR_INTMAT matrix,
CMR_SUBMAT submatrix 
)

Copies submatrix of matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.
submatrixSubmatrix of matrix.

◆ CMRlistmat64InitializeFromIntSubmatrixComplement()

CMR_ERROR CMRlistmat64InitializeFromIntSubmatrixComplement ( CMR cmr,
ListMat64 listmatrix,
CMR_INTMAT matrix,
CMR_SUBMAT submatrix 
)

Copies all but submatrix of matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.
submatrixSubmatrix of matrix.

◆ CMRlistmat64InitializeZero()

CMR_ERROR CMRlistmat64InitializeZero ( CMR cmr,
ListMat64 listmatrix,
size_t  numRows,
size_t  numColumns 
)

Initializes a zero 64-bit list matrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
numRowsNumber of rows.
numColumnsNumber of columns.

◆ CMRlistmat64Insert()

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.

Parameters
cmrCMR environment.
listmatrixList matrix.
rowRow of new element.
columnColumn of new element.
valueValue of new element.
specialSpecial entry of new element.
pmemoryShiftIf not NULL, each nonzero's address is shifted by this value.

◆ CMRlistmat64PrintDense()

CMR_ERROR CMRlistmat64PrintDense ( CMR cmr,
ListMat64 listmatrix,
FILE *  stream 
)

Prints the 64-bit list matrix as a dense matrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
streamStream to print to.

◆ CMRlistmat8Alloc()

CMR_ERROR CMRlistmat8Alloc ( CMR cmr,
size_t  memRows,
size_t  memColumns,
size_t  memNonzeros,
ListMat8 **  presult 
)

Allocates memory for an 8-bit list matrix.

Parameters
cmrCMR environment.
memRowsMemory for rows.
memColumnsMemory for columns.
memNonzerosMemory for nonzeros.
presultPointer for storing the created list matrix.

◆ CMRlistmat8Delete()

CMR_ERROR CMRlistmat8Delete ( CMR cmr,
ListMat8 listmatrix,
ListMat8Nonzero nz 
)

Delete a nonzero element.

Parameters
cmrCMR environment.
listmatrixList matrix.
nzNonzero to delete.

◆ CMRlistmat8Free()

CMR_ERROR CMRlistmat8Free ( CMR cmr,
ListMat8 **  plistmatrix 
)

Frees an 8-bit list matrix.

Parameters
cmrCMR environment.
plistmatrixPointer to list matrix.

◆ CMRlistmat8InitializeFromChrMatrix()

CMR_ERROR CMRlistmat8InitializeFromChrMatrix ( CMR cmr,
ListMat8 listmatrix,
CMR_CHRMAT matrix 
)

Copies matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.

◆ CMRlistmat8InitializeFromChrSubmatrix()

CMR_ERROR CMRlistmat8InitializeFromChrSubmatrix ( CMR cmr,
ListMat8 listmatrix,
CMR_CHRMAT matrix,
CMR_SUBMAT submatrix 
)

Copies submatrix of matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.
submatrixSubmatrix of matrix.

◆ CMRlistmat8InitializeFromDoubleMatrix()

CMR_ERROR CMRlistmat8InitializeFromDoubleMatrix ( CMR cmr,
ListMat8 listmatrix,
CMR_DBLMAT matrix,
double  epsilon 
)

Copies matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.
epsilonTolerance to consider as exact integer.

◆ CMRlistmat8InitializeFromSubmatrixComplement()

CMR_ERROR CMRlistmat8InitializeFromSubmatrixComplement ( CMR cmr,
ListMat8 listmatrix,
CMR_CHRMAT matrix,
CMR_SUBMAT submatrix 
)

Copies all but submatrix of matrix into listmatrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
matrixMatrix to be copied to listmatrix.
submatrixSubmatrix of matrix.

◆ CMRlistmat8InitializeZero()

CMR_ERROR CMRlistmat8InitializeZero ( CMR cmr,
ListMat8 listmatrix,
size_t  numRows,
size_t  numColumns 
)

Initializes a zero 8-bit list matrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
numRowsNumber of rows.
numColumnsNumber of columns.

◆ CMRlistmat8Insert()

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.

Parameters
cmrCMR environment.
listmatrixList matrix.
rowRow of new element.
columnColumn of new element.
valueValue of new element.
specialSpecial entry of new element.
pmemoryShiftIf not NULL, each nonzero's address is shifted by this value.

◆ CMRlistmat8PrintDense()

CMR_ERROR CMRlistmat8PrintDense ( CMR cmr,
ListMat8 listmatrix,
FILE *  stream 
)

Prints the 8-bit list matrix as a dense matrix.

Parameters
cmrCMR environment.
listmatrixList matrix.
streamStream to print to.