Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0

Value iterator for array of integers More...

#include <values-array.hpp>

Protected Attributes

int * v
 Array for values.
 
unsigned int c
 Current value.
 
unsigned int n
 Number of values in array.
 

Constructors and initialization

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

Iteration control

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

Value access

int val (void) const
 Return current value.
 

Detailed Description

Value iterator for array of integers

Allows to iterate the integers as defined by an array where the values in the array must be sorted in increasing order. The integers can be iterated several times provided the iterator is reset by the reset member function.

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

Constructor & Destructor Documentation

◆ Array() [1/3]

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

Default constructor.

Definition at line 88 of file values-array.hpp.

◆ Array() [2/3]

Gecode::Iter::Values::Array::Array ( int * v,
unsigned int n )
inline

Initialize with n values from v.

Definition at line 91 of file values-array.hpp.

◆ Array() [3/3]

Gecode::Iter::Values::Array::Array ( int * v,
int n )
inline

Initialize with n values from v.

Definition at line 95 of file values-array.hpp.

Member Function Documentation

◆ init() [1/2]

void Gecode::Iter::Values::Array::init ( int * v,
unsigned int n )
inline

Initialize with n ranges from v.

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

◆ init() [2/2]

void Gecode::Iter::Values::Array::init ( int * v,
int n )
inline

Initialize with n ranges from v.

Definition at line 104 of file values-array.hpp.

◆ operator()()

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

Test whether iterator is still at a value or done.

Definition at line 113 of file values-array.hpp.

◆ operator++()

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

Move iterator to next value (if possible)

Definition at line 109 of file values-array.hpp.

◆ reset()

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

Reset iterator to start from beginning.

Definition at line 117 of file values-array.hpp.

◆ val()

int Gecode::Iter::Values::Array::val ( void ) const
inline

Return current value.

Definition at line 122 of file values-array.hpp.

Member Data Documentation

◆ v

int* Gecode::Iter::Values::Array::v
protected

Array for values.

Definition at line 49 of file values-array.hpp.

◆ c

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

Current value.

Definition at line 51 of file values-array.hpp.

◆ n

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

Number of values in array.

Definition at line 53 of file values-array.hpp.


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