31#if defined(Labels_RECURSES)
32#error Recursive header files inclusion detected in Labels.h
35#define Labels_RECURSES
45#include "DGtal/base/Common.h"
46#include "DGtal/kernel/CUnsignedNumber.h"
47#include "DGtal/kernel/CIntegralNumber.h"
70 template <
unsigned int L,
typename TWord = DGtal::u
int8_t>
83#define __DGTAL_WORD_NBDIGITS ( sizeof( Word ) * 8 )
84#define __DGTAL_LABELS_NBWORDS ( (L-1) / __DGTAL_WORD_NBDIGITS + 1 )
85#define __DGTAL_LABEL_WORD_INDEX( label ) ( label / __DGTAL_WORD_NBDIGITS )
86#define __DGTAL_LABEL_DIGIT_INDEX( label ) ( label % __DGTAL_WORD_NBDIGITS )
334 template <
unsigned int L,
typename TWord>
343#include "DGtal/base/Labels.ih"
350#undef Labels_RECURSES
std::ptrdiff_t DifferenceType
only positive offsets allowed.
bool operator!=(const Self &other) const
Reference operator*() const
Pointer operator->() const
Self & operator=(const Self &other)
const Word * myWordAddress
current address of word
DifferenceType difference_type
ConstEnumerator(const Word *address, SizeType firstWord)
Word myWord
current word (modified until 0).
Label myLabel
current label
bool operator==(const Self &other) const
Label myWordLabel
index of first label of the current word.
std::forward_iterator_tag iterator_category
ConstEnumerator(const ConstEnumerator &other)
Aim: Stores a set of labels in {O..L-1} as a sequence of bits.
ConstIterator end() const
static SizeType _digit(Label l)
Returns the bit at which is the label l.
BOOST_CONCEPT_ASSERT((concepts::CUnsignedNumber< TWord >))
ConstIterator const_iterator
void selfDisplay(std::ostream &out) const
SizeType index(Label l) const
ConstIterator begin() const
ConstEnumerator ConstIterator
Self & operator=(const Self &other)
Word myLabels[__DGTAL_LABELS_NBWORDS]
Stores the labels as bits. The bit of index l is set if l is in the set.
void getLabels(std::vector< Label > &labels) const
BOOST_CONCEPT_ASSERT((concepts::CIntegralNumber< TWord >))
static SizeType _word(Label l)
Returns the word in which is the label l.
Self & set(Label l, bool val=true)
static Word _mask(Label l)
Returns the mask for the label l (1 << _digit( l )).
Labels(const Self &other)
BOOST_STATIC_ASSERT((L >=1))
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: Concept checking for Integral Numbers. Models of this concept should be listed in NumberTraits c...
Aim: Concept checking for Unsigned numbers. Models of this concept should be listed in NumberTraits c...