Geogram  Version 1.9.1
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 NLulong NLAPIENTRY nlCRSMatrixAdd (NLCRSMatrix *M, NLuint i, NLuint j, NLdouble value)
 Adds a coefficient to an NLSparseMatrix. More...
 
NLAPI void NLAPIENTRY nlCRSMatrixAddAt (NLCRSMatrix *M, NLuint i, NLuint j, NLdouble value, NLulong index)
 Adds a coefficient to an NLSparseMatrix at a known location. More...
 
NLAPI void NLAPIENTRY nlCRSMatrixSetCoefficientAtRowOffset (NLCRSMatrix *M, NLuint i, NLuint j, NLdouble value, NLuint row_offset)
 Sets a coefficient to an NLSparseMatrix at a known row offset. 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...
 
Begin/End
NLAPI void NLAPIENTRY nlSetIJCoefficientAtRowOffset (NLuint i, NLuint j, NLdouble value, NLuint row_offset)
 Sets a coefficient to the current matrix at a known row offset. More...
 

Detailed Description

Definition at line 512 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 503 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 497 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 510 of file nl_matrix.h.

◆ nlCRSMatrixAdd()

NLAPI NLulong 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
Returns
the index in the CRS arrays where the value was inserted

◆ nlCRSMatrixAddAt()

NLAPI void NLAPIENTRY nlCRSMatrixAddAt ( NLCRSMatrix M,
NLuint  i,
NLuint  j,
NLdouble  value,
NLulong  index 
)
related

Adds a coefficient to an NLSparseMatrix at a known location.

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
[in]indexthe index in the CRS arrays where the coefficient is stored
Precondition
The coefficient at index index already exists and has column index j

◆ nlCRSMatrixSetCoefficientAtRowOffset()

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

Sets a coefficient to an NLSparseMatrix at a known row offset.

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
[in]row_offsetthe offset of the CRS arrays starting from rowptr[i]
Precondition
The coefficient in row i at row_offset was not previously set

◆ nlSetIJCoefficientAtRowOffset()

NLAPI void NLAPIENTRY nlSetIJCoefficientAtRowOffset ( NLuint  i,
NLuint  j,
NLdouble  value,
NLuint  row_offset 
)
related

Sets a coefficient to the current matrix at a known row offset.

Parameters
[in,out]Ma pointer to an NLSparseMatrix
[in]iindex of the row
[in]jindex of the column
[in]valuethe coefficient to be added
[in]row_offsetthe offset of the CRS arrays starting from rowptr[i]
Precondition
The coefficient in row i at row_offset was not previously set

◆ 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 528 of file nl_matrix.h.


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