branch.hh
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Contributing authors:
* Samuel Gagnon <samuel.gagnon92@gmail.com>
* Copyright:
* Christian Schulte, 2012
* Samuel Gagnon, 2018
*
* This file is part of Gecode, the generic constraint
* development environment:
* http://www.gecode.org
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
#ifndef __GECODE_INT_BRANCH_HH__
#define __GECODE_INT_BRANCH_HH__
#include <gecode/int.hh>
namespace Gecode { namespace Int { namespace Branch {
template<class View>
class MeritMin : public MeritBase<View,int> {
public:
using typename MeritBase<View,int>::Var;
MeritMin(Space& home, const VarBranch<Var>& vb);
MeritMin(Space& home, MeritMin& m);
int operator ()(const Space& home, View x, int i);
};
template<class View>
class MeritMax : public MeritBase<View,int> {
public:
using typename MeritBase<View,int>::Var;
MeritMax(Space& home, const VarBranch<Var>& vb);
MeritMax(Space& home, MeritMax& m);
int operator ()(const Space& home, View x, int i);
};
template<class View>
class MeritSize : public MeritBase<View,unsigned int> {
public:
using typename MeritBase<View,unsigned int>::Var;
MeritSize(Space& home, const VarBranch<Var>& vb);
MeritSize(Space& home, MeritSize& m);
unsigned int operator ()(const Space& home, View x, int i);
};
template<class View>
class MeritDegreeSize : public MeritBase<View,double> {
public:
using typename MeritBase<View,double>::Var;
MeritDegreeSize(Space& home, const VarBranch<Var>& vb);
MeritDegreeSize(Space& home, MeritDegreeSize& m);
double operator ()(const Space& home, View x, int i);
};
template<class View>
class MeritAFCSize : public MeritBase<View,double> {
using typename MeritBase<View,double>::Var;
protected:
AFC afc;
public:
MeritAFCSize(Space& home, const VarBranch<Var>& vb);
MeritAFCSize(Space& home, MeritAFCSize& m);
double operator ()(const Space& home, View x, int i);
bool notice(void) const;
void dispose(Space& home);
};
template<class View>
class MeritActionSize : public MeritBase<View,double> {
using typename MeritBase<View,double>::Var;
protected:
Action action;
public:
MeritActionSize(Space& home, const VarBranch<Var>& vb);
MeritActionSize(Space& home, MeritActionSize& m);
double operator ()(const Space& home, View x, int i);
bool notice(void) const;
void dispose(Space& home);
};
template<class View>
class MeritCHBSize : public MeritBase<View,double> {
using typename MeritBase<View,double>::Var;
protected:
CHB chb;
public:
MeritCHBSize(Space& home, const VarBranch<Var>& vb);
MeritCHBSize(Space& home, MeritCHBSize& m);
double operator ()(const Space& home, View x, int i);
bool notice(void) const;
void dispose(Space& home);
};
template<class View>
class MeritRegretMin : public MeritBase<View,unsigned int> {
public:
using typename MeritBase<View,unsigned int>::Var;
MeritRegretMin(Space& home, const VarBranch<Var>& vb);
MeritRegretMin(Space& home, MeritRegretMin& m);
unsigned int operator ()(const Space& home, View x, int i);
};
template<class View>
class MeritRegretMax : public MeritBase<View,unsigned int> {
public:
using typename MeritBase<View,unsigned int>::Var;
MeritRegretMax(Space& home, const VarBranch<Var>& vb);
MeritRegretMax(Space& home, MeritRegretMax& m);
unsigned int operator ()(const Space& home, View x, int i);
};
}}}
#include <gecode/int/branch/merit.hpp>
namespace Gecode { namespace Int { namespace Branch {
GECODE_INT_EXPORT
ViewSel<IntView>* viewsel(Space& home, const IntVarBranch& ivb);
GECODE_INT_EXPORT
ViewSel<BoolView>* viewsel(Space& home, const BoolVarBranch& bvb);
}}}
namespace Gecode { namespace Int { namespace Branch {
template<class View>
class ValSelMin : public ValSel<View,int> {
public:
using typename ValSel<View,int>::Var;
ValSelMin(Space& home, const ValBranch<Var>& vb);
ValSelMin(Space& home, ValSelMin& vs);
int val(const Space& home, View x, int i);
};
template<class View>
class ValSelMax : public ValSel<View,int> {
public:
using typename ValSel<View,int>::Var;
ValSelMax(Space& home, const ValBranch<Var>& vb);
ValSelMax(Space& home, ValSelMax& vs);
int val(const Space& home, View x, int i);
};
template<class View>
class ValSelMed : public ValSel<View,int> {
public:
using typename ValSel<View,int>::Var;
ValSelMed(Space& home, const ValBranch<Var>& vb);
ValSelMed(Space& home, ValSelMed& vs);
int val(const Space& home, View x, int i);
};
template<class View>
class ValSelAvg : public ValSel<View,int> {
public:
using typename ValSel<View,int>::Var;
ValSelAvg(Space& home, const ValBranch<Var>& vb);
ValSelAvg(Space& home, ValSelAvg& vs);
int val(const Space& home, View x, int i);
};
template<class View>
class ValSelRnd : public ValSel<View,int> {
using typename ValSel<View,int>::Var;
protected:
Rnd r;
public:
ValSelRnd(Space& home, const ValBranch<Var>& vb);
ValSelRnd(Space& home, ValSelRnd& vs);
int val(const Space& home, View x, int i);
bool notice(void) const;
void dispose(Space& home);
};
class ValSelRangeMin : public ValSel<IntView,int> {
public:
ValSelRangeMin(Space& home, const ValBranch<IntVar>& vb);
ValSelRangeMin(Space& home, ValSelRangeMin& vs);
int val(const Space& home, IntView x, int i);
};
class ValSelRangeMax : public ValSel<IntView,int> {
public:
ValSelRangeMax(Space& home, const ValBranch<IntVar>& vb);
ValSelRangeMax(Space& home, ValSelRangeMax& vs);
int val(const Space& home, IntView x, int i);
};
}}}
#include <gecode/int/branch/val-sel.hpp>
namespace Gecode { namespace Int { namespace Branch {
template<class View>
class EqNGL : public ViewValNGL<View,int,PC_INT_VAL> {
using ViewValNGL<View,int,PC_INT_VAL>::x;
using ViewValNGL<View,int,PC_INT_VAL>::n;
public:
EqNGL(Space& home, View x, int n);
EqNGL(Space& home, EqNGL& ngl);
virtual NGL::Status status(const Space& home) const;
virtual ExecStatus prune(Space& home);
virtual NGL* copy(Space& home);
};
template<class View>
class NqNGL : public ViewValNGL<View,int,PC_INT_DOM> {
using ViewValNGL<View,int,PC_INT_DOM>::x;
using ViewValNGL<View,int,PC_INT_DOM>::n;
public:
NqNGL(Space& home, View x, int n);
NqNGL(Space& home, NqNGL& ngl);
virtual NGL::Status status(const Space& home) const;
virtual ExecStatus prune(Space& home);
virtual NGL* copy(Space& home);
};
template<class View>
class LqNGL : public ViewValNGL<View,int,PC_INT_BND> {
using ViewValNGL<View,int,PC_INT_BND>::x;
using ViewValNGL<View,int,PC_INT_BND>::n;
public:
LqNGL(Space& home, View x, int n);
LqNGL(Space& home, LqNGL& ngl);
virtual NGL::Status status(const Space& home) const;
virtual ExecStatus prune(Space& home);
virtual NGL* copy(Space& home);
};
template<class View>
class GqNGL : public ViewValNGL<View,int,PC_INT_BND> {
using ViewValNGL<View,int,PC_INT_BND>::x;
using ViewValNGL<View,int,PC_INT_BND>::n;
public:
GqNGL(Space& home, View x, int n);
GqNGL(Space& home, GqNGL& ngl);
virtual NGL::Status status(const Space& home) const;
virtual ExecStatus prune(Space& home);
virtual NGL* copy(Space& home);
};
}}}
#include <gecode/int/branch/ngl.hpp>
namespace Gecode { namespace Int { namespace Branch {
template<class View>
class ValCommitEq : public ValCommit<View,int> {
public:
using typename ValCommit<View,int>::Var;
ValCommitEq(Space& home, const ValBranch<Var>& vb);
ValCommitEq(Space& home, ValCommitEq& vc);
ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
NGL* ngl(Space& home, unsigned int a, View x, int n) const;
void print(const Space& home, unsigned int a, View x, int i, int n,
std::ostream& o) const;
};
template<class View>
class ValCommitLq : public ValCommit<View,int> {
public:
using typename ValCommit<View,int>::Var;
ValCommitLq(Space& home, const ValBranch<Var>& vb);
ValCommitLq(Space& home, ValCommitLq& vc);
ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
NGL* ngl(Space& home, unsigned int a, View x, int n) const;
void print(const Space& home, unsigned int a, View x, int i, int n,
std::ostream& o) const;
};
template<class View>
class ValCommitGq : public ValCommit<View,int> {
public:
using typename ValCommit<View,int>::Var;
ValCommitGq(Space& home, const ValBranch<Var>& vb);
ValCommitGq(Space& home, ValCommitGq& vc);
ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
NGL* ngl(Space& home, unsigned int a, View x, int n) const;
void print(const Space& home, unsigned int a, View x, int i, int n,
std::ostream& o) const;
};
template<class View>
class ValCommitGr : public ValCommit<View,int> {
public:
using typename ValCommit<View,int>::Var;
ValCommitGr(Space& home, const ValBranch<Var>& vb);
ValCommitGr(Space& home, ValCommitGr& vc);
ModEvent commit(Space& home, unsigned int a, View x, int i, int n);
NGL* ngl(Space& home, unsigned int a, View x, int n) const;
void print(const Space& home, unsigned int a, View x, int i, int n,
std::ostream& o) const;
};
}}}
#include <gecode/int/branch/val-commit.hpp>
namespace Gecode { namespace Int { namespace Branch {
GECODE_INT_EXPORT
ValSelCommitBase<IntView,int>*
valselcommit(Space& home, const IntValBranch& ivb);
GECODE_INT_EXPORT
ValSelCommitBase<BoolView,int>*
valselcommit(Space& home, const BoolValBranch& bvb);
GECODE_INT_EXPORT
ValSelCommitBase<IntView,int>*
valselcommit(Space& home, const IntAssign& ia);
GECODE_INT_EXPORT
ValSelCommitBase<BoolView,int>*
valselcommit(Space& home, const BoolAssign& ba);
}}}
namespace Gecode { namespace Int { namespace Branch {
template<int n, bool min, class Filter, class Print>
class ViewValuesBrancher : public ViewBrancher<IntView,Filter,n> {
protected:
using ViewBrancher<IntView,Filter,n>::x;
using ViewBrancher<IntView,Filter,n>::f;
Print p;
ViewValuesBrancher(Space& home, ViewValuesBrancher& b);
ViewValuesBrancher(Home home, ViewArray<IntView>& x,
ViewSel<IntView>* vs[n],
IntBranchFilter bf,
IntVarValPrint vvp);
public:
virtual const Choice* choice(Space& home);
virtual const Choice* choice(const Space& home, Archive& e);
virtual ExecStatus commit(Space& home, const Choice& c, unsigned int a);
virtual NGL* ngl(Space& home, const Choice& c, unsigned int a) const;
virtual void print(const Space& home, const Choice& c, unsigned int a,
std::ostream& o) const;
virtual Actor* copy(Space& home);
static void post(Home home, ViewArray<IntView>& x,
ViewSel<IntView>* vs[n],
IntBranchFilter bf,
IntVarValPrint vvp);
virtual size_t dispose(Space& home);
};
template<int n, bool min>
void postviewvaluesbrancher(Home home, ViewArray<IntView>& x,
ViewSel<IntView>* vs[n],
IntBranchFilter bf,
IntVarValPrint vvp);
}}}
#include <gecode/int/branch/view-values.hpp>
#ifdef GECODE_HAS_CBS
namespace Gecode { namespace Int { namespace Branch {
template<class View>
class CBSBrancher : public Brancher {
private:
ViewArray<View> x;
class VarIdToPos : public SharedHandle {
protected:
class VarIdToPosO : public SharedHandle::Object {
public:
std::unordered_map<unsigned int, unsigned int> _varIdToPos;
public:
VarIdToPosO(void) = default;
virtual ~VarIdToPosO(void) = default;
};
public:
VarIdToPos(void) = default;
void init(void);
bool isIn(unsigned int var_id) const;
int operator[](unsigned int var_id) const;
void insert(unsigned int var_id, unsigned int pos);
} varIdToPos;
struct PropInfo {
unsigned int domsum;
unsigned int var_id;
int val;
double dens;
bool visited;
};
std::unordered_map<unsigned int, PropInfo,
std::hash<unsigned int>,
std::equal_to<unsigned int>,
space_allocator<std::pair<const unsigned int, PropInfo>>>
logProp;
public:
CBSBrancher(Home home, ViewArray<View>& x0);
CBSBrancher(Space& home, CBSBrancher& b);
static void post(Home home, ViewArray<View>& x);
virtual Actor* copy(Space& home);
virtual size_t dispose(Space& home);
virtual bool status(const Space& home) const;
virtual const Choice* choice(Space& home);
virtual const Choice* choice(const Space&, Archive& e);
virtual ExecStatus commit(Space& home, const Choice& c, unsigned int a);
virtual void print(const Space& home, const Choice& c, unsigned int a,
std::ostream& o) const;
private:
bool inbrancher(unsigned int varId) const;
};
}}}
#include <gecode/int/branch/cbs.hpp>
#endif
#endif
// STATISTICS: int-branch
cbs.hpp
Gecode::AFC
Class for AFC (accumulated failure count) management.
Definition afc.hpp:40
Gecode::Action
Class for action management.
Definition action.hpp:42
Gecode::ActorLink::Actor
friend class Actor
Definition core.hpp:590
Gecode::Archive
Archive representation
Definition archive.hpp:42
Gecode::Brancher::Space
friend class Space
Definition core.hpp:1444
Gecode::Brancher::Choice
friend class Choice
Definition core.hpp:1445
Gecode::CHB
Class for CHB management.
Definition chb.hpp:46
Gecode::Home
Home class for posting propagators
Definition core.hpp:856
Gecode::Int::Branch::EqNGL::status
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition ngl.hpp:51
Gecode::Int::Branch::EqNGL::copy
virtual NGL * copy(Space &home)
Create copy.
Definition ngl.hpp:46
Gecode::Int::Branch::EqNGL::prune
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition ngl.hpp:59
Gecode::Int::Branch::EqNGL::EqNGL
EqNGL(Space &home, View x, int n)
Constructor for creation.
Definition ngl.hpp:38
Gecode::Int::Branch::GqNGL::copy
virtual NGL * copy(Space &home)
Create copy.
Definition ngl.hpp:132
Gecode::Int::Branch::GqNGL::status
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition ngl.hpp:137
Gecode::Int::Branch::GqNGL::GqNGL
GqNGL(Space &home, View x, int n)
Constructor for creation.
Definition ngl.hpp:124
Gecode::Int::Branch::GqNGL::prune
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition ngl.hpp:147
Gecode::Int::Branch::LqNGL::copy
virtual NGL * copy(Space &home)
Create copy.
Definition ngl.hpp:102
Gecode::Int::Branch::LqNGL::status
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition ngl.hpp:107
Gecode::Int::Branch::LqNGL::prune
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition ngl.hpp:117
Gecode::Int::Branch::LqNGL::LqNGL
LqNGL(Space &home, View x, int n)
Constructor for creation.
Definition ngl.hpp:94
Gecode::Int::Branch::MeritAFCSize::dispose
void dispose(Space &home)
Dispose view selection.
Definition merit.hpp:122
Gecode::Int::Branch::MeritAFCSize::afc
AFC afc
AFC information.
Definition branch.hh:145
Gecode::Int::Branch::MeritAFCSize::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition merit.hpp:117
Gecode::Int::Branch::MeritAFCSize::operator()
double operator()(const Space &home, View x, int i)
Return AFC over size as merit for view x at position i.
Definition merit.hpp:112
Gecode::Int::Branch::MeritAFCSize::MeritAFCSize
MeritAFCSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritActionSize::action
Action action
Action information.
Definition branch.hh:170
Gecode::Int::Branch::MeritActionSize::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition merit.hpp:144
Gecode::Int::Branch::MeritActionSize::MeritActionSize
MeritActionSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritActionSize::operator()
double operator()(const Space &home, View x, int i)
Return action over size as merit for view x at position i.
Definition merit.hpp:139
Gecode::Int::Branch::MeritActionSize::dispose
void dispose(Space &home)
Dispose view selection.
Definition merit.hpp:149
Gecode::Int::Branch::MeritCHBSize::dispose
void dispose(Space &home)
Dispose view selection.
Definition merit.hpp:175
Gecode::Int::Branch::MeritCHBSize::operator()
double operator()(const Space &home, View x, int i)
Return size over action as merit for view x at position i.
Definition merit.hpp:165
Gecode::Int::Branch::MeritCHBSize::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition merit.hpp:170
Gecode::Int::Branch::MeritCHBSize::chb
CHB chb
CHB information.
Definition branch.hh:195
Gecode::Int::Branch::MeritCHBSize::MeritCHBSize
MeritCHBSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritDegreeSize::operator()
double operator()(const Space &home, View x, int i)
Return degree over size as merit for view x at position i.
Definition merit.hpp:96
Gecode::Int::Branch::MeritDegreeSize::MeritDegreeSize
MeritDegreeSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritMax::MeritMax
MeritMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritMax::operator()
int operator()(const Space &home, View x, int i)
Return maximum as merit for view x at position i.
Definition merit.hpp:64
Gecode::Int::Branch::MeritMin::MeritMin
MeritMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritMin::operator()
int operator()(const Space &home, View x, int i)
Return minimum as merit for view x at position i.
Definition merit.hpp:48
Gecode::Int::Branch::MeritRegretMax::MeritRegretMax
MeritRegretMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritRegretMax::operator()
unsigned int operator()(const Space &home, View x, int i)
Return maximum regret as merit for view x at position i.
Definition merit.hpp:207
Gecode::Int::Branch::MeritRegretMin::MeritRegretMin
MeritRegretMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritRegretMin::operator()
unsigned int operator()(const Space &home, View x, int i)
Return minimum regret as merit for view x at position i.
Definition merit.hpp:191
Gecode::Int::Branch::MeritSize::MeritSize
MeritSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::MeritSize::operator()
unsigned int operator()(const Space &home, View x, int i)
Return size as merit for view x at position i.
Definition merit.hpp:80
Gecode::Int::Branch::NqNGL::NqNGL
NqNGL(Space &home, View x, int n)
Constructor for creation.
Definition ngl.hpp:66
Gecode::Int::Branch::NqNGL::prune
virtual ExecStatus prune(Space &home)
Propagate the negation of the no-good literal.
Definition ngl.hpp:87
Gecode::Int::Branch::NqNGL::copy
virtual NGL * copy(Space &home)
Create copy.
Definition ngl.hpp:74
Gecode::Int::Branch::NqNGL::status
virtual NGL::Status status(const Space &home) const
Test the status of the no-good literal.
Definition ngl.hpp:79
Gecode::Int::Branch::ValCommitEq::ngl
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition val-commit.hpp:52
Gecode::Int::Branch::ValCommitEq::commit
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition val-commit.hpp:47
Gecode::Int::Branch::ValCommitEq::print
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition val-commit.hpp:60
Gecode::Int::Branch::ValCommitEq::ValCommitEq
ValCommitEq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValCommitGq::print
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition val-commit.hpp:120
Gecode::Int::Branch::ValCommitGq::ValCommitGq
ValCommitGq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValCommitGq::ngl
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition val-commit.hpp:112
Gecode::Int::Branch::ValCommitGq::commit
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition val-commit.hpp:107
Gecode::Int::Branch::ValCommitGr::ValCommitGr
ValCommitGr(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValCommitGr::commit
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition val-commit.hpp:137
Gecode::Int::Branch::ValCommitGr::print
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition val-commit.hpp:150
Gecode::Int::Branch::ValCommitGr::ngl
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition val-commit.hpp:142
Gecode::Int::Branch::ValCommitLq::print
void print(const Space &home, unsigned int a, View x, int i, int n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition val-commit.hpp:90
Gecode::Int::Branch::ValCommitLq::ngl
NGL * ngl(Space &home, unsigned int a, View x, int n) const
Create no-good literal for alternative a.
Definition val-commit.hpp:82
Gecode::Int::Branch::ValCommitLq::ValCommitLq
ValCommitLq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValCommitLq::commit
ModEvent commit(Space &home, unsigned int a, View x, int i, int n)
Commit view x at position i to value n for alternative a.
Definition val-commit.hpp:77
Gecode::Int::Branch::ValSelAvg::ValSelAvg
ValSelAvg(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValSelAvg::val
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition val-sel.hpp:92
Gecode::Int::Branch::ValSelMax::val
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition val-sel.hpp:62
Gecode::Int::Branch::ValSelMax::ValSelMax
ValSelMax(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValSelMed::ValSelMed
ValSelMed(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValSelMed::val
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition val-sel.hpp:77
Gecode::Int::Branch::ValSelMin::ValSelMin
ValSelMin(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValSelMin::val
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition val-sel.hpp:47
Gecode::Int::Branch::ValSelRangeMax::val
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
Definition val-sel.hpp:153
Gecode::Int::Branch::ValSelRangeMax::ValSelRangeMax
ValSelRangeMax(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.
Definition val-sel.hpp:147
Gecode::Int::Branch::ValSelRangeMin::val
int val(const Space &home, IntView x, int i)
Return value of integer view x at position i.
Definition val-sel.hpp:137
Gecode::Int::Branch::ValSelRangeMin::ValSelRangeMin
ValSelRangeMin(Space &home, const ValBranch< IntVar > &vb)
Constructor for initialization.
Definition val-sel.hpp:131
Gecode::Int::Branch::ValSelRnd::val
int val(const Space &home, View x, int i)
Return value of view x at position i.
Definition val-sel.hpp:108
Gecode::Int::Branch::ValSelRnd::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition val-sel.hpp:120
Gecode::Int::Branch::ValSelRnd::r
Rnd r
The used random number generator.
Definition branch.hh:357
Gecode::Int::Branch::ValSelRnd::ValSelRnd
ValSelRnd(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Gecode::Int::Branch::ValSelRnd::dispose
void dispose(Space &home)
Delete value selection.
Definition val-sel.hpp:125
Gecode::Int::Branch::ViewValuesBrancher::print
virtual void print(const Space &home, const Choice &c, unsigned int a, std::ostream &o) const
Print branch for choice c and alternative a.
Definition view-values.hpp:165
Gecode::Int::Branch::ViewValuesBrancher::p
Print p
Print function.
Definition branch.hh:631
Gecode::Int::Branch::ViewValuesBrancher::ViewValuesBrancher
ViewValuesBrancher(Space &home, ViewValuesBrancher &b)
Constructor for cloning b.
Definition view-values.hpp:112
Gecode::Int::Branch::ViewValuesBrancher::copy
virtual Actor * copy(Space &home)
Perform cloning.
Definition view-values.hpp:117
Gecode::Int::Branch::ViewValuesBrancher::post
static void post(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post function for creation.
Definition view-values.hpp:101
Gecode::Int::Branch::ViewValuesBrancher::commit
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int a)
Perform commit for choice c and alternative a.
Definition view-values.hpp:143
Gecode::Int::Branch::ViewValuesBrancher::choice
virtual const Choice * choice(Space &home)
Return choice.
Definition view-values.hpp:124
Gecode::Int::Branch::ViewValuesBrancher::dispose
virtual size_t dispose(Space &home)
Delete brancher and return its size.
Definition view-values.hpp:182
Gecode::Int::Branch::ViewValuesBrancher::ngl
virtual NGL * ngl(Space &home, const Choice &c, unsigned int a) const
Create no-good literal for choice c and alternative a.
Definition view-values.hpp:154
Gecode::Int::IntView
Integer view for integer variables.
Definition view.hpp:129
Gecode::MeritBase< View, int >::View
View View
Definition merit.hpp:49
Gecode::MeritBase::Var
View::VarType Var
Corresponding variable type.
Definition merit.hpp:51
Gecode::MeritBase< View, int >::MeritBase
MeritBase(Space &home, const VarBranch< Var > &vb)
Definition merit.hpp:176
Gecode::NGL
No-good literal recorded during search.
Definition core.hpp:1340
Gecode::NGL::NGL
NGL(void)
Constructor for creation.
Definition core.hpp:3812
Gecode::NGL::Status
Status
The status of a no-good literal.
Definition core.hpp:1346
Gecode::Rnd
Random number generator.
Definition rnd.hpp:42
Gecode::Space
Computation spaces.
Definition core.hpp:1742
Gecode::ValBranch
Value branching information.
Definition val.hpp:41
Gecode::ValCommit< View, int >::ValCommit
ValCommit(Space &home, const ValBranch< Var > &vb)
Definition val-commit.hpp:101
Gecode::ValCommit::Var
View::VarType Var
Corresponding variable type.
Definition val-commit.hpp:49
Gecode::ValCommit< View, int >::View
View View
Definition val-commit.hpp:47
Gecode::View
Gecode::ValSel< View, int >::View
View View
Definition val-sel.hpp:47
Gecode::ValSel< View, int >::ValSel
ValSel(Space &home, const ValBranch< Var > &vb)
Definition val-sel.hpp:98
Gecode::ValSel::Var
View::VarType Var
Corresponding variable type.
Definition val-sel.hpp:49
Gecode::VarBranch
Variable branching information.
Definition var.hpp:55
Gecode::ViewArray
View arrays.
Definition array.hpp:253
Gecode::ViewBrancher< IntView, Filter, n >::f
Filter f
Definition view.hpp:89
Gecode::ViewBrancher< IntView, Filter, n >::x
ViewArray< IntView > x
Definition view.hpp:83
Gecode::ViewBrancher< IntView, Filter, n >::ViewBrancher
ViewBrancher(Space &home, ViewBrancher< IntView, Filter, n > &b)
Definition view.hpp:152
Gecode::ViewBrancher< IntView, Filter, n >::vs
ViewSel< IntView > * vs[n]
Definition view.hpp:87
Gecode::ViewSel
Abstract class for view selection.
Definition view-sel.hpp:44
Gecode::ViewValNGL< View, int, PC_INT_VAL >::x
View x
Definition view-val.hpp:64
Gecode::ViewValNGL< View, int, PC_INT_VAL >::n
int n
Definition view-val.hpp:66
Gecode::ViewValNGL< View, int, PC_INT_VAL >::ViewValNGL
ViewValNGL(Space &home, View x, int n)
Definition view-val.hpp:183
int.hh
GECODE_INT_EXPORT
#define GECODE_INT_EXPORT
Definition int.hh:81
Gecode::Float::Linear::post
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
Definition post.cpp:238
Gecode::IntBranchFilter
std::function< bool(const Space &home, IntVar x, int i)> IntBranchFilter
Branch filter function type for integer variables.
Definition int.hh:4176
merit.hpp
ngl.hpp
val-commit.hpp
val-sel.hpp
print
void print(const Search::Statistics &stat, bool restart)
Print statistics.
Definition job-shop.cpp:606
Gecode::Int::Branch
Integer branchers.
Gecode::Int::Branch::viewsel
ViewSel< IntView > * viewsel(Space &home, const IntVarBranch &ivb)
Return view selectors for integer views.
Definition view-sel.cpp:39
Gecode::Int::Branch::postviewvaluesbrancher
void postviewvaluesbrancher(Home home, ViewArray< IntView > &x, ViewSel< IntView > *vs[n], IntBranchFilter bf, IntVarValPrint vvp)
Post brancher for view and values.
Definition view-values.hpp:191
Gecode::Int::Branch::valselcommit
ValSelCommitBase< IntView, int > * valselcommit(Space &home, const IntValBranch &ivb)
Return value and commit for integer views.
Definition val-sel-commit.cpp:39
Gecode::Int
Finite domain integers.
Gecode::Int::PC_INT_VAL
const Gecode::PropCond PC_INT_VAL
Propagate when a view becomes assigned (single value).
Definition var-type.hpp:82
Gecode::Int::PC_INT_BND
const Gecode::PropCond PC_INT_BND
Propagate when minimum or maximum of a view changes.
Definition var-type.hpp:91
Gecode::Int::PC_INT_DOM
const Gecode::PropCond PC_INT_DOM
Propagate when domain changes.
Definition var-type.hpp:100
Gecode
Gecode toplevel namespace
Gecode::ba
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition ipl.hpp:43
Gecode::IntVarValPrint
std::function< void(const Space &home, const Brancher &b, unsigned int a, IntVar x, int i, const int &n, std::ostream &o)> IntVarValPrint
Function type for printing branching alternatives for integer variables.
Definition int.hh:4552
Gecode::ExecStatus
ExecStatus
Definition core.hpp:472
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62
view-values.hpp