DGtal 2.1.0
|
Public Member Functions | |
ArrayXYOfLabelledMap () | |
const Value & | value (unsigned int l, unsigned int x, unsigned int y) const |
void | setValue (const Value &val, unsigned int l, unsigned int x, unsigned int y) |
unsigned int | erase (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 x, unsigned int y) |
unsigned long long | area () const |
Private Types | |
typedef LabelledMap< Value, L, TWord, N, M > | MyLabelledMap |
Private Attributes | |
MyLabelledMap | _data [X][Y] |
Array[X][Y] of LabelledMap<L>
The proposed alternative to the brute-force approach. Generally less than 10 times the memory used by brute force for L >= 16. Approximately 50% slower in most operations, except initialization or used of all labels. In this case outperforms Array[L][X][Y].
Note that 4000*4000*16 is fine on my 8Gb laptop (529Mb). Note that 2000*2000*64 takes 133Mb.
Definition at line 412 of file testLabelledMap-benchmark.cpp.
|
private |
Definition at line 413 of file testLabelledMap-benchmark.cpp.
|
inline |
Definition at line 418 of file testLabelledMap-benchmark.cpp.
|
inline |
Definition at line 468 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::nbLabels().
|
inline |
Definition at line 462 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data.
|
inline |
Definition at line 433 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data, and DGtal::LabelledMap< TData, L, TWord, N, M >::erase().
|
inline |
Definition at line 451 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data, DGtal::Labels< L, TWord >::getLabels(), and DGtal::LabelledMap< TData, L, TWord, N, M >::labels().
|
inline |
Definition at line 445 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data, and DGtal::LabelledMap< TData, L, TWord, N, M >::count().
|
inline |
Definition at line 458 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data, and DGtal::LabelledMap< TData, L, TWord, N, M >::size().
Referenced by ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::area().
|
inline |
Definition at line 427 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data.
|
inline |
Definition at line 439 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data, and DGtal::LabelledMap< TData, L, TWord, N, M >::fastAt().
|
inline |
Definition at line 421 of file testLabelledMap-benchmark.cpp.
References ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::_data, and DGtal::LabelledMap< TData, L, TWord, N, M >::fastAt().
|
private |
Definition at line 414 of file testLabelledMap-benchmark.cpp.
Referenced by ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::display(), ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::erase(), ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::getLabels(), ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::hasLabel(), ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::nbLabels(), ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::setValue(), ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::setValueNoNewLabel(), and ArrayXYOfLabelledMap< Value, L, X, Y, TWord, N, M >::value().