DGtal 2.1.0
|
Public Member Functions | |
ArrayXYOfList () | |
void | clear () |
const Value & | value (unsigned int l, unsigned int x, unsigned int y) |
unsigned int | erase (unsigned int l, unsigned int x, unsigned int y) |
void | setValue (const Value &val, unsigned int l, unsigned int x, unsigned int y) |
void | setValueNoNewLabel (const Value &val, unsigned int l, unsigned int x, unsigned int y) |
bool | hasLabel (unsigned int l, unsigned int x, unsigned int y) const |
void | getLabels (std::vector< unsigned int > &labels, unsigned int x, unsigned int y) const |
unsigned int | nbLabels (unsigned int x, unsigned int y) const |
void | display (ostream &, unsigned int, unsigned int, unsigned int) |
unsigned long long | area () const |
Private Types | |
typedef std::pair< DGtal::uint16_t, Value > | MyPair |
typedef std::forward_list< MyPair > | MyList |
typedef MyList::iterator | Iterator |
typedef MyList::const_iterator | ConstIterator |
Private Attributes | |
MyList | _data [X][Y] |
Array[X][Y] of forward_list< pair<L,Value> > Another intermediate approach which favors less memory and more computation time.
Approximately same memory usage or 20% more as LabelledMap (for good values of N and M). Approximately 2 to 4 times slower than LabelledMap for most operations.
Note that 2000*2000*32 takes 216Mb.
Definition at line 256 of file testLabelledMap-benchmark.cpp.
|
private |
Definition at line 260 of file testLabelledMap-benchmark.cpp.
|
private |
Definition at line 259 of file testLabelledMap-benchmark.cpp.
|
private |
Definition at line 258 of file testLabelledMap-benchmark.cpp.
|
private |
Definition at line 257 of file testLabelledMap-benchmark.cpp.
|
inline |
Definition at line 265 of file testLabelledMap-benchmark.cpp.
|
inline |
Definition at line 379 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::nbLabels().
|
inline |
Definition at line 270 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data, and ArrayXYOfList< Value, L, X, Y >::clear().
Referenced by ArrayXYOfList< Value, L, X, Y >::clear().
|
inline |
Definition at line 374 of file testLabelledMap-benchmark.cpp.
|
inline |
Definition at line 291 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data.
|
inline |
Definition at line 352 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data.
|
inline |
Definition at line 341 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data.
|
inline |
Definition at line 364 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data.
Referenced by ArrayXYOfList< Value, L, X, Y >::area().
|
inline |
Definition at line 309 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data.
|
inline |
Definition at line 325 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data.
|
inline |
Definition at line 278 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfList< Value, L, X, Y >::_data.
|
private |
Definition at line 261 of file testLabelledMap-benchmark.cpp.
Referenced by ArrayXYOfList< Value, L, X, Y >::clear(), ArrayXYOfList< Value, L, X, Y >::erase(), ArrayXYOfList< Value, L, X, Y >::getLabels(), ArrayXYOfList< Value, L, X, Y >::hasLabel(), ArrayXYOfList< Value, L, X, Y >::nbLabels(), ArrayXYOfList< Value, L, X, Y >::setValue(), ArrayXYOfList< Value, L, X, Y >::setValueNoNewLabel(), and ArrayXYOfList< Value, L, X, Y >::value().