DGtal 1.4.0
|
Aim: More...
#include <DGtal/kernel/IntegralIntervals.h>
Public Types | |
typedef TInteger | Integer |
using | Self = IntegralIntervals< Integer > |
using | Interval = std::pair<Integer,Integer> |
using | Container = std::vector< Interval > |
using | Size = std::size_t |
using | CIterator = typename Container::iterator |
using | IntegerRange = std::vector< Integer > |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CBoundedNumber< TInteger >)) | |
IntegralIntervals ()=default | |
Default Constructor. | |
IntegralIntervals (const Self &other)=default | |
IntegralIntervals (Self &&other)=default | |
Self & | operator= (const Self &other)=default |
Self & | operator= (Self &&other)=default |
template<typename InputIterator > | |
IntegralIntervals (InputIterator it, InputIterator itE) | |
void | clear () |
Clears the data structure. | |
Container & | data () |
const Container & | data () const |
bool | empty () const |
Size | size () const |
Size | capacity () const |
bool | isConvex () const |
std::set< Integer > | integerSet () const |
std::vector< Integer > | integerVector () const |
Size | count (Integer x) const |
void | insert (Integer i) |
void | insert (Integer f, Integer l) |
void | insert (const Interval &I) |
void | erase (Integer i) |
void | erase (Integer f, Integer l) |
void | erase (const Interval &I) |
Self & | add (const Self &other) |
Self & | subtract (const Self &other) |
Self | set_union (const Self &other) const |
Self | set_difference (const Self &other) const |
Self | set_intersection (const Self &other) const |
Self | set_symmetric_difference (const Self &other) const |
Self | starOfPoints () const |
Self | starOfCells () const |
IntegerRange | extremaOfCells () const |
bool | includes (const Self &other) const |
bool | equals (const Self &other) const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Protected Member Functions | |
void | extend (CIterator it) |
CIterator | lowerBound (Integer x) |
Protected Attributes | |
Container | myData |
The sorted sequence of integral intervals. | |
Aim:
Description of template class 'IntegralIntervals'
A class that represents a set of integers using intervals. For instance the set X={-3,-2,0,1,2,4,7,8} is represented as the sorted vector ((-3,-2),(0,2),(4,4),(7,8)).
Inserting -1 into X induced the sorted vector ((-3,2),(4,4),(7,8)).
TInteger | any model of concepts::CBoundedNumber, for instance int, long, etc |
Definition at line 62 of file IntegralIntervals.h.
using DGtal::IntegralIntervals< TInteger >::CIterator = typename Container::iterator |
Definition at line 72 of file IntegralIntervals.h.
using DGtal::IntegralIntervals< TInteger >::Container = std::vector< Interval > |
Definition at line 70 of file IntegralIntervals.h.
typedef TInteger DGtal::IntegralIntervals< TInteger >::Integer |
Definition at line 67 of file IntegralIntervals.h.
using DGtal::IntegralIntervals< TInteger >::IntegerRange = std::vector< Integer > |
Definition at line 73 of file IntegralIntervals.h.
using DGtal::IntegralIntervals< TInteger >::Interval = std::pair<Integer,Integer> |
Definition at line 69 of file IntegralIntervals.h.
using DGtal::IntegralIntervals< TInteger >::Self = IntegralIntervals< Integer > |
Definition at line 68 of file IntegralIntervals.h.
using DGtal::IntegralIntervals< TInteger >::Size = std::size_t |
Definition at line 71 of file IntegralIntervals.h.
|
default |
Default Constructor.
|
default |
Copy constructor
other | any other object. |
|
default |
Move constructor
other | any other object. |
|
inline |
Constructor from range
InputIterator | the type of forward iterator on a range of integer values. |
it,itE | the range of integer values. |
Definition at line 100 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::insert().
|
inline |
Performs the union of set other with this object.
other | any intervals |
Definition at line 301 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::insert(), and DGtal::IntegralIntervals< TInteger >::myData.
Referenced by DGtal::IntegralIntervals< TInteger >::set_symmetric_difference(), and DGtal::IntegralIntervals< TInteger >::set_union().
DGtal::IntegralIntervals< TInteger >::BOOST_CONCEPT_ASSERT | ( | (concepts::CBoundedNumber< TInteger >) | ) |
|
inline |
Definition at line 138 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Clears the data structure.
Definition at line 119 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
x | any integer |
Definition at line 170 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::empty(), and DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Definition at line 122 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
Referenced by DGtal::LatticeSetByIntervals< TSpace >::skeletonOfCells().
|
inline |
Definition at line 124 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Definition at line 127 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
Referenced by DGtal::IntegralIntervals< TInteger >::count(), and DGtal::IntegralIntervals< TInteger >::lowerBound().
|
inline |
other | any other integral set represented by intervals |
Definition at line 441 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Erases the interval of integers from the sequence
I | any valid interval (I.first <= I.second) |
Definition at line 257 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Erases the interval of integers from the sequence
f,l | any valid interval (f <= l) |
Definition at line 250 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::erase().
|
inline |
Erases the integer i from the sequence
i | any integer |
Definition at line 244 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::erase().
Referenced by DGtal::IntegralIntervals< TInteger >::erase(), DGtal::IntegralIntervals< TInteger >::erase(), and DGtal::IntegralIntervals< TInteger >::subtract().
|
inlineprotected |
At the given iterator position the current interval may overlap with the following ones. Merge them.
it | any position |
Definition at line 487 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
Referenced by DGtal::IntegralIntervals< TInteger >::insert().
|
inline |
Definition at line 409 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
other | any other integral set represented by intervals |
Definition at line 426 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Inserts the interval of integers into the sequence
I | any valid interval (I.first <= I.second) |
Definition at line 208 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::extend(), DGtal::IntegralIntervals< TInteger >::lowerBound(), and DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Inserts the interval of integers into the sequence
f,l | any valid interval (f <= l) |
Definition at line 201 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::insert().
|
inline |
Inserts the integer i into the sequence
i | any integer |
Definition at line 194 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::insert().
Referenced by DGtal::IntegralIntervals< TInteger >::add(), DGtal::IntegralIntervals< TInteger >::insert(), DGtal::IntegralIntervals< TInteger >::insert(), and DGtal::IntegralIntervals< TInteger >::IntegralIntervals().
|
inline |
Definition at line 150 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Definition at line 159 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Definition at line 144 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Definition at line 469 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inlineprotected |
x | any integer |
Definition at line 511 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::empty(), and DGtal::IntegralIntervals< TInteger >::myData.
Referenced by DGtal::IntegralIntervals< TInteger >::insert().
|
default |
Assignment
other | any other object. |
|
default |
Move assignment
other | any other object. |
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 460 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Performs the set difference between this and other.
other | any other integral set represented by intervals |
Definition at line 331 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::subtract().
|
inline |
Performs the set intersection between this and other.
other | any other integral set represented by intervals |
Definition at line 341 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::set_symmetric_difference(), DGtal::IntegralIntervals< TInteger >::set_union(), and DGtal::IntegralIntervals< TInteger >::subtract().
|
inline |
Performs the set symmetric difference between this and other.
other | any other integral set represented by intervals |
Definition at line 351 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::add(), and DGtal::IntegralIntervals< TInteger >::subtract().
Referenced by DGtal::IntegralIntervals< TInteger >::set_intersection().
|
inline |
Performs the set union between this and other.
other | any other integral set represented by intervals |
Definition at line 321 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::add().
Referenced by DGtal::IntegralIntervals< TInteger >::set_intersection().
|
inline |
Definition at line 130 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::myData.
|
inline |
Consider the set of integers as cells represented by their Khalimsky coordinates, and build their star.
Definition at line 381 of file IntegralIntervals.h.
References DGtal::R.
|
inline |
Consider the set of integers as points, transform them into pointels inn Khalimsky coordinates and build their star. All integers are multiplied by two. All doubled integers are completed with their immediately inferior and superior value.
Definition at line 366 of file IntegralIntervals.h.
References DGtal::R.
|
inline |
Subtract set other from this object.
other | any intervals |
Definition at line 311 of file IntegralIntervals.h.
References DGtal::IntegralIntervals< TInteger >::erase(), and DGtal::IntegralIntervals< TInteger >::myData.
Referenced by DGtal::IntegralIntervals< TInteger >::set_difference(), DGtal::IntegralIntervals< TInteger >::set_intersection(), and DGtal::IntegralIntervals< TInteger >::set_symmetric_difference().
|
protected |
The sorted sequence of integral intervals.
Definition at line 539 of file IntegralIntervals.h.
Referenced by DGtal::IntegralIntervals< TInteger >::add(), DGtal::IntegralIntervals< TInteger >::capacity(), DGtal::IntegralIntervals< TInteger >::clear(), DGtal::IntegralIntervals< TInteger >::count(), DGtal::IntegralIntervals< TInteger >::data(), DGtal::IntegralIntervals< TInteger >::data(), DGtal::IntegralIntervals< TInteger >::empty(), DGtal::IntegralIntervals< TInteger >::equals(), DGtal::IntegralIntervals< TInteger >::erase(), DGtal::IntegralIntervals< TInteger >::extend(), DGtal::IntegralIntervals< TInteger >::extremaOfCells(), DGtal::IntegralIntervals< TInteger >::includes(), DGtal::IntegralIntervals< TInteger >::insert(), DGtal::IntegralIntervals< TInteger >::integerSet(), DGtal::IntegralIntervals< TInteger >::integerVector(), DGtal::IntegralIntervals< TInteger >::isConvex(), DGtal::IntegralIntervals< TInteger >::isValid(), DGtal::IntegralIntervals< TInteger >::lowerBound(), DGtal::IntegralIntervals< TInteger >::selfDisplay(), DGtal::IntegralIntervals< TInteger >::size(), and DGtal::IntegralIntervals< TInteger >::subtract().