Generated on for Gecode by doxygen 1.17.0

Standard view/value selectors over the materialized prefix. More...

#include <gecode/int/branch/open.hpp>

Public Member Functions

virtual bool status (const Space &home) const
 Check status of brancher, return true if alternatives left.
virtual const Choice * choice (Space &home)
 Return choice.
virtual const Choice * choice (const Space &, Archive &e)
 Return choice from e.
virtual ExecStatus commit (Space &home, const Choice &c, unsigned int a)
 Commit for choice c and alternative a.
virtual NGL * ngl (Space &home, const Choice &c, unsigned int a) const
 Create no-good literal for choice c and alternative a.
virtual void print (const Space &home, const Choice &c, unsigned int a, std::ostream &o) const
 Print branch for choice c and alternative a.
virtual Actor * copy (Space &home)
 Create copy.
virtual size_t dispose (Space &home)
 Delete actor and return its size.
unsigned int id (void) const
 Return brancher id.
BrancherGroup group (void) const
 Return group brancher belongs to.
void group (BrancherGroup g)
 Add brancher to group g.
virtual ~Actor (void)
 To avoid warnings.

Static Public Member Functions

template<class VarBranch>
static void post (Home home, OpenViewList< View > list, VarBranch vars[n], ValSelCommitBase< View, int > *vsc, bool values_min, BranchFilter< Var > bf, VarValPrint< Var, int > vvp)
static void * operator new (size_t s, Space &home)
 Allocate memory from space.
static void operator delete (void *p, Space &home)
 No-op for exceptions.
static void * operator new (size_t s)
 Not used.
static void operator delete (void *p)
 Not used.

Protected Types

typedef View::VarType Var

Protected Member Functions

 OpenListBrancher (Home home, OpenViewList< View > list0, ViewSel< View > *vs0[n], ValSelCommitBase< View, int > *vsc0, bool values_min0, bool select_first0, BranchFilter< Var > bf, VarValPrint< Var, int > vvp)
 OpenListBrancher (Space &home, OpenListBrancher &b)
int position (Space &home)
 Select from a temporary array, keeping positions stable across growth.
int value (const Choice &c, unsigned int a) const
Protected Member Functions inherited from Gecode::Brancher
 Brancher (Home home)
 Constructor for creation.
 Brancher (Space &home, Brancher &b)
 Constructor for cloning b.

Static Protected Member Functions

static const Choice * value_choice (const Brancher &b, int i, IntView x)
static const Choice * value_choice (const Brancher &, int, BoolView)

Protected Attributes

OpenViewList< View > list
ViewSel< View > * vs [n]
ValSelCommitBase< View, int > * vsc
 Binary value selector, or null for one alternative per domain value.
Filter filter
SharedData< VarValPrint< Var, int > > printer
bool values_min
 Whether enumerated domain values are tried in increasing order.
bool select_first
int start

Detailed Description

template<class View, class Filter, int n>
class Gecode::Int::Branch::OpenListBrancher< View, Filter, n >

Standard view/value selectors over the materialized prefix.

Definition at line 43 of file open.hpp.

Member Typedef Documentation

◆ Var

template<class View, class Filter, int n>
typedef View::VarType Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::Var
protected

Definition at line 45 of file open.hpp.

Constructor & Destructor Documentation

◆ OpenListBrancher() [1/2]

template<class View, class Filter, int n>
Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::OpenListBrancher ( Home home,
OpenViewList< View > list0,
ViewSel< View > * vs0[n],
ValSelCommitBase< View, int > * vsc0,
bool values_min0,
bool select_first0,
BranchFilter< Var > bf,
VarValPrint< Var, int > vvp )
inlineprotected

Definition at line 57 of file open.hpp.

◆ OpenListBrancher() [2/2]

template<class View, class Filter, int n>
Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::OpenListBrancher ( Space & home,
OpenListBrancher< View, Filter, n > & b )
inlineprotected

Definition at line 71 of file open.hpp.

Member Function Documentation

◆ position()

template<class View, class Filter, int n>
int Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::position ( Space & home)
inlineprotected

Select from a temporary array, keeping positions stable across growth.

Definition at line 93 of file open.hpp.

◆ value_choice() [1/2]

template<class View, class Filter, int n>
const Choice * Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::value_choice ( const Brancher & b,
int i,
IntView x )
inlinestaticprotected

Definition at line 115 of file open.hpp.

◆ value_choice() [2/2]

template<class View, class Filter, int n>
const Choice * Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::value_choice ( const Brancher & ,
int ,
BoolView  )
inlinestaticprotected

