Basic Image AlgorithmS Library
2.8.0
|
generic two dimensional psarsly populated rectangular array holding arbitrary data types More...
#include <Base/Common/SparseArray2D.hh>
Classes | |
class | const_iterator |
for const_iterator access todo: derive from std::iterator class(es) More... | |
class | iterator |
for iterator access todo: derive from std::iterator class(es) More... | |
Public Member Functions | |
const_iterator | begin () const |
iterator | begin () |
void | clear () |
frees the memory More... | |
bool | empty () const |
const_iterator | end () const |
iterator | end () |
void | erase (const unsigned row, const unsigned col) |
bool | is_valid (const unsigned row, const unsigned col) const |
unsigned | ncols () const |
unsigned | nrows () const |
unsigned | num_entries () const |
T & | operator() (const unsigned row, const unsigned col) |
checked element access More... | |
const T & | operator() (const unsigned row, const unsigned col) const |
SparseArray2D< T > & | operator= (const SparseArray2D< T > &m) |
copy operator More... | |
void | position (const const_iterator &it, unsigned &row, unsigned &col) const |
void | position (const iterator &it, unsigned &row, unsigned &col) const |
void | resize (const unsigned nrows, const unsigned ncols) |
preserves the content More... | |
unsigned | size () const |
SparseArray2D () | |
SparseArray2D (const unsigned nrows, const unsigned ncols) | |
SparseArray2D (const SparseArray2D< T > &m) | |
~SparseArray2D () | |
Protected Member Functions | |
long long unsigned | Indices2Map_ (const unsigned row, const unsigned col) const |
void | Map2Indices_ (const long long unsigned &map, unsigned &row, unsigned &col) const |
Protected Attributes | |
std::map< long long unsigned, T > | Data_ |
unsigned | Ncols_ |
unsigned | Nrows_ |
Friends | |
std::ostream & | operator (std::ostream &os, const SparseArray2D< T > &t) |
generic two dimensional psarsly populated rectangular array holding arbitrary data types
The syntax of the access functions is kept similar to the stl::classes
Definition at line 34 of file SparseArray2D.hh.
BIAS::SparseArray2D< T >::SparseArray2D | ( | ) |
Definition at line 186 of file SparseArray2D.hh.
BIAS::SparseArray2D< T >::SparseArray2D | ( | const unsigned | nrows, |
const unsigned | ncols | ||
) |
Definition at line 192 of file SparseArray2D.hh.
BIAS::SparseArray2D< T >::SparseArray2D | ( | const SparseArray2D< T > & | m | ) |
Definition at line 201 of file SparseArray2D.hh.
BIAS::SparseArray2D< T >::~SparseArray2D | ( | ) |
Definition at line 207 of file SparseArray2D.hh.
|
inline |
Definition at line 142 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Data_.
|
inline |
Definition at line 152 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Data_.
void BIAS::SparseArray2D< T >::clear | ( | ) |
frees the memory
Definition at line 224 of file SparseArray2D.hh.
|
inline |
Definition at line 69 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Data_, BIAS::SparseArray2D< T >::Ncols_, and BIAS::SparseArray2D< T >::Nrows_.
|
inline |
Definition at line 147 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Data_.
|
inline |
Definition at line 153 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Data_.
void BIAS::SparseArray2D< T >::erase | ( | const unsigned | row, |
const unsigned | col | ||
) |
Definition at line 255 of file SparseArray2D.hh.
|
inlineprotected |
Definition at line 168 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Ncols_.
bool BIAS::SparseArray2D< T >::is_valid | ( | const unsigned | row, |
const unsigned | col | ||
) | const |
Definition at line 246 of file SparseArray2D.hh.
|
inlineprotected |
Definition at line 173 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Ncols_.
Referenced by BIAS::SparseArray2D< T >::position().
|
inline |
Definition at line 72 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Ncols_.
|
inline |
Definition at line 74 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Nrows_.
|
inline |
Definition at line 78 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Data_.
T & BIAS::SparseArray2D< T >::operator() | ( | const unsigned | row, |
const unsigned | col | ||
) |
checked element access
Definition at line 266 of file SparseArray2D.hh.
const T & BIAS::SparseArray2D< T >::operator() | ( | const unsigned | row, |
const unsigned | col | ||
) | const |
Definition at line 276 of file SparseArray2D.hh.
SparseArray2D< T > & BIAS::SparseArray2D< T >::operator= | ( | const SparseArray2D< T > & | m | ) |
copy operator
Definition at line 212 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Data_, BIAS::SparseArray2D< T >::Ncols_, and BIAS::SparseArray2D< T >::Nrows_.
|
inline |
Definition at line 155 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::const_iterator::first(), and BIAS::SparseArray2D< T >::Map2Indices_().
|
inline |
Definition at line 158 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::iterator::first(), and BIAS::SparseArray2D< T >::Map2Indices_().
void BIAS::SparseArray2D< T >::resize | ( | const unsigned | nrows, |
const unsigned | ncols | ||
) |
preserves the content
Definition at line 229 of file SparseArray2D.hh.
|
inline |
Definition at line 76 of file SparseArray2D.hh.
References BIAS::SparseArray2D< T >::Ncols_, and BIAS::SparseArray2D< T >::Nrows_.
|
friend |
|
protected |
Definition at line 165 of file SparseArray2D.hh.
Referenced by BIAS::SparseArray2D< T >::begin(), BIAS::SparseArray2D< T >::empty(), BIAS::SparseArray2D< T >::end(), BIAS::SparseArray2D< T >::num_entries(), and BIAS::SparseArray2D< T >::operator=().
|
protected |
Definition at line 166 of file SparseArray2D.hh.
Referenced by BIAS::SparseArray2D< T >::empty(), BIAS::SparseArray2D< T >::Indices2Map_(), BIAS::SparseArray2D< T >::Map2Indices_(), BIAS::SparseArray2D< T >::ncols(), BIAS::SparseArray2D< T >::operator=(), and BIAS::SparseArray2D< T >::size().
|
protected |
Definition at line 166 of file SparseArray2D.hh.
Referenced by BIAS::SparseArray2D< T >::empty(), BIAS::SparseArray2D< T >::nrows(), BIAS::SparseArray2D< T >::operator=(), and BIAS::SparseArray2D< T >::size().