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

Lists of ranges (intervals) More...

#include <range-list.hpp>

Protected Attributes

int _min
 Minimum of range.
 
int _max
 Maximum of range.
 
- Protected Attributes inherited from Gecode::FreeList
FreeList_next
 Pointer to next freelist object.
 

Constructors

 RangeList (void)
 Default constructor (noop)
 
 RangeList (int min, int max)
 Initialize with minimum min and maximum max.
 
 RangeList (int min, int max, RangeList *n)
 Initialize with minimum min and maximum max and successor n.
 

Access

int min (void) const
 Return minimum.
 
int max (void) const
 Return maximum.
 
unsigned int width (void) const
 Return width (distance between maximum and minimum)
 
RangeListnext (void) const
 Return next element.
 
RangeList ** nextRef (void)
 Return pointer to next element.
 

Update

void min (int n)
 Set minimum to n.
 
void max (int n)
 Set maximum to n.
 
void next (RangeList *n)
 Set next range to n.
 

Memory management

void dispose (Space &home, RangeList *l)
 Free memory for all elements between this and l (inclusive)
 
void dispose (Space &home)
 Free memory for all elements reachable from this.
 
static void * operator new (size_t s, Space &home)
 Allocate memory from space.
 
static void * operator new (size_t s, void *p)
 Placement-new operator (noop)
 
static void operator delete (void *)
 No-op (for exceptions)
 
static void operator delete (void *, Space &home)
 No-op (use dispose instead)
 
static void operator delete (void *, void *)
 No-op (use dispose instead)
 

Iterator operations

template<class Iter >
static void copy (Space &home, RangeList *&r, Iter &i)
 Create rangelist r from range iterator i.
 
template<class Iter >
static void overwrite (Space &home, RangeList *&r, Iter &i)
 Overwrite rangelist r with ranges from range iterator i.
 
template<class I >
static void insert (Space &home, RangeList *&r, I &i)
 Insert (as union) ranges from iterator i into r.
 

Additional Inherited Members

- Public Member Functions inherited from Gecode::FreeList
 FreeList (void)
 Use uninitialized.
 
 FreeList (FreeList *n)
 Initialize with next freelist object n.
 
FreeListnext (void) const
 Return next freelist object.
 
FreeList ** nextRef (void)
 Return pointer to next link in freelist object.
 
void next (FreeList *n)
 Set next freelist object to n.
 

Detailed Description

Lists of ranges (intervals)

This class implements a simple datastructure for storing sets of integers as lists of ranges (intervals). Memory is managed as space-allocated free lists.

Definition at line 49 of file range-list.hpp.

Constructor & Destructor Documentation

◆ RangeList() [1/3]

Gecode::RangeList::RangeList ( void )
inline

Default constructor (noop)

Definition at line 130 of file range-list.hpp.

◆ RangeList() [2/3]

Gecode::RangeList::RangeList ( int min,
int max )
inline

Initialize with minimum min and maximum max.

Definition at line 137 of file range-list.hpp.

◆ RangeList() [3/3]

Gecode::RangeList::RangeList ( int min,
int max,
RangeList * n )
inline

Initialize with minimum min and maximum max and successor n.

Definition at line 133 of file range-list.hpp.

Member Function Documentation

◆ min() [1/2]

int Gecode::RangeList::min ( void ) const
inline

Return minimum.

Definition at line 164 of file range-list.hpp.

◆ max() [1/2]

int Gecode::RangeList::max ( void ) const
inline

Return maximum.

Definition at line 168 of file range-list.hpp.

◆ width()

unsigned int Gecode::RangeList::width ( void ) const
inline

Return width (distance between maximum and minimum)

Definition at line 172 of file range-list.hpp.

◆ next() [1/2]

RangeList * Gecode::RangeList::next ( void ) const
inline

Return next element.

Definition at line 141 of file range-list.hpp.

◆ nextRef()

RangeList ** Gecode::RangeList::nextRef ( void )
inline

Return pointer to next element.

Definition at line 146 of file range-list.hpp.

◆ min() [2/2]

void Gecode::RangeList::min ( int n)
inline

Set minimum to n.

Definition at line 151 of file range-list.hpp.

◆ max() [2/2]

void Gecode::RangeList::max ( int n)
inline

Set maximum to n.

Definition at line 155 of file range-list.hpp.

◆ next() [2/2]

void Gecode::RangeList::next ( RangeList * n)
inline

Set next range to n.

Definition at line 159 of file range-list.hpp.

◆ copy()

template<class Iter >
void Gecode::RangeList::copy ( Space & home,
RangeList *& r,
Iter & i )
inlinestatic

Create rangelist r from range iterator i.

Definition at line 215 of file range-list.hpp.

◆ overwrite()

template<class Iter >
void Gecode::RangeList::overwrite ( Space & home,
RangeList *& r,
Iter & i )
inlinestatic

Overwrite rangelist r with ranges from range iterator i.

Definition at line 228 of file range-list.hpp.

◆ insert()

template<class I >
void Gecode::RangeList::insert ( Space & home,
RangeList *& r,
I & i )
inlinestatic

Insert (as union) ranges from iterator i into r.

Definition at line 257 of file range-list.hpp.

◆ dispose() [1/2]

void Gecode::RangeList::dispose ( Space & home,
RangeList * l )
inline

Free memory for all elements between this and l (inclusive)

Definition at line 201 of file range-list.hpp.

◆ dispose() [2/2]

void Gecode::RangeList::dispose ( Space & home)
inline

Free memory for all elements reachable from this.

Definition at line 206 of file range-list.hpp.

◆ operator new() [1/2]

void * Gecode::RangeList::operator new ( size_t s,
Space & home )
inlinestatic

Allocate memory from space.

Definition at line 191 of file range-list.hpp.

◆ operator new() [2/2]

void * Gecode::RangeList::operator new ( size_t s,
void * p )
inlinestatic

Placement-new operator (noop)

Definition at line 196 of file range-list.hpp.

◆ operator delete() [1/3]

void Gecode::RangeList::operator delete ( void * )
inlinestatic

No-op (for exceptions)

Definition at line 178 of file range-list.hpp.

◆ operator delete() [2/3]

void Gecode::RangeList::operator delete ( void * ,
Space & home )
inlinestatic

No-op (use dispose instead)

Definition at line 181 of file range-list.hpp.

◆ operator delete() [3/3]

void Gecode::RangeList::operator delete ( void * ,
void *  )
inlinestatic

No-op (use dispose instead)

Definition at line 186 of file range-list.hpp.

Member Data Documentation

◆ _min

int Gecode::RangeList::_min
protected

Minimum of range.

Definition at line 52 of file range-list.hpp.

◆ _max

int Gecode::RangeList::_max
protected

Maximum of range.

Definition at line 54 of file range-list.hpp.


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