Generated on Mon Jul 6 18:09:23 2009 for Gecode by doxygen 1.5.9

Programming search engines
[Functionality by programming task]


Enumerations

enum  Gecode::SpaceStatus { Gecode::SS_FAILED, Gecode::SS_SOLVED, Gecode::SS_BRANCH }
 Space status More...

Functions

SpaceStatus Gecode::Space::status (StatusStatistics &stat=unused_status)
 Query space status.
const BranchingDesc * Gecode::Space::description (void)
 Create new branching description for current branching.
Space * Gecode::Space::clone (bool share=true, CloneStatistics &stat=unused_clone) const
 Clone space.
void Gecode::Space::commit (const BranchingDesc &d, unsigned int a, CommitStatistics &stat=unused_commit)
 Commit branching description d and for alternative a.

Enumeration Type Documentation

Space status

Enumerator:
SS_FAILED  Space is failed
SS_SOLVED  Space is solved (no branching left)
SS_BRANCH  Space must be branched (at least one branching left)

Definition at line 1119 of file core.hpp.


Function Documentation

SpaceStatus Gecode::Space::status ( StatusStatistics stat = unused_status  )  [inherited]

Query space status.

Propagates the space until fixpoint or failure; updates the statistics information stat; and:

  • if the space is failed, SpaceStatus::SS_FAILED is returned.
  • if the space is not failed but the space has no branching left, SpaceStatus::SS_SOLVED is returned.
  • otherwise, SpaceStatus::SS_BRANCH is returned.

Definition at line 188 of file core.cpp.

const BranchingDesc * Gecode::Space::description ( void   )  [inherited]

Create new branching description for current branching.

This member function can only be called after the member function Space::status on the same space has been called and in between no non-const member function has been called on this space.

Moreover, the member function can only be called at most once (otherwise, it might generate conflicting descriptions).

Note that the above invariant only pertains to calls of member functions of the same space. If the invariant is violated, the system is likely to crash (hopefully it does). In particular, if applied to a space with no current branching, the system will crash.

After a new description has been created, no older descriptions can be used on the space.

If the status() member function has returned that the space has no more branchings (that is, the result was either SS_FAILED or SS_SOLVED), a call to description() will return NULL and purge all remaining branching inside the space. This is interesting for the case SS_SOLVED, where the call to description serves as garbage collection.

Throws an exception of type SpaceNotStable when applied to a not yet stable space.

Definition at line 295 of file core.cpp.

Space * Gecode::Space::clone ( bool  share = true,
CloneStatistics stat = unused_clone 
) const [inline, inherited]

Clone space.

Assumes that the space is stable and not failed. If the space is failed, an exception of type SpaceFailed is thrown. If the space is not stable, an exception of SpaceNotStable is thrown.

Otherwise, a clone of the space is returned and the statistics information stat is updated. If share is true, sharable datastructures are shared among the clone and the original space. If share is false, independent copies of the shared datastructures must be created. This means that a clone with no sharing can be used in a different thread without any interaction with the original space.

Definition at line 2398 of file core.hpp.

void Gecode::Space::commit ( const BranchingDesc d,
unsigned int  a,
CommitStatistics stat = unused_commit 
) [inline, inherited]

Commit branching description d and for alternative a.

The current branching in the space performs a commit from the information provided by the branching description d and the alternative a. The statistics information stat is updated.

Note that no propagation is perfomed (to support batch recomputation), in order to perform propagation the member function status must be used.

Committing with branching descriptions must be carried out in the same order as the branch descriptions have been obtained by the member function Space::description().

It is perfectly okay to add constraints interleaved with branching descriptions (provided they are in the right order). However, if propagation is performed by calling the member function status and then new branching descriptions are computed, these branching descriptions are different.

Only descriptions can be used that are up-to-date in the following sense: if a new description is created (via the description member function), no older descriptions can be used.

Committing throws the following exceptions:

  • SpaceNoBranching, if the space has no current branching (it is already solved).
  • SpaceIllegalAlternative, if a is not smaller than the number of alternatives supported by the branching description d.

Definition at line 2406 of file core.hpp.