Definition at line 120 of file open.hpp.

◆ value()

template<class View, class Filter, int n>
int Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::value ( const Choice & c,
unsigned int a ) const
inlineprotected

Definition at line 126 of file open.hpp.

◆ status()

template<class View, class Filter, int n>
virtual bool Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::status ( const Space & home) const
inlinevirtual

Check status of brancher, return true if alternatives left.

This method is called when Space::status is called, it determines whether to continue branching with this brancher or move on to the (possibly) next brancher.

Implements Gecode::Brancher.

Definition at line 134 of file open.hpp.

◆ choice() [1/2]

template<class View, class Filter, int n>
virtual const Choice * Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::choice ( Space & home)
inlinevirtual

Return choice.

Note that this method relies on the fact that it is called immediately after a previous call to status. Moreover, the member function can only be called once.

Implements Gecode::Brancher.

Definition at line 144 of file open.hpp.

◆ choice() [2/2]

template<class View, class Filter, int n>
virtual const Choice * Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::choice ( const Space & home,
Archive & e )
inlinevirtual

Return choice from e.

Implements Gecode::Brancher.

Definition at line 158 of file open.hpp.

◆ commit()

template<class View, class Filter, int n>
virtual ExecStatus Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::commit ( Space & home,
const Choice & c,
unsigned int a )
inlinevirtual

Commit for choice c and alternative a.

The current brancher in the space home performs a commit from the information provided by the choice c and the alternative a.

Implements Gecode::Brancher.

Definition at line 172 of file open.hpp.

◆ ngl()

template<class View, class Filter, int n>
virtual NGL * Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::ngl ( Space & home,
const Choice & c,
unsigned int a ) const
inlinevirtual

Create no-good literal for choice c and alternative a.

The current brancher in the space home creates a no-good literal from the information provided by the choice c and the alternative a. The brancher has the following options:

  • it returns nullptr for all alternatives a. This means that the brancher does not support no-good literals (default).
  • it returns nullptr for the last alternative a. This means that this alternative is equivalent to the negation of the disjunction of all other alternatives.

Reimplemented from Gecode::Brancher.

Definition at line 196 of file open.hpp.

◆ print()

template<class View, class Filter, int n>
virtual void Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::print ( const Space & home,
const Choice & c,
unsigned int a,
std::ostream & o ) const
inlinevirtual

Print branch for choice c and alternative a.

Prints an explanation of the alternative a of choice c on the stream o.

Reimplemented from Gecode::Brancher.

Definition at line 212 of file open.hpp.

◆ copy()

template<class View, class Filter, int n>
virtual Actor * Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::copy ( Space & home)
inlinevirtual

Create copy.

Implements Gecode::Actor.

Definition at line 237 of file open.hpp.

◆ dispose()

template<class View, class Filter, int n>
virtual size_t Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::dispose ( Space & home)
inlinevirtual

Delete actor and return its size.

Reimplemented from Gecode::Actor.

Definition at line 242 of file open.hpp.

◆ post()

template<class View, class Filter, int n>
template<class VarBranch>
void Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::post ( Home home,
OpenViewList< View > list,
VarBranch vars[n],
ValSelCommitBase< View, int > * vsc,
bool values_min,
BranchFilter< Var > bf,
VarValPrint< Var, int > vvp )
inlinestatic

Definition at line 257 of file open.hpp.

Member Data Documentation

◆ list

template<class View, class Filter, int n>
OpenViewList<View> Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::list
protected

Definition at line 46 of file open.hpp.

◆ vs

template<class View, class Filter, int n>
ViewSel<View>* Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::vs[n]
protected

Definition at line 47 of file open.hpp.

◆ vsc

template<class View, class Filter, int n>
ValSelCommitBase<View,int>* Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::vsc
protected

Binary value selector, or null for one alternative per domain value.

Definition at line 49 of file open.hpp.

◆ filter

template<class View, class Filter, int n>
Filter Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::filter
protected

Definition at line 50 of file open.hpp.

◆ printer

template<class View, class Filter, int n>
SharedData<VarValPrint<Var,int> > Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::printer
protected

Definition at line 51 of file open.hpp.

◆ values_min

template<class View, class Filter, int n>
bool Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::values_min
protected

Whether enumerated domain values are tried in increasing order.

Definition at line 53 of file open.hpp.

◆ select_first

template<class View, class Filter, int n>
bool Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::select_first
protected

Definition at line 54 of file open.hpp.

◆ start

template<class View, class Filter, int n>
int Gecode::Int::Branch::OpenListBrancher< View, Filter, n >::start
mutableprotected

Definition at line 55 of file open.hpp.


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