Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0

Range iterator for array of ranges More...

#include <ranges-array.hpp>

Classes

class  Range
 Ranges for array More...

Protected Attributes

Ranger
 Array for ranges.
unsigned int c
 Current range.
unsigned int n
 Number of ranges in array.

Constructors and initialization

 Array (void)
 Default constructor.
 Array (Range *r, unsigned int n)
 Initialize with n ranges from r.
 Array (Range *r, int n)
 Initialize with n ranges from r.
void init (Range *r, unsigned int n)
 Initialize with n ranges from r.
void init (Range *r, int n)
 Initialize with n ranges from r.

Iteration control

bool operator() (void) const
 Test whether iterator is still at a range or done.
void operator++ (void)
 Move iterator to next range (if possible)
void reset (void)
 Reset iterator to start from beginning.

Range access

int min (void) const
 Return smallest value of range.
int max (void) const
 Return largest value of range.
unsigned int width (void) const
 Return width of range (distance between minimum and maximum)

Detailed Description

Range iterator for array of ranges

Allows to iterate the ranges as defined by an array where the ranges must be increasing and non-overlapping. The ranges can be iterated several times provided the iterator is reset by the reset member function.

Definition at line 46 of file ranges-array.hpp.

Constructor & Destructor Documentation

◆ Array() [1/3]

Gecode::Iter::Ranges::Array::Array ( void )
inline

Default constructor.

Definition at line 99 of file ranges-array.hpp.

◆ Array() [2/3]

Gecode::Iter::Ranges::Array::Array ( Range * r,
unsigned int n )
inline

Initialize with n ranges from r.

Definition at line 102 of file ranges-array.hpp.

◆ Array() [3/3]

Gecode::Iter::Ranges::Array::Array ( Range * r,
int n )
inline

Initialize with n ranges from r.

Definition at line 106 of file ranges-array.hpp.

Member Function Documentation

◆ init() [1/2]

void Gecode::Iter::Ranges::Array::init ( Range * r,
unsigned int n )
inline

Initialize with n ranges from r.

Definition at line 110 of file ranges-array.hpp.

◆ init() [2/2]

void Gecode::Iter::Ranges::Array::init ( Range * r,
int n )
inline

Initialize with n ranges from r.

Definition at line 115 of file ranges-array.hpp.

◆ operator()()

bool Gecode::Iter::Ranges::Array::operator() ( void ) const
inline

Test whether iterator is still at a range or done.

Definition at line 124 of file ranges-array.hpp.

◆ operator++()

void Gecode::Iter::Ranges::Array::operator++ ( void )
inline

Move iterator to next range (if possible)

Definition at line 120 of file ranges-array.hpp.

◆ reset()

void Gecode::Iter::Ranges::Array::reset ( void )
inline

Reset iterator to start from beginning.

Definition at line 129 of file ranges-array.hpp.

◆ min()

int Gecode::Iter::Ranges::Array::min ( void ) const
inline

Return smallest value of range.

Definition at line 134 of file ranges-array.hpp.

◆ max()

int Gecode::Iter::Ranges::Array::max ( void ) const
inline

Return largest value of range.

Definition at line 138 of file ranges-array.hpp.

◆ width()

unsigned int Gecode::Iter::Ranges::Array::width ( void ) const
inline

Return width of range (distance between minimum and maximum)

Definition at line 142 of file ranges-array.hpp.

Member Data Documentation

◆ r

Range* Gecode::Iter::Ranges::Array::r
protected

Array for ranges.

Definition at line 56 of file ranges-array.hpp.

◆ c

unsigned int Gecode::Iter::Ranges::Array::c
protected

Current range.

Definition at line 58 of file ranges-array.hpp.

◆ n

unsigned int Gecode::Iter::Ranges::Array::n
protected

Number of ranges in array.

Definition at line 60 of file ranges-array.hpp.


The documentation for this class was generated from the following file: