53 typedef typename View::VarType
Var;
73 int*
ties,
int&
n) = 0;
84 int*
ties,
int&
n) = 0;
87 int*
ties,
int n) = 0;
94 virtual bool notice(
void)
const;
102 static void*
operator new(
size_t s,
Space& home);
105 static void operator delete(
void*
p,
Space& home);
107 static void operator delete(
void*
p);
197 bool operator ()(Val
a, Val
b)
const;
205 bool operator ()(Val
a, Val
b)
const;
209 template<
class Choose,
class Merit>
215 typedef typename Merit::Val
Val;
249 virtual bool notice(
void)
const;
258 template<
class Choose,
class Merit>
290 virtual bool notice(
void)
const;
298 template<
class Merit>
318 template<
class Merit>
338 template<
class Merit>
358 template<
class Merit>
418 return home.ralloc(s);
446 int j=0; ties[j++]=s;
447 for (
int i=s+1;
i<x.
size();
i++)
458 int j=0; ties[j++]=s;
459 for (
int i=s+1;
i<x.
size();
i++)
495 for (
int i=s+1;
i<x.
size();
i++)
509 for (
int i=s+1;
i<x.
size();
i++)
521 n=1; ties[0] =
select(home,x,s);
528 n=1; ties[0] =
select(home,x,s);
533 ties[0] = ties[
static_cast<int>(
r(static_cast<unsigned int>(n)))];
539 return ties[
static_cast<int>(
r(static_cast<unsigned int>(n)))];
560 template<
class Choose,
class Merit>
565 template<
class Choose,
class Merit>
571 template<
class Choose,
class Merit>
576 Val b_m = m(home,x[s],s);
578 for (
int i=s+1;
i<x.
size();
i++)
580 Val mxi = m(home,x[
i],i);
588 template<
class Choose,
class Merit>
594 Val b_m = m(home,x[s],s);
596 for (
int i=s+1;
i<x.
size();
i++)
598 Val mxi = m(home,x[i],i);
606 template<
class Choose,
class Merit>
611 Val b = m(home,x[s],s);
612 int j=0; ties[j++]=s;
613 for (
int i=s+1;
i<x.
size();
i++)
615 Val mxi = m(home,x[
i],i);
618 j=0; ties[j++]=
i; b=mxi;
619 }
else if (mxi == b) {
629 template<
class Choose,
class Merit>
635 Val b = m(home,x[s],s);
636 int j=0; ties[j++]=s;
637 for (
int i=s+1;
i<x.
size();
i++)
639 Val mxi = m(home,x[i],i);
642 j=0; ties[j++]=
i; b=mxi;
643 }
else if (mxi == b) {
653 template<
class Choose,
class Merit>
658 Val b = m(home,x[ties[0]],ties[0]);
661 for (
int i=1;
i<
n;
i++) {
662 Val mxi = m(home,x[ties[
i]],ties[i]);
665 b=mxi; j=0; ties[j++]=ties[
i];
666 }
else if (mxi == b) {
676 template<
class Choose,
class Merit>
681 Val b_m = m(home,x[ties[0]],ties[0]);
682 for (
int i=1;
i<
n;
i++) {
683 Val mxi = m(home,x[ties[
i]],ties[i]);
685 b_i = ties[
i]; b_m = mxi;
691 template<
class Choose,
class Merit>
697 template<
class Choose,
class Merit>
704 template<
class Choose,
class Merit>
713 template<
class Choose,
class Merit>
720 template<
class Choose,
class Merit>
725 Val w = m(home,x[s],s);
727 for (
int i=s+1;
i<x.
size();
i++)
729 Val mxi = m(home,x[
i],i);
737 double l =
tbl()(home,
static_cast<double>(w),static_cast<double>(b));
739 if (!
c(l,static_cast<double>(w))) {
747 if (
c(l,static_cast<double>(b)))
748 l = static_cast<double>(b);
752 if (!x[
i].
assigned() && !
c(l,static_cast<double>(m(home,x[
i],i))))
760 template<
class Choose,
class Merit>
766 assert(
f(home,x[s],s));
767 Val w = m(home,x[s],s);
769 for (
int i=s+1;
i<x.
size();
i++)
771 Val mxi = m(home,x[i],i);
779 double l =
tbl()(home,
static_cast<double>(w),static_cast<double>(b));
781 if (!
c(l,static_cast<double>(w))) {
783 for (
int i=s; i<x.
size(); i++)
789 if (
c(l,static_cast<double>(b)))
790 l = static_cast<double>(b);
793 for (
int i=s; i<x.
size(); i++)
794 if (!x[i].
assigned() &&
f(home,x[i],i) &&
795 !
c(l,static_cast<double>(m(home,x[i],i))))
803 template<
class Choose,
class Merit>
808 Val w = m(home,x[ties[0]],ties[0]);
810 for (
int i=1;
i<
n;
i++) {
811 Val mxi = m(home,x[ties[
i]],ties[i]);
819 double l =
tbl()(home,
static_cast<double>(w),static_cast<double>(b));
822 if (
c(l,static_cast<double>(w))) {
824 if (
c(l,static_cast<double>(b)))
825 l =
static_cast<double>(
b);
828 for (
int i=0;
i<
n;
i++)
829 if (!
c(l,static_cast<double>(m(home,x[ties[
i]],ties[i]))))
836 template<
class Choose,
class Merit>
841 template<
class Choose,
class Merit>
849 template<
class Merit>
854 template<
class Merit>
859 template<
class Merit>
866 template<
class Merit>
871 template<
class Merit>
876 template<
class Merit>
884 template<
class Merit>
889 template<
class Merit>
894 template<
class Merit>
902 template<
class Merit>
907 template<
class Merit>
912 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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Class storing a branch filter function.
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.
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.
struct Gecode::@585::NNF::@62::@63 b
For binary nodes (and, or, eqv)
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.
struct Gecode::@585::NNF::@62::@64 a
For atomic nodes.
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.
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.