Geogram Version 1.9.2
A programming library of geometric algorithms
Loading...
Searching...
No Matches
NLRowColumn Struct Reference

Represents a row or a column of a sparse matrix. More...

#include <geogram/NL/nl_matrix.h>

Public Attributes

NLuint size
 number of coefficients.
 
NLuint capacity
 number of coefficients that can be stored without reallocating memory.
 
NLCoeff * coeff
 the array of coefficients, with enough space to store capacity coefficients.
 

Related Symbols

(Note that these are not member symbols.)

NLAPI void NLAPIENTRY nlRowColumnConstruct (NLRowColumn *c)
 Constructs a new NLRowColumn.
 
NLAPI void NLAPIENTRY nlRowColumnDestroy (NLRowColumn *c)
 Destroys a NLRowColumn.
 
NLAPI void NLAPIENTRY nlRowColumnGrow (NLRowColumn *c)
 Allocates additional storage for the coefficients of an NLRowColumn.
 
NLAPI void NLAPIENTRY nlRowColumnAdd (NLRowColumn *c, NLuint index, NLdouble value)
 Adds a coefficient to an NLRowColumn.
 
NLAPI void NLAPIENTRY nlRowColumnAppend (NLRowColumn *c, NLuint index, NLdouble value)
 Appends a coefficient to an NLRowColumn .
 
NLAPI void NLAPIENTRY nlRowColumnZero (NLRowColumn *c)
 Zeroes an NLRowColumn.
 
NLAPI void NLAPIENTRY nlRowColumnClear (NLRowColumn *c)
 Zeroes an NLRowColumn and deallocates the memory used by the NLRowColumn.
 
NLAPI void NLAPIENTRY nlRowColumnSort (NLRowColumn *c)
 Sorts the coefficients of an NLRowColumn by increasing index.
 

Detailed Description

Represents a row or a column of a sparse matrix.

Definition at line 151 of file nl_matrix.h.

Friends And Related Symbol Documentation

◆ nlRowColumnAdd()

NLAPI void NLAPIENTRY nlRowColumnAdd ( NLRowColumn *  c,
NLuint  index,
NLdouble  value 
)
related

Adds a coefficient to an NLRowColumn.

Performs the following operation: \( a_i \leftarrow a_i + value \). If the NLRowColumn already has a coefficient with index index, then the value is added to that coefficient, else a new coefficient is created. Additional storage is allocated as need be.

Parameters
[in,out]ca pointer to an NLRowColumn
[in]indexindex of the coefficient
[in]valuevalue of the coefficient

◆ nlRowColumnAppend()

NLAPI void NLAPIENTRY nlRowColumnAppend ( NLRowColumn *  c,
NLuint  index,
NLdouble  value 
)
related

Appends a coefficient to an NLRowColumn .

In contrast with nlRowColumnAdd(), this function does not tests whether a coefficient with index index already exists in the NLRowColumn. A new coefficient is always created.

Parameters
[in,out]ca pointer to an NLRowColumn
[in]indexindex of the coefficient
[in]valuevalue of the coefficient

◆ nlRowColumnClear()

NLAPI void NLAPIENTRY nlRowColumnClear ( NLRowColumn *  c)
related

Zeroes an NLRowColumn and deallocates the memory used by the NLRowColumn.

On exit, capacity is zeroed

Parameters
[in,out]ca pointer to an NLRowColumn

◆ nlRowColumnConstruct()

NLAPI void NLAPIENTRY nlRowColumnConstruct ( NLRowColumn *  c)
related

Constructs a new NLRowColumn.

Parameters
[in,out]ca pointer to an uninitialized NLRowColumn

◆ nlRowColumnDestroy()

NLAPI void NLAPIENTRY nlRowColumnDestroy ( NLRowColumn *  c)
related

Destroys a NLRowColumn.

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

Parameters
[in,out]ca pointer to an NLRowColumn

◆ nlRowColumnGrow()

NLAPI void NLAPIENTRY nlRowColumnGrow ( NLRowColumn *  c)
related

Allocates additional storage for the coefficients of an NLRowColumn.

Operates like the class vector of the C++ standard library, by doubling the capacity each time it is needed. This amortizes the cost of the growing operations as compared to re-allocating at each element insertion

Parameters
[in,out]ca pointer to an NLRowColumn

◆ nlRowColumnSort()

NLAPI void NLAPIENTRY nlRowColumnSort ( NLRowColumn *  c)
related

Sorts the coefficients of an NLRowColumn by increasing index.

Parameters
[in,out]ca pointer to an NLRowColumn

◆ nlRowColumnZero()

NLAPI void NLAPIENTRY nlRowColumnZero ( NLRowColumn *  c)
related

Zeroes an NLRowColumn.

No memory is deallocated, the capacity remains the same.

Parameters
[in,out]ca pointer to an NLRowColumn

Member Data Documentation

◆ capacity

NLuint NLRowColumn::capacity

number of coefficients that can be stored without reallocating memory.

Definition at line 161 of file nl_matrix.h.

◆ coeff

NLCoeff* NLRowColumn::coeff

the array of coefficients, with enough space to store capacity coefficients.

Definition at line 167 of file nl_matrix.h.

◆ size

NLuint NLRowColumn::size

number of coefficients.

Definition at line 155 of file nl_matrix.h.


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