Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
NLSparseMatrix Struct Reference

Public Attributes

NLuint m
 number of rows
 
NLuint n
 number of columns
 
NLenum type
 Matrix type. More...
 
NLDestroyMatrixFunc destroy_func
 destructor
 
NLMultMatrixVectorFunc mult_func
 Matrix x vector product.
 
NLuint diag_size
 number of elements in the diagonal
 
NLuint diag_capacity
 Number of elements allocated to store the diagonal.
 
NLenum storage
 indicates what is stored in this matrix
 
NLRowColumnrow
 the rows if (storage & NL_MATRIX_STORE_ROWS), size = m, NULL otherwise
 
NLRowColumncolumn
 the columns if (storage & NL_MATRIX_STORE_COLUMNS), size = n, NULL otherwise
 
NLdoublediag
 the diagonal elements, size = diag_size
 
NLuint row_capacity
 Number of row descriptors allocated in the row array.
 
NLuint column_capacity
 Number of column descriptors allocated in the column array.
 

Related Functions

(Note that these are not member functions.)

NLAPI void NLAPIENTRY nlCRSMatrixAdd (NLCRSMatrix *M, NLuint i, NLuint j, NLdouble value)
 Adds a coefficient to an NLSparseMatrix. More...
 
#define NL_MATRIX_STORE_ROWS   1
 
#define NL_MATRIX_STORE_COLUMNS   2
 
#define NL_MATRIX_STORE_SYMMETRIC   4
 
NLAPI NLMatrix NLAPIENTRY nlSparseMatrixNew (NLuint m, NLuint n, NLenum storage)
 Constructs a new NLSparseMatrix. More...
 
NLAPI void NLAPIENTRY nlSparseMatrixConstruct (NLSparseMatrix *M, NLuint m, NLuint n, NLenum storage)
 Constructs a new NLSparseMatrix. More...
 
NLAPI void NLAPIENTRY nlSparseMatrixDestroy (NLSparseMatrix *M)
 Destroys an NLSparseMatrix. More...
 
NLAPI void NLAPIENTRY nlSparseMatrixMult (NLSparseMatrix *A, const NLdouble *x, NLdouble *y)
 Computes a matrix-vector product. More...
 
NLAPI void NLAPIENTRY nlSparseMatrixAdd (NLSparseMatrix *M, NLuint i, NLuint j, NLdouble value)
 Adds a coefficient to an NLSparseMatrix. More...
 
NLAPI void NLAPIENTRY nlSparseMatrixZero (NLSparseMatrix *M)
 Zeroes an NLSparseMatrix. More...
 
NLAPI void NLAPIENTRY nlSparseMatrixClear (NLSparseMatrix *M)
 Clears an NLSparseMatrix. More...
 
NLAPI NLuint_big NLAPIENTRY nlSparseMatrixNNZ (NLSparseMatrix *M)
 Gets the number of non-zero coefficient in an NLSparseMatrix. More...
 
NLAPI void NLAPIENTRY nlSparseMatrixSort (NLSparseMatrix *M)
 Sorts the coefficients in an NLSParseMatrix. More...
 

Detailed Description

Definition at line 479 of file nl_matrix.h.

Friends And Related Function Documentation

◆ NL_MATRIX_STORE_COLUMNS

#define NL_MATRIX_STORE_COLUMNS   2
related

for NLSparseMatrix storage: indicates that columns are stored.

Definition at line 470 of file nl_matrix.h.

◆ NL_MATRIX_STORE_ROWS

#define NL_MATRIX_STORE_ROWS   1
related

for NLSparseMatrix storage: indicates that rows are stored.

Definition at line 464 of file nl_matrix.h.

◆ NL_MATRIX_STORE_SYMMETRIC

#define NL_MATRIX_STORE_SYMMETRIC   4
related

for NLSparseMatrix storage: indicates that symmetric storage is used (only the lower triangular part is stored).

Definition at line 477 of file nl_matrix.h.

◆ nlCRSMatrixAdd()

NLAPI void NLAPIENTRY nlCRSMatrixAdd ( NLCRSMatrix M,
NLuint  i,
NLuint  j,
NLdouble  value 
)
related

