Generated on for Gecode by doxygen 1.18.0
Gecode::Space Class Referenceabstract

Computation spaces. More...

#include <gecode/kernel/core.hpp>

Classes

class  NoGPI
 Suppress global propagator information during scoped posting. More...
class  UseGPI
 Enable global propagator information during scoped posting. More...
class  Propagators
 Class to iterate over propagators of a space. More...
class  ScheduledPropagators
 Class to iterate over scheduled propagators of a space. More...
class  IdlePropagators
 Class to iterate over idle propagators of a space. More...
class  Branchers
 Class to iterate over branchers of a space. More...

update, and dispose variables

 Space (void)
 Default constructor.
 Space (Space &s)
 Constructor for cloning.
Space & operator= (const Space &s)=default
 Assignment operator.
virtual ~Space (void)
 Destructor.
virtual Space * copy (void)=0
 Copying member function.
virtual void constrain (const Space &best)
 Constrain function for best solution search.
virtual bool master (const MetaInfo &mi)
 Master configuration function for meta search engines.
virtual bool slave (const MetaInfo &mi)
 Slave configuration function for meta search engines.
SpaceStatus status (StatusStatistics &stat)
 Query space status.
SpaceStatus status (void)
 Query space status without collecting statistics.
const Choice * choice (void)
 Create new choice for current brancher.
const Choice * choice (Archive &e) const
 Create new choice from e.
Space * clone (void) const
 Clone space.
Space * clone (CloneStatistics &stat) const
 Clone space.
void commit (const Choice &c, unsigned int a)
 Commit choice c for alternative a.
void commit (const Choice &c, unsigned int a, CommitStatistics &stat)
 Commit choice c for alternative a.
void trycommit (const Choice &c, unsigned int a)
 If possible, commit choice c for alternative a.
void trycommit (const Choice &c, unsigned int a, CommitStatistics &stat)
 If possible, commit choice c for alternative a.
NGL * ngl (const Choice &c, unsigned int a)
 Create no-good literal for choice c and alternative a.
void print (const Choice &c, unsigned int a, std::ostream &o) const
 Print branch for choice c and alternative a.
void notice (Actor &a, ActorProperty p, bool duplicate=false)
 Notice actor property.
void ignore (Actor &a, ActorProperty p, bool duplicate=false)
 Ignore actor property.
ExecStatus ES_SUBSUMED (Propagator &p)
 Propagator p is subsumed
ExecStatus ES_SUBSUMED_DISPOSED (Propagator &p, size_t s)
 Propagator p is subsumed
ExecStatus ES_FIX_PARTIAL (Propagator &p, const ModEventDelta &med)
 Propagator p has computed partial fixpoint
ExecStatus ES_NOFIX_PARTIAL (Propagator &p, const ModEventDelta &med)
 Propagator p has not computed partial fixpoint
template<class A>
ExecStatus ES_FIX_DISPOSE (Council< A > &c, A &a)
 Advisor a must be disposed
template<class A>
ExecStatus ES_NOFIX_DISPOSE (Council< A > &c, A &a)
 Advisor a must be disposed and its propagator must be run
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
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).

Conversion from Space to Home

Home operator() (Propagator &p)
 Return a home for this space with the information that p is being rewritten.
Home operator() (PropagatorGroup pg)
 Return a home for this space with propagator group information pg.
Home operator() (BrancherGroup bg)
 Return a home for this space with brancher group information bg.
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.
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.

Low-level support for AFC

void afc_decay (double d)
 Set AFC decay factor to d
double afc_decay (void) const
 Return AFC decay factor.
void afc_unshare (void)
 Unshare AFC information for all propagators.

Additional Inherited Members

Static Public Member Functions inherited from Gecode::HeapAllocated
static void * operator new (size_t s)
 Memory management.
static void operator delete (void *p)
 Free memory allocated from heap.

Detailed Description

Computation spaces.

Definition at line 1782 of file core.hpp.

Member Function Documentation

◆ operator=()

Space & Gecode::Space::operator= ( const Space & s)
default

Assignment operator.

◆ status()

SpaceStatus Gecode::Space::status ( void )
inline

Query space status without collecting statistics.

Definition at line 3368 of file core.hpp.

◆ clone()

Space * Gecode::Space::clone ( CloneStatistics & stat) const
inline

Clone space.

Definition at line 3380 of file core.hpp.

◆ commit()

void Gecode::Space::commit ( const Choice & c,
unsigned int a,
CommitStatistics & stat )
inline

Commit choice c for alternative a.

Definition at line 3394 of file core.hpp.

◆ trycommit()

void Gecode::Space::trycommit ( const Choice & c,
unsigned int a,
CommitStatistics & stat )
inline

If possible, commit choice c for alternative a.

Definition at line 3405 of file core.hpp.

◆ operator()() [1/3]

Home Gecode::Space::operator() ( Propagator & p)
inline

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

Definition at line 3458 of file core.hpp.

◆ operator()() [2/3]

Home Gecode::Space::operator() ( PropagatorGroup pg)
inline

Return a home for this space with propagator group information pg.

Definition at line 3462 of file core.hpp.

◆ operator()() [3/3]

Home Gecode::Space::operator() ( BrancherGroup bg)
inline

Return a home for this space with brancher group information bg.

Definition at line 3466 of file core.hpp.

◆ alloc() [1/4]

