49 typedef typename View::VarType
Var;
69 int*
ties,
int&
n) = 0;
80 int*
ties,
int&
n) = 0;
83 int*
ties,
int n) = 0;
90 virtual bool notice(
void)
const;
98 static void*
operator new(
size_t s,
Space& home);
101 static void operator delete(
void*
p,
Space& home);
103 static void operator delete(
void*
p);
193 bool operator ()(Val
a, Val
b)
const;
201 bool operator ()(Val
a, Val
b)
const;
205 template<
class Choose,
class Merit>
211 typedef typename Merit::Val
Val;
245 virtual bool notice(
void)
const;
254 template<
class Choose,
class Merit>
286 virtual bool notice(
void)
const;
294 template<
class Merit>
314 template<
class Merit>
334 template<
class Merit>
354 template<
class Merit>
414 return home.ralloc(s);
442 int j=0; ties[j++]=s;
443 for (
int i=s+1;
i<x.
size();
i++)
454 int j=0; ties[j++]=s;
455 for (
int i=s+1;
i<x.
size();
i++)
491 for (
int i=s+1;
i<x.
size();
i++)
505 for (
int i=s+1;
i<x.
size();
i++)
517 n=1; ties[0] =
select(home,x,s);
524 n=1; ties[0] =
select(home,x,s);
529 ties[0] = ties[
static_cast<int>(
r(static_cast<unsigned int>(n)))];
535 return ties[
static_cast<int>(
r(static_cast<unsigned int>(n)))];
556 template<
class Choose,
class Merit>
561 template<
class Choose,
class Merit>
567 template<
class Choose,
class Merit>
572 Val b_m = m(home,x[s],s);
574 for (
int i=s+1;
i<x.
size();
i++)
576 Val mxi = m(home,x[
i],i);
584 template<
class Choose,
class Merit>
590 Val b_m = m(home,x[s],s);
592 for (
int i=s+1;
i<x.
size();
i++)
594 Val mxi = m(home,x[i],i);
602 template<
class Choose,
class Merit>
607 Val b = m(home,x[s],s);
608 int j=0; ties[j++]=s;
609 for (
int i=s+1;
i<x.
size();
i++)
611 Val mxi = m(home,x[
i],i);
614 j=0; ties[j++]=
i; b=mxi;
615 }
else if (mxi == b) {
625 template<
class Choose,
class Merit>
631 Val b = m(home,x[s],s);
632 int j=0; ties[j++]=s;
633 for (
int i=s+1;
i<x.
size();
i++)
635 Val mxi = m(home,x[i],i);
638 j=0; ties[j++]=
i; b=mxi;
639 }
else if (mxi == b) {
649 template<
class Choose,
class Merit>
654 Val b = m(home,x[ties[0]],ties[0]);
657 for (
int i=1;
i<
n;
i++) {
658 Val mxi = m(home,x[ties[
i]],ties[i]);
661 b=mxi; j=0; ties[j++]=ties[
i];
662 }
else if (mxi == b) {
672 template<
class Choose,
class Merit>
677 Val b_m = m(home,x[ties[0]],ties[0]);
678 for (
int i=1;
i<
n;
i++) {
679 Val mxi = m(home,x[ties[
i]],ties[i]);
681 b_i = ties[
i]; b_m = mxi;
687 template<
class Choose,
class Merit>
693 template<
class Choose,
class Merit>
700 template<
class Choose,
class Merit>
709 template<
class Choose,
class Merit>
716 template<
class Choose,
class Merit>
721 Val w = m(home,x[s],s);
723 for (
int i=s+1;
i<x.
size();
i++)
725 Val mxi = m(home,x[
i],i);
733 double l =
tbl()(home,
static_cast<double>(w),static_cast<double>(b));
735 if (!
c(l,static_cast<double>(w))) {
743 if (
c(l,static_cast<double>(b)))
744 l = static_cast<double>(b);
748 if (!x[
i].
assigned() && !
c(l,static_cast<double>(m(home,x[
i],i))))
756 template<
class Choose,
class Merit>
762 assert(
f(home,x[s],s));
763 Val w = m(home,x[s],s);
765 for (
int i=s+1;
i<x.
size();
i++)
767 Val mxi = m(home,x[i],i);
775 double l =
tbl()(home,
static_cast<double>(w),static_cast<double>(b));
777 if (!
c(l,static_cast<double>(w))) {
779 for (
int i=s; i<x.
size(); i++)
785 if (
c(l,static_cast<double>(b)))
786 l = static_cast<double>(b);
789 for (
int i=s; i<x.
size(); i++)
790 if (!x[i].
assigned() &&
f(home,x[i],i) &&
791 !
c(l,static_cast<double>(m(home,x[i],i))))
799 template<
class Choose,
class Merit>
804 Val w = m(home,x[ties[0]],ties[0]);
806 for (
int i=1;
i<
n;
i++) {
807 Val mxi = m(home,x[ties[
i]],ties[i]);
815 double l =
tbl()(home,
static_cast<double>(w),static_cast<double>(b));
818 if (
c(l,static_cast<double>(w))) {
820 if (
c(l,static_cast<double>(b)))
821 l =
static_cast<double>(
b);
824 for (
int i=0;
i<
n;
i++)
825 if (!
c(l,static_cast<double>(m(home,x[ties[
i]],ties[i]))))
832 template<
class Choose,
class Merit>
837 template<
class Choose,
class Merit>
845 template<
class Merit>
850 template<
class Merit>
855 template<
class Merit>
862 template<
class Merit>
867 template<
class Merit>
872 template<
class Merit>
880 template<
class Merit>
885 template<
class Merit>
890 template<
class Merit>
898 template<
class Merit>
903 template<
class Merit>
908 template<
class Merit>
Select view with largest merit.
ViewSelChoose< Choose, Merit >::Val Val
ViewSelNone(Space &home, const VarBranch< Var > &vb)
Constructor for creation.
virtual void ties(Space &home, ViewArray< View > &x, int s, int *ties, int &n)
Select ties from x starting at s.
virtual ~ViewSel(void)
Unused destructor.
Rnd r
The random number generator used.
bool operator()(Val a, Val b) const
Return true if a is better than b.
Class withot a branch filter function.
ViewSelMinTbl(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Abstract class for view selection.
virtual ViewSel< View > * copy(Space &home)
Create copy during cloning.
virtual void ties(Space &home, ViewArray< View > &x, int s, int *ties, int &n)=0
Select ties from x starting from s.
virtual ViewSel< View > * copy(Space &home)
Create copy during cloning.
ViewSelMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
ViewSelChoose(Space &home, const VarBranch< Var > &vb)
Constructor for creation.
Choose view according to merit taking tie-break limit into account.
Choose views with larger merit values.
Merit m
The merit object used.
virtual void brk(Space &home, ViewArray< View > &x, int *ties, int &n)=0
Break ties in x and update to new ties.
virtual int select(Space &home, ViewArray< View > &x, int s)
Select a view from x starting at s and return its position.
Select the first unassigned view.
Select view with least merit.
Gecode::FloatVal c(-8, 8)
virtual void dispose(Space &home)
Dispose view selection.
int p
Number of positive literals for node type.
int n
Number of negative literals for node type.
Class storing a branch filter function.
Gecode::IntArgs i({1, 2, 3, 4})
Select view with largest merit taking tie-break limit into account.
virtual void brk(Space &home, ViewArray< View > &x, int *ties, int &n)
Break ties in x and update to new ties.
Choose view according to merit.
ViewSelMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
struct Gecode::@593::NNF::@62::@63 b
For binary nodes (and, or, eqv)
std::function< double(const Space &home, double w, double b)> BranchTbl
Tie-break limit function.
ViewSel< typename Merit::View >::Var Var
Select view with least merit taking tie-break limit into account.
virtual int select(Space &home, ViewArray< View > &x, int s)=0
Select a view from x starting from s and return its position.
Choose views with smaller merit values.
virtual ViewSel< View > * copy(Space &home)=0
Create copy during cloning.
Exception: invalid function
SharedData< BranchTbl > tbl
Tie-break limit function.
Post propagator for SetVar SetOpType SetVar SetRelType r
virtual bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
#define GECODE_VALID_FUNCTION(f)
Assert that a function is valid.
bool operator()(Val a, Val b) const
Return true if a is better than b.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Variable branching information.
Node * x
Pointer to corresponding Boolean expression node.
virtual void brk(Space &home, ViewArray< View > &x, int *ties, int &n)
Break ties in x and update to new ties.
virtual ViewSel< View > * copy(Space &home)
Create copy during cloning.
ViewSelRnd(Space &home, const VarBranch< Var > &vb)
Constructor for creation.
bool assigned(View x, int v)
Whether x is assigned to value v.
virtual bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
Post propagator for SetVar x
virtual ViewSel< View > * copy(Space &home)
Create copy during cloning.
virtual ViewSel< View > * copy(Space &home)
Create copy during cloning.
View::VarType Var
The corresponding variable type.
Merit::Val Val
Type of merit.
Gecode toplevel namespace
virtual ViewSel< View > * copy(Space &home)
Create copy during cloning.
ViewSel< typename Merit::View >::View View
virtual int select(Space &home, ViewArray< View > &x, int s)
Select a view from x starting from s and return its position.
ViewSelChoose< Choose, Merit >::View View
int size(void) const
Return size of array (number of elements)
double tbl(const Gecode::Space &, double w, double b)
Test function for tie-break limit function.
_View View
Define the view type.
ViewSel(Space &home, const VarBranch< Var > &vb)
Constructor for creation.
#define GECODE_NEVER
Assert that this command is never executed.
struct Gecode::@593::NNF::@62::@64 a
For atomic nodes.
virtual void dispose(Space &home)
Delete view selection.
ViewSelChoose< Choose, Merit >::Var Var
virtual void ties(Space &home, ViewArray< View > &x, int s, int *ties, int &n)
Select ties from x starting from s.
ViewSelMaxTbl(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.