Generated on Mon Nov 30 23:53:47 2009 for Gecode by doxygen 1.6.1

Gecode::Space Class Reference

Computation spaces. More...

#include <core.hpp>

List of all members.

Classes

class  Branchers
 Class to iterate over branchers of a space. More...
class  Propagators
 Class to iterate over propagators of a space. More...

Public Member Functions

 Space (void)
 Default constructor.
virtual ~Space (void)
 Destructor.
 Space (bool share, Space &s)
 Constructor for cloning.
virtual Spacecopy (bool share)=0
 Copying member function.
virtual void constrain (const Space &best)
 Constrain function for best solution search.
SpaceStatus status (StatusStatistics &stat=unused_status)
 Query space status.
const Choicechoice (void)
 Create new choice for current brancher.
Spaceclone (bool share=true, CloneStatistics &stat=unused_clone) const
 Clone space.
void commit (const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
 Commit choice c for alternative a.
void notice (Actor &a, ActorProperty p)
 Notice actor property.
void ignore (Actor &a, ActorProperty p)
 Ignore actor property.
void fail (void)
 Fail space.
bool failed (void) const
 Check whether space is failed.
bool stable (void) const
 Return if space is stable (at fixpoint or failed).
unsigned int propagators (void) const
 Return number of propagators.
unsigned int branchers (void) const
 Return number of branchers.
template<class T >
T * alloc (long unsigned int n)
 Allocate block of n objects of type T from space heap.
template<class T >
T * alloc (long int n)
 Allocate block of n objects of type T from space heap.
template<class T >
T * alloc (unsigned int n)
 Allocate block of n objects of type T from space heap.
template<class T >
T * alloc (int n)
 Allocate block of n objects of type T from space heap.
template<class T >
void free (T *b, long unsigned int n)
 Delete n objects allocated from space heap starting at b.
template<class T >
void free (T *b, long int n)
 Delete n objects allocated from space heap starting at b.
template<class T >
void free (T *b, unsigned int n)
 Delete n objects allocated from space heap starting at b.
template<class T >
void free (T *b, int n)
 Delete n objects allocated from space heap starting at b.
template<class T >
T * realloc (T *b, long unsigned int n, long unsigned int m)
 Reallocate block of n objects starting at b to m objects of type T from the space heap.
template<class T >
T * realloc (T *b, long int n, long int m)
 Reallocate block of n objects starting at b to m objects of type T from the space heap.
template<class T >
T * realloc (T *b, unsigned int n, unsigned int m)
 Reallocate block of n objects starting at b to m objects of type T from the space heap.
template<class T >
T * realloc (T *b, int n, int m)
 Reallocate block of n objects starting at b to m objects of type T from the space heap.
template<class T >
T ** realloc (T **b, long unsigned int n, long unsigned int m)
 Reallocate block of n pointers starting at b to m objects of type T* from the space heap.
template<class T >
T ** realloc (T **b, long int n, long int m)
 Reallocate block of n pointers starting at b to m objects of type T* from the space heap.
template<class T >
T ** realloc (T **b, unsigned int n, unsigned int m)
 Reallocate block of n pointers starting at b to m objects of type T* from the space heap.
template<class T >
T ** realloc (T **b, int n, int m)
 Reallocate block of n pointers starting at b to m objects of type T* from the space heap.
void * ralloc (size_t s)
 Allocate memory on space heap.
void rfree (void *p, size_t s)
 Free memory previously allocated with alloc (might be reused later).
void * rrealloc (void *b, size_t n, size_t m)
 Reallocate memory block starting at b from size n to size s.
template<size_t >
void * fl_alloc (void)
 Allocate from freelist-managed memory.
template<size_t >
void fl_dispose (FreeList *f, FreeList *l)
 Return freelist-managed memory to freelist.
size_t allocated (void) const
 Return how much heap memory is allocated.
void flush (void)
 Flush cached memory blocks and AFC information.

Static Public Member Functions

static void * operator new (size_t)
 Allocate memory from heap for new space.
static void operator delete (void *)
 Free memory allocated from heap.

Conversion from Space to Home



Home operator() (Propagator &p)
 Return a home for this space with the information that p is being rewritten.



template<class T >
T & construct (void)
 Construction routines.
template<class T , typename A1 >
T & construct (A1 const &a1)
 Constructs a single object of type T from space heap using a unary constructor.
template<class T , typename A1 , typename A2 >
T & construct (A1 const &a1, A2 const &a2)
 Constructs a single object of type T from space heap using a binary constructor.
template<class T , typename A1 , typename A2 , typename A3 >
T & construct (A1 const &a1, A2 const &a2, A3 const &a3)
 Constructs a single object of type T from space heap using a ternary constructor.
template<class T , typename A1 , typename A2 , typename A3 , typename A4 >
T & construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4)
 Constructs a single object of type T from space heap using a quaternary constructor.
