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>
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
*
* Copyright:
* Christian Schulte, 2012
* Vincent Barichard, 2012
*
* 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_FLOAT_BRANCH_HH__
#define __GECODE_FLOAT_BRANCH_HH__
#include <gecode/float.hh>
namespace Gecode { namespace Float { namespace Branch {
class MeritMin : public MeritBase<FloatView,double> {
public:
MeritMin(Space& home, const VarBranch<Var>& vb);
MeritMin(Space& home, MeritMin& m);
double operator ()(const Space& home, FloatView x, int i);
};
class MeritMax : public MeritBase<FloatView,double> {
public:
MeritMax(Space& home, const VarBranch<Var>& vb);
MeritMax(Space& home, MeritMax& m);
double operator ()(const Space& home, FloatView x, int i);
};
class MeritSize : public MeritBase<FloatView,double> {
public:
MeritSize(Space& home, const VarBranch<Var>& vb);
MeritSize(Space& home, MeritSize& m);
double operator ()(const Space& home, FloatView x, int i);
};
class MeritDegreeSize : public MeritBase<FloatView,double> {
public:
MeritDegreeSize(Space& home, const VarBranch<Var>& vb);
MeritDegreeSize(Space& home, MeritDegreeSize& m);
double operator ()(const Space& home, FloatView x, int i);
};
class MeritAFCSize : public MeritBase<FloatView,double> {
protected:
AFC afc;
public:
MeritAFCSize(Space& home, const VarBranch<Var>& vb);
MeritAFCSize(Space& home, MeritAFCSize& m);
double operator ()(const Space& home, FloatView x, int i);
bool notice(void) const;
void dispose(Space& home);
};
class MeritActionSize : public MeritBase<FloatView,double> {
protected:
Action action;
public:
MeritActionSize(Space& home, const VarBranch<Var>& vb);
MeritActionSize(Space& home, MeritActionSize& m);
double operator ()(const Space& home, FloatView x, int i);
bool notice(void) const;
void dispose(Space& home);
};
class MeritCHBSize : public MeritBase<FloatView,double> {
protected:
CHB chb;
public:
MeritCHBSize(Space& home, const VarBranch<Var>& vb);
MeritCHBSize(Space& home, MeritCHBSize& m);
double operator ()(const Space& home, FloatView x, int i);
bool notice(void) const;
void dispose(Space& home);
};
}}}
#include <gecode/float/branch/merit.hpp>
namespace Gecode { namespace Float { namespace Branch {
GECODE_FLOAT_EXPORT
ViewSel<FloatView>* viewsel(Space& home, const FloatVarBranch& fvb);
}}}
namespace Gecode { namespace Float { namespace Branch {
class ValSelLq : public ValSel<FloatView,FloatNumBranch> {
public:
ValSelLq(Space& home, const ValBranch<Var>& vb);
ValSelLq(Space& home, ValSelLq& vs);
FloatNumBranch val(const Space& home, FloatView x, int i);
};
class ValSelGq : public ValSel<FloatView,FloatNumBranch> {
public:
ValSelGq(Space& home, const ValBranch<Var>& vb);
ValSelGq(Space& home, ValSelGq& vs);
FloatNumBranch val(const Space& home, FloatView x, int i);
};
class ValSelRnd : public ValSel<FloatView,FloatNumBranch> {
protected:
Rnd r;
public:
ValSelRnd(Space& home, const ValBranch<Var>& vb);
ValSelRnd(Space& home, ValSelRnd& vs);
FloatNumBranch val(const Space& home, FloatView x, int i);
bool notice(void) const;
void dispose(Space& home);
};
}}}
#include <gecode/float/branch/val-sel.hpp>
namespace Gecode { namespace Float { namespace Branch {
class ValCommitLqGq : public ValCommit<FloatView,FloatVal> {
public:
ValCommitLqGq(Space& home, const ValBranch<Var>& vb);
ValCommitLqGq(Space& home, ValCommitLqGq& vc);
ModEvent commit(Space& home, unsigned int a, FloatView x, int i,
FloatNumBranch n);
NGL* ngl(Space& home, unsigned int a, FloatView x, FloatNumBranch n) const;
void print(const Space& home, unsigned int a, FloatView x, int i,
FloatNumBranch n,
std::ostream& o) const;
};
}}}
#include <gecode/float/branch/val-commit.hpp>
namespace Gecode { namespace Float { namespace Branch {
GECODE_FLOAT_EXPORT
ValSelCommitBase<FloatView,FloatNumBranch>*
valselcommit(Space& home, const FloatValBranch& svb);
GECODE_FLOAT_EXPORT
ValSelCommitBase<FloatView,FloatNumBranch>*
valselcommit(Space& home, const FloatAssign& ia);
}}}
#endif
// STATISTICS: float-branch
Gecode::AFC
Class for AFC (accumulated failure count) management.
Definition afc.hpp:40
Gecode::Action
Class for action management.
Definition action.hpp:42
Gecode::CHB
Class for CHB management.
Definition chb.hpp:46
Gecode::FloatNumBranch
Value description class for branching.
Definition float.hh:1462
Gecode::Float::Branch::MeritAFCSize::operator()
double operator()(const Space &home, FloatView x, int i)
Return AFC over size as merit for view x at position i.
Definition merit.hpp:97
Gecode::Float::Branch::MeritAFCSize::afc
AFC afc
AFC information.
Definition branch.hh:133
Gecode::Float::Branch::MeritAFCSize::dispose
void dispose(Space &home)
Dispose view selection.
Definition merit.hpp:105
Gecode::Float::Branch::MeritAFCSize::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition merit.hpp:101
Gecode::Float::Branch::MeritAFCSize::MeritAFCSize
MeritAFCSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition merit.hpp:91
Gecode::Float::Branch::MeritActionSize::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition merit.hpp:124
Gecode::Float::Branch::MeritActionSize::dispose
void dispose(Space &home)
Dispose view selection.
Definition merit.hpp:128
Gecode::Float::Branch::MeritActionSize::action
Action action
Action information.
Definition branch.hh:156
Gecode::Float::Branch::MeritActionSize::MeritActionSize
MeritActionSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition merit.hpp:112
Gecode::Float::Branch::MeritActionSize::operator()
double operator()(const Space &home, FloatView x, int i)
Return action over size as merit for view x at position i.
Definition merit.hpp:120
Gecode::Float::Branch::MeritCHBSize::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition merit.hpp:147
Gecode::Float::Branch::MeritCHBSize::chb
CHB chb
CHB information.
Definition branch.hh:179
Gecode::Float::Branch::MeritCHBSize::dispose
void dispose(Space &home)
Dispose view selection.
Definition merit.hpp:151
Gecode::Float::Branch::MeritCHBSize::operator()
double operator()(const Space &home, FloatView x, int i)
Return CHB Q-score over size as merit for view x at position i.
Definition merit.hpp:143
Gecode::Float::Branch::MeritCHBSize::MeritCHBSize
MeritCHBSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition merit.hpp:135
Gecode::Float::Branch::MeritDegreeSize::MeritDegreeSize
MeritDegreeSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition merit.hpp:78
Gecode::Float::Branch::MeritDegreeSize::operator()
double operator()(const Space &home, FloatView x, int i)
Return degree over size as merit for view x at position i.
Definition merit.hpp:85
Gecode::Float::Branch::MeritMax::operator()
double operator()(const Space &home, FloatView x, int i)
Return maximum as merit for view x at position i.
Definition merit.hpp:60
Gecode::Float::Branch::MeritMax::MeritMax
MeritMax(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition merit.hpp:54
Gecode::Float::Branch::MeritMin::operator()
double operator()(const Space &home, FloatView x, int i)
Return minimum as merit for view x at position i.
Definition merit.hpp:48
Gecode::Float::Branch::MeritMin::MeritMin
MeritMin(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition merit.hpp:42
Gecode::Float::Branch::MeritSize::MeritSize
MeritSize(Space &home, const VarBranch< Var > &vb)
Constructor for initialization.
Definition merit.hpp:66
Gecode::Float::Branch::MeritSize::operator()
double operator()(const Space &home, FloatView x, int i)
Return size as merit for view x at position i.
Definition merit.hpp:72
Gecode::Float::Branch::ValCommitLqGq::ngl
NGL * ngl(Space &home, unsigned int a, FloatView x, FloatNumBranch n) const
Create no-good literal for alternative a.
Definition val-commit.hpp:63
Gecode::Float::Branch::ValCommitLqGq::commit
ModEvent commit(Space &home, unsigned int a, FloatView x, int i, FloatNumBranch n)
Commit view x at position i to value n for alternative a.
Definition val-commit.hpp:47
Gecode::Float::Branch::ValCommitLqGq::print
void print(const Space &home, unsigned int a, FloatView x, int i, FloatNumBranch n, std::ostream &o) const
Print on o the alternative with view x at position i and value n.
Definition val-commit.hpp:67
Gecode::Float::Branch::ValCommitLqGq::ValCommitLqGq
ValCommitLqGq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition val-commit.hpp:41
Gecode::Float::Branch::ValSelGq::val
FloatNumBranch val(const Space &home, FloatView x, int i)
Return value of view x at position i.
Definition val-sel.hpp:72
Gecode::Float::Branch::ValSelGq::ValSelGq
ValSelGq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition val-sel.hpp:66
Gecode::Float::Branch::ValSelLq::val
FloatNumBranch val(const Space &home, FloatView x, int i)
Return value of view x at position i.
Definition val-sel.hpp:59
Gecode::Float::Branch::ValSelLq::ValSelLq
ValSelLq(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition val-sel.hpp:53
Gecode::Float::Branch::ValSelRnd::val
FloatNumBranch val(const Space &home, FloatView x, int i)
Return value of view x at position i.
Definition val-sel.hpp:86
Gecode::Float::Branch::ValSelRnd::notice
bool notice(void) const
Whether dispose must always be called (that is, notice is needed).
Definition val-sel.hpp:92
Gecode::Float::Branch::ValSelRnd::ValSelRnd
ValSelRnd(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
Definition val-sel.hpp:79
Gecode::Float::Branch::ValSelRnd::dispose
void dispose(Space &home)
Delete value selection.
Definition val-sel.hpp:96
Gecode::Float::Branch::ValSelRnd::r
Rnd r
The used random number generator.
Definition branch.hh:260
Gecode::Float::FloatView
Float view for float variables.
Definition view.hpp:52
Gecode::MeritBase< FloatView, double >::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::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< FloatView, FloatVal >::ValCommit
ValCommit(Space &home, const ValBranch< Var > &vb)
Definition val-commit.hpp:101
Gecode::ValSel< FloatView, FloatNumBranch >::ValSel
ValSel(Space &home, const ValBranch< Var > &vb)
Definition val-sel.hpp:98
Gecode::VarBranch
Variable branching information.
Definition var.hpp:55
merit.hpp
val-commit.hpp
val-sel.hpp
float.hh
GECODE_FLOAT_EXPORT
#define GECODE_FLOAT_EXPORT
Definition float.hh:68
Gecode::Float::Branch
Float branchers.
Gecode::Float::Branch::valselcommit
ValSelCommitBase< FloatView, FloatNumBranch > * valselcommit(Space &home, const FloatValBranch &svb)
Return value and commit for float views.
Definition val-sel-commit.cpp:39
Gecode::Float::Branch::viewsel
ViewSel< FloatView > * viewsel(Space &home, const FloatVarBranch &fvb)
Return view selectors for float views.
Definition view-sel.cpp:39
Gecode::Float
Floating point numbers.
Gecode
Gecode toplevel namespace
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition core.hpp:62