Generated on Mon Sep 22 2014 12:49:37 for Gecode by doxygen 1.8.7
Gecode::Space Class Referenceabstract

Computation spaces. More...

#include <core.hpp>

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. More...
 
virtual ~Space (void)
 Destructor. More...
 
 Space (bool share, Space &s)
 Constructor for cloning. More...
 
virtual Spacecopy (bool share)=0
 Copying member function. More...
 
virtual void constrain (const Space &best)
 Constrain function for best solution search. More...
 
virtual void master (unsigned long int i, const Space *s, NoGoods &ng)
 Master configuration function for restart meta search engine. More...
 
virtual void slave (unsigned long int i, const Space *s)
 Slave configuration function for restart meta search engine. More...
 
SpaceStatus status (StatusStatistics &stat=unused_status)
 Query space status. More...
 
const Choicechoice (void)
 Create new choice for current brancher. More...
 
const Choicechoice (Archive &e) const
 Create new choice from e. More...
 
Spaceclone (bool share=true, CloneStatistics &stat=unused_clone) const
 Clone space. More...
 
void commit (const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
 Commit choice c for alternative a. More...
 
void trycommit (const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
 If possible, commit choice c for alternative a. More...
 
NGLngl (const Choice &c, unsigned int a)
 Create no-good literal for choice c and alternative a. More...
 
void print (const Choice &c, unsigned int a, std::ostream &o) const
 Print branch for choice c and alternative a. More...
 
void notice (Actor &a, ActorProperty p, bool duplicate=false)
 Notice actor property. More...
 
void ignore (Actor &a, ActorProperty p, bool duplicate=false)
 Ignore actor property. More...
 
ExecStatus ES_SUBSUMED (Propagator &p)
 
ExecStatus ES_SUBSUMED_DISPOSED (Propagator &p, size_t s)
 Propagator p is subsumed More...
 
ExecStatus ES_FIX_PARTIAL (Propagator &p, const ModEventDelta &med)
 Propagator p has computed partial fixpoint More...
 
ExecStatus ES_NOFIX_PARTIAL (Propagator &p, const ModEventDelta &med)
 Propagator p has not computed partial fixpoint More...
 
template<class A >
ExecStatus ES_FIX_DISPOSE (Council< A > &c, A &a)
 Advisor a must be disposed More...
 
template<class A >
ExecStatus ES_NOFIX_DISPOSE (Council< A > &c, A &a)
 Advisor a must be disposed and its propagator must be run More...
 
template<class A >
ExecStatus ES_NOFIX_DISPOSE_FORCE (Council< A > &c, A &a)
 Advisor a must be disposed and its propagator must be forcefully rescheduled More...
 
void fail (void)
 Fail space. More...
 
bool failed (void) const
 Check whether space is failed. More...
 
bool stable (void) const
 Return if space is stable (at fixpoint or failed) More...
 
unsigned int propagators (void) const
 Return number of propagators. More...
 
unsigned int branchers (void) const
 Return number of branchers. More...
 
template<class T >
T * alloc (long unsigned int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
T * alloc (long int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
T * alloc (unsigned int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
T * alloc (int n)
 Allocate block of n objects of type T from space heap. More...
 
template<class T >
void free (T *b, long unsigned int n)
 Delete n objects allocated from space heap starting at b. More...
 
template<class T >
void free (T *b, long int n)
 Delete n objects allocated from space heap starting at b. More...
 
template<class T >
void free (T *b, unsigned int n)
 Delete n objects allocated from space heap starting at b. More...
 
template<class T >
void free (T *b, int n)
 Delete n objects allocated from space heap starting at b. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void * ralloc (size_t s)
 Allocate memory on space heap. More...
 
void rfree (void *p, size_t s)
 Free memory previously allocated with alloc (might be reused later) More...
 
void * rrealloc (void *b, size_t n, size_t m)
 Reallocate memory block starting at b from size n to size s. More...
 
template<size_t >
void * fl_alloc (void)
 Allocate from freelist-managed memory. More...
 
template<size_t >
void fl_dispose (FreeList *f, FreeList *l)
 Return freelist-managed memory to freelist. More...
 
void flush (void)
 Flush cached memory blocks. More...
 

Static Public Member Functions

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

Conversion from Space to Home

Home operator() (Propagator &p)
 Return a home for this space with the information that p is being rewritten. More...
 
template<class T >
T & construct (void)
 Construction routines. More...
 
template<class T , typename A1 >
T & construct (A1 const &a1)
 Constructs a single object of type T from space heap using a unary constructor. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Low-level support for AFC

void afc_decay (double d)
 Set AFC decay factor to d. More...
 
double afc_decay (void) const
 Return AFC decay factor. More...
 
void afc_set (double a)
 Reset AFC to a. More...
 

Detailed Description

Computation spaces.

Definition at line 1325 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 195 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 203 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 2825 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 4062 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 4067 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 4074 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 4081 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 4088 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 4095 of file core.hpp.

void Gecode::Space::afc_decay ( double  d)

Set AFC decay factor to d.

Definition at line 669 of file core.cpp.

double Gecode::Space::afc_decay ( void  ) const
inline

Return AFC decay factor.

Definition at line 2795 of file core.hpp.

void Gecode::Space::afc_set ( double  a)

Reset AFC to a.

Definition at line 679 of file core.cpp.

Member Data Documentation

ActorLink* Gecode::Space::active

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 first queue or larger than the last queue. Then, the space is stable.
  • If active is larger than the last queue, the space is failed.

Definition at line 1388 of file core.hpp.

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

Scheduled propagators according to cost.

Definition at line 1390 of file core.hpp.

unsigned int Gecode::Space::branch_id

Id of next brancher to be created.

Definition at line 1392 of file core.hpp.

unsigned int Gecode::Space::n_sub

Number of subscriptions.

Definition at line 1394 of file core.hpp.

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

Data only available during propagation.

VarImpBase* Gecode::Space::vars_u[AllVarConf::idx_c]

Entries for updating variables.

Definition at line 1399 of file core.hpp.

VarImpBase* Gecode::Space::vars_noidx

Keep variables during copying without index structure.

Definition at line 1401 of file core.hpp.

SharedHandle::Object* Gecode::Space::shared

Linked list of shared objects.

Definition at line 1403 of file core.hpp.

LocalObject* Gecode::Space::local

Linked list of local objects.

Definition at line 1405 of file core.hpp.

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

Data available only during copying.


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