33 #include "DGtal/base/Bits.h"
46 template <
unsigned int L,
typename TWord>
52 template <
unsigned int L,
typename TWord>
56 : myWordAddress( 0 ), myLabel( 0 )
59 template <
unsigned int L,
typename TWord>
63 : myWordAddress( address + firstWord ),
64 myWordLabel( firstWord * __DGTAL_WORD_NBDIGITS )
66 ASSERT( firstWord <= __DGTAL_LABELS_NBWORDS );
67 if ( firstWord != __DGTAL_LABELS_NBWORDS )
79 template <
unsigned int L,
typename TWord>
83 : myWordAddress( other.myWordAddress ), myWordLabel( other.myWordLabel ),
84 myLabel( other.myLabel ), myWord( other.myWord )
87 template <
unsigned int L,
typename TWord>
103 template <
unsigned int L,
typename TWord>
112 template <
unsigned int L,
typename TWord>
121 template <
unsigned int L,
typename TWord>
127 ASSERT( ( myWordLabel < ( __DGTAL_LABELS_NBWORDS
128 * __DGTAL_WORD_NBDIGITS ) ) );
129 while ( myWord == 0 )
131 myWordLabel += __DGTAL_WORD_NBDIGITS;
132 if ( myWordLabel == ( __DGTAL_LABELS_NBWORDS
133 * __DGTAL_WORD_NBDIGITS ) )
138 myWord = *myWordAddress++;
140 ASSERT( myWord != 0 );
147 template <
unsigned int L,
typename TWord>
158 template <
unsigned int L,
typename TWord>
165 && ( myLabel == other.
myLabel );
168 template <
unsigned int L,
typename TWord>
175 || ( myLabel != other.
myLabel );
181 template <
unsigned int L,
typename TWord>
186 return __DGTAL_LABEL_WORD_INDEX( l );
189 template <
unsigned int L,
typename TWord>
194 return __DGTAL_LABEL_DIGIT_INDEX( l );
197 template <
unsigned int L,
typename TWord>
205 template <
unsigned int L,
typename TWord>
211 template <
unsigned int L,
typename TWord>
218 template <
unsigned int L,
typename TWord>
226 template <
unsigned int L,
typename TWord>
231 if (
this != &other )
237 template <
unsigned int L,
typename TWord>
249 template <
unsigned int L,
typename TWord>
257 template <
unsigned int L,
typename TWord>
269 template <
unsigned int L,
typename TWord>
278 template <
unsigned int L,
typename TWord>
287 template <
unsigned int L,
typename TWord>
301 template <
unsigned int L,
typename TWord>
310 template <
unsigned int L,
typename TWord>
330 ASSERT(
index( labels.back() ) == ( labels.size() - 1 ) );
332 l += __DGTAL_WORD_NBDIGITS;
336 template <
unsigned int L,
typename TWord>
348 return (
_mask( l ) & *p1 )
353 template <
unsigned int L,
typename TWord>
362 template <
unsigned int L,
typename TWord>
379 template <
unsigned int L,
typename TWord>
384 std::vector<Label> v;
390 out <<
"(" << v[ 0 ];
391 for (
SizeType i = 1; i < v.size(); ++i )
392 out <<
"," << v[ i ];
401 template <
unsigned int L,
typename TWord>
414 template <
unsigned int L,
typename TWord>
420 object.selfDisplay( out );