template<class T>
T * Gecode::Space::alloc ( long unsigned int n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2963 of file core.hpp.

◆ alloc() [2/4]

template<class T>
T * Gecode::Space::alloc ( long int n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2971 of file core.hpp.

◆ alloc() [3/4]

template<class T>
T * Gecode::Space::alloc ( unsigned int n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2977 of file core.hpp.

◆ alloc() [4/4]

template<class T>
T * Gecode::Space::alloc ( int n)
inline

Allocate block of n objects of type T from space heap.

Note that this function implements C++ semantics: the default constructor of T is run for all n objects.

Definition at line 2982 of file core.hpp.

◆ free() [1/4]

template<class T>
void Gecode::Space::free ( T * b,
long unsigned int n )
inline

Delete n objects allocated from space heap starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, it is just scheduled for later reusal.

Definition at line 2989 of file core.hpp.

◆ free() [2/4]

template<class T>
void Gecode::Space::free ( T * b,
long int n )
inline

Delete n objects allocated from space heap starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, it is just scheduled for later reusal.

Definition at line 2996 of file core.hpp.

◆ free() [3/4]

template<class T>
void Gecode::Space::free ( T * b,
unsigned int n )
inline

Delete n objects allocated from space heap starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, it is just scheduled for later reusal.

Definition at line 3002 of file core.hpp.

◆ free() [4/4]

template<class T>
void Gecode::Space::free ( T * b,
int n )
inline

Delete n objects allocated from space heap starting at b.

Note that this function implements C++ semantics: the destructor of T is run for all n objects.

Note that the memory is not freed, it is just scheduled for later reusal.

Definition at line 3007 of file core.hpp.

◆ realloc() [1/8]

template<class T>
T * Gecode::Space::realloc ( T * b,
long unsigned int n,
long unsigned int m )
inline

Reallocate block of n objects starting at b to m objects of type T from the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all \(\min(n,m)\) objects, the default constructor of T is run for all remaining \(\max(n,m)-\min(n,m)\) objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 3014 of file core.hpp.

◆ realloc() [2/8]

template<class T>
T * Gecode::Space::realloc ( T * b,
long int n,
long int m )
inline

Reallocate block of n objects starting at b to m objects of type T from the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all \(\min(n,m)\) objects, the default constructor of T is run for all remaining \(\max(n,m)-\min(n,m)\) objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 3030 of file core.hpp.

◆ realloc() [3/8]

template<class T>
T * Gecode::Space::realloc ( T * b,
unsigned int n,
unsigned int m )
inline

Reallocate block of n objects starting at b to m objects of type T from the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all \(\min(n,m)\) objects, the default constructor of T is run for all remaining \(\max(n,m)-\min(n,m)\) objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 3037 of file core.hpp.

◆ realloc() [4/8]

template<class T>
T * Gecode::Space::realloc ( T * b,
int n,
int m )
inline

Reallocate block of n objects starting at b to m objects of type T from the space heap.

Note that this function implements C++ semantics: the copy constructor of T is run for all \(\min(n,m)\) objects, the default constructor of T is run for all remaining \(\max(n,m)-\min(n,m)\) objects, and the destrucor of T is run for all n objects in b.

Returns the address of the new block.

Definition at line 3043 of file core.hpp.

◆ realloc() [5/8]

template<class T>
T ** Gecode::Space::realloc ( T ** b,
long unsigned int n,
long unsigned int m )
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 3092 of file core.hpp.

◆ realloc() [6/8]

template<class T>
T ** Gecode::Space::realloc ( T ** b,
long int n,
long int m )
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 3097 of file core.hpp.

◆ realloc() [7/8]

template<class T>
T ** Gecode::Space::realloc ( T ** b,
unsigned int n,
unsigned int m )
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 3104 of file core.hpp.

◆ realloc() [8/8]

template<class T>
T ** Gecode::Space::realloc ( T ** b,
int n,
int m )
inline

Reallocate block of n pointers starting at b to m objects of type T* from the space heap.

Returns the address of the new block.

This is a specialization for performance.

Definition at line 3110 of file core.hpp.

◆ ralloc()

void * Gecode::Space::ralloc ( size_t s)
inline

Allocate memory on space heap.

Definition at line 2925 of file core.hpp.

◆ rfree()

void Gecode::Space::rfree ( void * p,
size_t s )
inline

Free memory previously allocated with alloc (might be reused later).

Definition at line 2929 of file core.hpp.

◆ rrealloc()

void * Gecode::Space::rrealloc ( void * b,
size_t n,
size_t m )
inline

Reallocate memory block starting at b from size n to size s.

Definition at line 2933 of file core.hpp.

◆ fl_alloc()

template<size_t s>
void * Gecode::Space::fl_alloc ( void )
inline

Allocate from freelist-managed memory.

Definition at line 2948 of file core.hpp.

◆ fl_dispose()

template<size_t s>
void Gecode::Space::fl_dispose ( FreeList * f,
FreeList * l )
inline

Return freelist-managed memory to freelist.

The first list element to be retuned is f, the last is l.

Definition at line 2953 of file core.hpp.

◆ construct() [1/6]

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 5382 of file core.hpp.

◆ construct() [2/6]

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 5387 of file core.hpp.

◆ construct() [3/6]

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 5394 of file core.hpp.

◆ construct() [4/6]

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 5401 of file core.hpp.

◆ construct() [5/6]

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 5408 of file core.hpp.

◆ construct() [6/6]

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 5415 of file core.hpp.

◆ afc_decay() [1/2]

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

Set AFC decay factor to d

Definition at line 3415 of file core.hpp.

◆ afc_decay() [2/2]

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

Return AFC decay factor.

Definition at line 3410 of file core.hpp.

◆ afc_unshare()

void Gecode::Space::afc_unshare ( void )

Unshare AFC information for all propagators.


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