Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
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.
 
NLCoeffcoeff
 the array of coefficients, with enough space to store capacity coefficients.
 

Related Functions

(Note that these are not member functions.)

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

Detailed Description

Represents a row or a column of a sparse matrix.

Definition at line 151 of file nl_matrix.h.

Friends And Related Function 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

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