CMR
1.3.0
|
Matrix data, row-wise or column-wise. More...
#include <matrix.hpp>
Public Member Functions | |
Data () | |
Default constructor. More... | |
Data (Data &&other) | |
Move constructor. More... | |
Data (const Data &other) | |
Copy constructor. More... | |
Data & | operator= (Data &&other) |
Move operator. More... | |
Data & | operator= (const Data &other) |
Assignment operator. More... | |
~Data ()=default | |
Destructor. More... | |
void | constructFromTransposed (const Data &transposedData, Index numMinor) |
Computes the transpose version of data . numMinor is the new number of minor indices. More... | |
void | ensureConsistency (Index numMinor=std::numeric_limits< Index >::max()) const |
Checks for consistency, raising a std::runtime_error if inconsistent. More... | |
void | swap (Data &other) |
Swaps data with other . More... | |
std::size_t | find (Index major, Index minor) const |
Finds entry major ,minor . More... | |
void | sort () |
Sort data by minor. More... | |
Public Attributes | |
std::vector< std::pair< Index, Index > > | range |
Array that maps a major to its nonzero range specified by first and beyond entries. More... | |
std::vector< std::pair< Index, Value > > | entries |
Array that maps the nonzero indices to pairs of minor index and value. More... | |
bool | isSorted |
Whether the data is sorted by minor. More... | |
Matrix data, row-wise or column-wise.
Matrix data, row-wise or column-wise. The term major refers to the rows if it is a row-wise view and to columns otherwise. The term minor refers to the opposite.
|
inline |
Default constructor.
|
inline |
Move constructor.
|
inline |
Copy constructor.
|
default |
Destructor.
|
inline |
Computes the transpose version of data
. numMinor
is the new number of minor indices.
|
inline |
Checks for consistency, raising a std::runtime_error if inconsistent.
|
inline |
Finds entry major
,minor
.
Find entry major
,minor
. If it exists, the index of the entry is returned, and std::numeric_limits<std::size_t>::max()
otherwise.
|
inline |
Assignment operator.
|
inline |
Move operator.
|
inline |
Sort data by minor.
|
inline |
Swaps data with other
.
std::vector<std::pair<Index, Value> > tu::SparseMatrix< V >::Data::entries |
Array that maps the nonzero indices to pairs of minor index and value.
bool tu::SparseMatrix< V >::Data::isSorted |
Whether the data is sorted by minor.
std::vector<std::pair<Index, Index> > tu::SparseMatrix< V >::Data::range |
Array that maps a major to its nonzero range specified by first and beyond entries.