SparseExpression concept

Description

Refinement of

SparseExpression.

Associated types

nz_reference The type of references to a non-zero

Notation

X Type that is a model of SparseExpression
a Objects of type X
i Object of type X::nnz_type

Definitions

Valid expressions

Name Expression Type requirements Return type
Non-zero access a.nz(i) nz_reference

Expression semantics

Name Expression Precondition Semantics Postcondition
Non-zero access a.nz(i) Returns the i-th non-zero

Complexity guarantees

Invariants

Models

Notes

[1] The nnz_type is not necessarily equal to the size_type. This is particularly true for sparse vectors of very big sizes (for which e.g. a 64bit integer is needed to access the elements) but which is very sparse (and thus where the coordinates of the elements can be stored by means of a 16bit integer).