Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
Gecode::Int::IntVarImp::RangeList Class Reference

Lists of ranges (intervals) More...

#include <var-imp.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 *p, RangeList *n)
 Initialize with minimum min and maximum max and predecessor p 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 (const RangeList *p) const
 Return next element (from previous p)
 
RangeListprev (const RangeList *n) const
 Return previous element (from next n)
 

Update

void min (int n)
 Set minimum to n.
 
void max (int n)
 Set maximum to n.
 
void prevnext (RangeList *p, RangeList *n)
 Set previous element to p and next element to n.
 
void next (RangeList *o, RangeList *n)
 Set next element from o to n.
 
void prev (RangeList *o, RangeList *n)
 Set previous element from o to n.
 
void fix (RangeList *n)
 Restore simple link to next element (so that it becomes a true free list)
 

Memory management

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

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)

Range lists are doubly-linked storing the pointer to both the next and the previous element in a single pointer. That means that the next element is only available when the previous element is supplied as additional information. The same holds true for access to the previous element.

Definition at line 102 of file var-imp.hpp.

Constructor & Destructor Documentation

◆ RangeList() [1/3]

Gecode::Int::IntVarImp::RangeList::RangeList ( void )
inline

Default constructor (noop)

Definition at line 49 of file int.hpp.

◆ RangeList() [2/3]

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

Initialize with minimum min and maximum max.

Definition at line 52 of file int.hpp.

◆ RangeList() [3/3]

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

Initialize with minimum min and maximum max and predecessor p and successor n.

Definition at line 56 of file int.hpp.

Member Function Documentation

◆ min() [1/2]

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

Return minimum.

Definition at line 98 of file int.hpp.

◆ max() [1/2]

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

Return maximum.

Definition at line 102 of file int.hpp.

◆ width()

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

Return width (distance between maximum and minimum)

Definition at line 106 of file int.hpp.

◆ next() [1/2]

IntVarImp::RangeList * Gecode::Int::IntVarImp::RangeList::next ( const RangeList * p) const
inline

Return next element (from previous p)

Definition at line 62 of file int.hpp.

◆ prev() [1/2]

IntVarImp::RangeList * Gecode::Int::IntVarImp::RangeList::prev ( const RangeList * n) const
inline

Return previous element (from next n)

Definition at line 66 of file int.hpp.

◆ min() [2/2]

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

Set minimum to n.

Definition at line 89 of file int.hpp.

◆ max() [2/2]

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

Set maximum to n.

Definition at line 93 of file int.hpp.

◆ prevnext()

void Gecode::Int::IntVarImp::RangeList::prevnext ( RangeList * p,
RangeList * n )
inline

Set previous element to p and next element to n.

Definition at line 70 of file int.hpp.

◆ next() [2/2]

void Gecode::Int::IntVarImp::RangeList::next ( RangeList * o,
RangeList * n )
inline

Set next element from o to n.

Definition at line 74 of file int.hpp.

◆ prev() [2/2]

void Gecode::Int::IntVarImp::RangeList::prev ( RangeList * o,
RangeList * n )
inline

Set previous element from o to n.

Definition at line 79 of file int.hpp.

◆ fix()

void Gecode::Int::IntVarImp::RangeList::fix ( RangeList * n)
inline

Restore simple link to next element (so that it becomes a true free list)

Definition at line 84 of file int.hpp.

◆ dispose() [1/3]

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

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

p must be the pointer to the previous element of this.

Definition at line 134 of file int.hpp.

◆ dispose() [2/3]

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

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

This routine assumes that the list has already been fixed.

Definition at line 145 of file int.hpp.

◆ dispose() [3/3]

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

Free memory for this element.

Definition at line 150 of file int.hpp.

◆ operator new() [1/2]

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

Allocate memory from space.

Definition at line 124 of file int.hpp.

◆ operator new() [2/2]

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

Placement new.

Definition at line 129 of file int.hpp.

◆ operator delete() [1/3]

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

No-op (for exceptions)

Definition at line 112 of file int.hpp.

◆ operator delete() [2/3]

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

No-op (use dispose instead)

Definition at line 115 of file int.hpp.

◆ operator delete() [3/3]

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

No-op (use dispose instead)

Definition at line 119 of file int.hpp.

Member Data Documentation

◆ _min

int Gecode::Int::IntVarImp::RangeList::_min
protected

Minimum of range.

Definition at line 105 of file var-imp.hpp.

◆ _max

int Gecode::Int::IntVarImp::RangeList::_max
protected

Maximum of range.

Definition at line 107 of file var-imp.hpp.


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