template<class T , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
T & construct (A1 const &a1, A2 const &a2, A3 const &a3, A4 const &a4, A5 const &a5)
 Constructs a single object of type T from space heap using a quinary constructor.

Detailed Description

Computation spaces.

Definition at line 1228 of file core.hpp.


Member Function Documentation

unsigned int Gecode::Space::propagators ( void   )  const

Return number of propagators.

Note that this function takes linear time in the number of propagators.

Definition at line 133 of file core.cpp.

unsigned int Gecode::Space::branchers ( void   )  const

Return number of branchers.

Note that this function takes linear time in the number of branchers.

Definition at line 141 of file core.cpp.

Home Gecode::Space::operator() ( Propagator p  )  [inline]

Return a home for this space with the information that p is being rewritten.

Definition at line 2494 of file core.hpp.

template<class T >
T & Gecode::Space::construct ( void   )  [inline]

Construction routines.

Constructs a single object of type T from space heap using the default constructor.

Definition at line 3547 of file core.hpp.

template<class T , typename A1 >
T & Gecode::Space::construct ( A1 const &  a1  )  [inline]

Constructs a single object of type T from space heap using a unary constructor.

The parameter is passed as a const reference.

Definition at line 3552 of file core.hpp.

template<class T , typename A1 , typename A2 >
T & Gecode::Space::construct ( A1 const &  a1,
A2 const &  a2 
) [inline]

Constructs a single object of type T from space heap using a binary constructor.

The parameters are passed as const references.

Definition at line 3559 of file core.hpp.

template<class T , typename A1 , typename A2 , typename A3 >
T & Gecode::Space::construct ( A1 const &  a1,
A2 const &  a2,
A3 const &  a3 
) [inline]

Constructs a single object of type T from space heap using a ternary constructor.

The parameters are passed as const references.

Definition at line 3566 of file core.hpp.

template<class T , typename A1 , typename A2 , typename A3 , typename A4 >
T & Gecode::Space::construct ( A1 const &  a1,
A2 const &  a2,
A3 const &  a3,
A4 const &  a4 
) [inline]

Constructs a single object of type T from space heap using a quaternary constructor.

The parameters are passed as const references.

Definition at line 3573 of file core.hpp.

template<class T , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 >
T & Gecode::Space::construct ( A1 const &  a1,
A2 const &  a2,
A3 const &  a3,
A4 const &  a4,
A5 const &  a5 
) [inline]

Constructs a single object of type T from space heap using a quinary constructor.

The parameters are passed as const references.

Definition at line 3580 of file core.hpp.


Member Data Documentation

Cost level with next propagator to be executed.

This maintains the following invariant (but only if the space does not perform propagation):

  • If active points to a queue, this queue might contain a propagator. However, there will be at least one queue containing a propagator.
  • Otherwise, active is smaller than the beginning of the queues. Then, the space is stable.
  • If active is NULL, the space is failed.

Definition at line 1281 of file core.hpp.

ActorLink Gecode::Space::queue[PropCost::AC_MAX+1]

Scheduled propagators according to cost.

Definition at line 1283 of file core.hpp.

Id of next brancher to be created.

Definition at line 1285 of file core.hpp.

unsigned int Gecode::Space::n_sub

Number of subscriptions.

Definition at line 1287 of file core.hpp.

struct { ... } Gecode::Space::p

Data only available during propagation.

Reimplemented in Grocery, and TSP.

Entries for updating variables.

Definition at line 1292 of file core.hpp.

Keep variables during copying without index structure.

Definition at line 1294 of file core.hpp.

Linked list of copied objects.

Definition at line 1296 of file core.hpp.

struct { ... } Gecode::Space::c

Data available only during copying.

Reimplemented in EFPA.


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