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

A compact self-contained storage for sparse matrices. More...

#include <geogram/NL/nl_matrix.h>

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.
 
NLdoubleval
 array of coefficient values, size = NNZ (number of non-zero coefficients)
 
NLuint_bigrowptr
 row pointers, size = m+1
 
NLuintcolind
 column indices, size = NNZ
 
NLuint nslices
 number of slices, used by parallel spMv
 
NLuintsliceptr
 slice pointers, size = nslices + 1, used by parallel spMv
 
NLboolean symmetric_storage
 NL_TRUE if symmetric storage is used, NL_FALSE otherwise.
 

Related Functions

(Note that these are not member functions.)

NLAPI void NLAPIENTRY nlCRSMatrixConstruct (NLCRSMatrix *M, NLuint m, NLuint n, NLuint_big nnz, NLuint nslices)
 Constructs a new NLCRSMatrix. More...
 
NLAPI void NLAPIENTRY nlCRSMatrixConstructSymmetric (NLCRSMatrix *M, NLuint n, NLuint_big nnz)
 Constructs a new NLCRSMatrix with symmetric storage. More...
 
NLAPI void NLAPIENTRY nlCRSMatrixConstructPattern (NLCRSMatrix *M, NLuint m, NLuint n)
 Constructs a new NLCRSMatrix with only the pattern. More...
 
NLAPI void NLAPIENTRY nlCRSMatrixConstructPatternSymmetric (NLCRSMatrix *M, NLuint n)
 Constructs a new NLCRSMatrix with symmetric storage. More...
 
NLAPI NLboolean NLAPIENTRY nlCRSMatrixLoad (NLCRSMatrix *M, const char *filename)
 Loads a NLCRSMatrix from a file. More...
 
NLAPI NLboolean NLAPIENTRY nlCRSMatrixSave (NLCRSMatrix *M, const char *filename)
 Saves a NLCRSMatrix into a file. More...
 
NLAPI NLuint_big NLAPIENTRY nlCRSMatrixNNZ (NLCRSMatrix *M)
 Gets the number of non-zero coefficient in an NLCRSMatrix. More...
 
NLAPI NLMatrix NLAPIENTRY nlCRSMatrixNewFromSparseMatrix (NLSparseMatrix *M)
 Creates a compressed row storage matrix from a dynamic sparse matrix. More...
 
NLAPI NLMatrix NLAPIENTRY nlCRSMatrixNewFromSparseMatrixSymmetric (NLSparseMatrix *M)
 Creates a compressed row storage matrix from a dynamic sparse matrix. More...
 

Detailed Description

A compact self-contained storage for sparse matrices.

Unlike with NLSparseMatrix, it is not possible to add new coefficients in an NLCRSMatrix.

Definition at line 278 of file nl_matrix.h.

Friends And Related Function Documentation

◆ nlCRSMatrixConstruct()

NLAPI void NLAPIENTRY nlCRSMatrixConstruct ( NLCRSMatrix M,
NLuint  m,
NLuint  n,
NLuint_big  nnz,
NLuint  nslices 
)
related

Constructs a new NLCRSMatrix.

Parameters
[in,out]Mpointer to an uninitialized NLCRSMatrix
[in]mnumber of rows
[in]nnumber of columns
[in]nnznumber of non-zero coefficientsz
[in]nslicesnumber of slices, used by parallel spMv (typically, nslices = number of cores)

◆ nlCRSMatrixConstructPattern()

NLAPI void NLAPIENTRY nlCRSMatrixConstructPattern ( NLCRSMatrix M,
NLuint  m,
NLuint  n 
)
related

Constructs a new NLCRSMatrix with only the pattern.

This function should be used when the number of coefficients in each row is not known in advance.

Parameters
[in,out]Mpointer to an uninitialized NLCRSMatrix
[in]mnumber of rows
[in]nnumber of columns

◆ nlCRSMatrixConstructPatternSymmetric()

NLAPI void NLAPIENTRY nlCRSMatrixConstructPatternSymmetric ( NLCRSMatrix M,
NLuint  n 
)
related

Constructs a new NLCRSMatrix with symmetric storage.

This function should be used when the number of coefficients in each row is not known in advance.

Parameters
[in,out]Mpointer to an uninitialized NLCRSMatrix
[in]nnumber of rows and columns
[in]nnznumber of non-zero coefficients

◆ nlCRSMatrixConstructSymmetric()

NLAPI void NLAPIENTRY nlCRSMatrixConstructSymmetric ( NLCRSMatrix M,
NLuint  n,
NLuint_big  nnz 
)
related

Constructs a new NLCRSMatrix with symmetric storage.

Parameters
[in,out]Mpointer to an uninitialized NLCRSMatrix
[in]nnumber of rows and columns
[in]nnznumber of non-zero coefficients

◆ nlCRSMatrixLoad()

NLAPI NLboolean NLAPIENTRY nlCRSMatrixLoad ( NLCRSMatrix M,
const char *  filename 
)
related

Loads a NLCRSMatrix from a file.

Parameters
[out]Ma pointer to an uninitialized NLCRSMatriix
[in]filenamethe name of the file
Return values
NL_TRUEon success
NL_FALSEon error

◆ nlCRSMatrixNewFromSparseMatrix()

NLAPI NLMatrix NLAPIENTRY nlCRSMatrixNewFromSparseMatrix ( NLSparseMatrix M)
related

Creates a compressed row storage matrix from a dynamic sparse matrix.

The matrix M should have stored rows. If M has symmetric storage, then the constructed matrix also has symmetric storage.

Parameters
[in]Mthe dynamic sparse matrix.
Returns
a pointer to the created NLCRSMatrix

◆ nlCRSMatrixNewFromSparseMatrixSymmetric()

NLAPI NLMatrix NLAPIENTRY nlCRSMatrixNewFromSparseMatrixSymmetric ( NLSparseMatrix M)
related

Creates a compressed row storage matrix from a dynamic sparse matrix.

The matrix M should have stored rows. It is supposed to be symmetric. If it does not have symmetric storage, then its upper triangular part is ignored.

Parameters
[in]Mthe dynamic sparse matrix.
Returns
a pointer to the created NLCRSMatrix

◆ nlCRSMatrixNNZ()

NLAPI NLuint_big NLAPIENTRY nlCRSMatrixNNZ ( NLCRSMatrix M)
related

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

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

◆ nlCRSMatrixSave()

NLAPI NLboolean NLAPIENTRY nlCRSMatrixSave ( NLCRSMatrix M,
const char *  filename 
)
related

Saves a NLCRSMatrix into a file.

Parameters
[in]Ma pointer to the NLCRSMatriix
[in]filenamethe name of the file
Return values
NL_TRUEon success
NL_FALSEon error

Member Data Documentation

◆ type

NLenum NLCRSMatrix::type

Matrix type.

One of NL_MATRIX_DYNAMIC, NL_MATRIX_CRS, NL_MATRIX_SUPERLU_EXT, NL_CHOLDMOD_MATRIX_EXT

Definition at line 294 of file nl_matrix.h.


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