Adds a coefficient to an NLSparseMatrix.

Performs the following operation: $ a_{i,j} \leftarrow a_{i,j} + \mbox{value} $

Parameters
[in,out]Ma pointer to an NLSparseMatrix
[in]iindex of the row
[in]jindex of the column
[in]valuethe coefficient to be added

◆ nlSparseMatrixAdd()

NLAPI void NLAPIENTRY nlSparseMatrixAdd ( NLSparseMatrix M,
NLuint  i,
NLuint  j,
NLdouble  value 
)
related

Adds a coefficient to an NLSparseMatrix.

Performs the following operation: $ a_{i,j} \leftarrow a_{i,j} + \mbox{value} $

Parameters
[in,out]Ma pointer to an NLSparseMatrix
[in]iindex of the row
[in]jindex of the column
[in]valuethe coefficient to be added

◆ nlSparseMatrixClear()

NLAPI void NLAPIENTRY nlSparseMatrixClear ( NLSparseMatrix M)
related

Clears an NLSparseMatrix.

The memory is freed.

Parameters
[in,out]Ma pointer to the NLSparseMatrix to zero

◆ nlSparseMatrixConstruct()

NLAPI void NLAPIENTRY nlSparseMatrixConstruct ( NLSparseMatrix M,
NLuint  m,
NLuint  n,
NLenum  storage 
)
related

Constructs a new NLSparseMatrix.

Parameters
[in,out]Ma pointer to an uninitialized NLSparseMatrix
[in]mnumber of rows
[in]nnumber of columns
[in]storagea bitwise or combination of flags that indicate what needs to be stored in the matrix.

◆ nlSparseMatrixDestroy()

NLAPI void NLAPIENTRY nlSparseMatrixDestroy ( NLSparseMatrix M)
related

Destroys an NLSparseMatrix.

Only the memory allocated by the NLSparseMatrix is freed. The NLSparseMatrix structure is not freed.

Parameters
[in,out]Ma pointer to an NLSparseMatrix

◆ nlSparseMatrixMult()

NLAPI void NLAPIENTRY nlSparseMatrixMult ( NLSparseMatrix A,
const NLdouble x,
NLdouble y 
)
related

Computes a matrix-vector product.

Parameters
[in]Aa pointer to the matrix
[in]xthe vector to be multiplied, size = A->n
[in]ywhere to store the result, size = A->m

◆ nlSparseMatrixNew()

NLAPI NLMatrix NLAPIENTRY nlSparseMatrixNew ( NLuint  m,
NLuint  n,
NLenum  storage 
)
related

Constructs a new NLSparseMatrix.

Parameters
[in]mnumber of rows
[in]nnumber of columns
[in]storagea bitwise or combination of flags that indicate what needs to be stored in the matrix.
Returns
a pointer to a dynamically allocated NLSparseMatrix. It can be later deallocated by nlDeleteMatrix().

◆ nlSparseMatrixNNZ()

NLAPI NLuint_big NLAPIENTRY nlSparseMatrixNNZ ( NLSparseMatrix M)
related

Gets the number of non-zero coefficient in an NLSparseMatrix.

Parameters
[in]Ma pointer to the NLSparseMatrix
Returns
the number of non-zero coefficients in M

◆ nlSparseMatrixSort()

NLAPI void NLAPIENTRY nlSparseMatrixSort ( NLSparseMatrix M)
related

Sorts the coefficients in an NLSParseMatrix.

Parameters
[in,out]Ma pointer to the NLSparseMatrix

◆ nlSparseMatrixZero()

NLAPI void NLAPIENTRY nlSparseMatrixZero ( NLSparseMatrix M)
related

Zeroes an NLSparseMatrix.

The memory is not freed.

Parameters
[in,out]Ma pointer to the NLSparseMatrix to zero

Member Data Documentation

◆ type

NLenum NLSparseMatrix::type

Matrix type.

One of NL_MATRIX_DYNAMIC, NL_MATRIX_CRS, NL_MATRIX_SUPERLU_EXT, NL_CHOLDMOD_MATRIX_EXT

Definition at line 495 of file nl_matrix.h.


The documentation for this struct was generated from the following file: