assign.hpp
Go to the documentation of this file.
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 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.
*
*/
namespace Gecode {
forceinline
IntAssign::IntAssign(Select s0)
: s(s0) {}
forceinline
IntAssign::IntAssign(Rnd r)
: ValBranch<IntVar>(r), s(SEL_RND) {}
forceinline
IntAssign::IntAssign(IntBranchVal v, IntBranchCommit c)
: ValBranch<IntVar>(v,c), s(SEL_VAL_COMMIT) {}
forceinline IntAssign::Select
IntAssign::select(void) const {
return s;
}
inline IntAssign
INT_ASSIGN_MIN(void) {
return IntAssign(IntAssign::SEL_MIN);
}
inline IntAssign
INT_ASSIGN_MED(void) {
return IntAssign(IntAssign::SEL_MED);
}
inline IntAssign
INT_ASSIGN_MAX(void) {
return IntAssign(IntAssign::SEL_MAX);
}
inline IntAssign
INT_ASSIGN_RND(Rnd r) {
return IntAssign(r);
}
inline IntAssign
INT_ASSIGN(IntBranchVal v, IntBranchCommit c) {
return IntAssign(v,c);
}
forceinline
BoolAssign::BoolAssign(Select s0)
: s(s0) {}
forceinline
BoolAssign::BoolAssign(Rnd r)
: ValBranch<BoolVar>(r), s(SEL_RND) {}
forceinline
BoolAssign::BoolAssign(BoolBranchVal v, BoolBranchCommit c)
: ValBranch<BoolVar>(v,c), s(SEL_VAL_COMMIT) {}
forceinline BoolAssign::Select
BoolAssign::select(void) const {
return s;
}
inline BoolAssign
BOOL_ASSIGN_MIN(void) {
return BoolAssign(BoolAssign::SEL_MIN);
}
inline BoolAssign
BOOL_ASSIGN_MAX(void) {
return BoolAssign(BoolAssign::SEL_MAX);
}
inline BoolAssign
BOOL_ASSIGN_RND(Rnd r) {
return BoolAssign(r);
}
inline BoolAssign
BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c) {
return BoolAssign(v,c);
}
}
// STATISTICS: int-branch
Gecode::BoolAssign
Which values to select for assignment.
Definition int.hh:5000
Gecode::BoolAssign::Select
Select
Which value selection.
Definition int.hh:5003
Gecode::BoolAssign::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:5007
Gecode::BoolAssign::SEL_MIN
@ SEL_MIN
Select smallest value.
Definition int.hh:5004
Gecode::BoolAssign::SEL_MAX
@ SEL_MAX
Select largest value.
Definition int.hh:5005
Gecode::BoolAssign::SEL_RND
@ SEL_RND
Select random value.
Definition int.hh:5006
Gecode::BoolAssign::BoolAssign
BoolAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition assign.hpp:82
Gecode::BoolAssign::select
Select select(void) const
Return selection strategy.
Definition assign.hpp:94
Gecode::BoolAssign::s
Select s
Which value to select.
Definition int.hh:5011
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::IntAssign
Which values to select for assignment.
Definition int.hh:4971
Gecode::IntAssign::s
Select s
Which value to select.
Definition int.hh:4983
Gecode::IntAssign::select
Select select(void) const
Return selection strategy.
Definition assign.hpp:49
Gecode::IntAssign::IntAssign
IntAssign(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition assign.hpp:37
Gecode::IntAssign::Select
Select
Which value selection.
Definition int.hh:4974
Gecode::IntAssign::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:4979
Gecode::IntAssign::SEL_MIN
@ SEL_MIN
Select smallest value.
Definition int.hh:4975
Gecode::IntAssign::SEL_MED
@ SEL_MED
Select greatest value not greater than the median.
Definition int.hh:4976
Gecode::IntAssign::SEL_RND
@ SEL_RND
Select random value.
Definition int.hh:4978
Gecode::IntAssign::SEL_MAX
@ SEL_MAX
Select largest value.
Definition int.hh:4977
Gecode::IntVar
Integer variables.
Definition int.hh:371
Gecode::Rnd
Random number generator.
Definition rnd.hpp:42
Gecode::ValBranch< IntVar >::ValBranch
ValBranch(void)
Definition val.hpp:72
Gecode::ValBranch< IntVar >::r
Rnd r
Definition val.hpp:49
Gecode::BoolBranchVal
std::function< int(const Space &home, BoolVar x, int i)> BoolBranchVal
Branch value function type for Boolean variables.
Definition int.hh:4234
Gecode::IntBranchVal
std::function< int(const Space &home, IntVar x, int i)> IntBranchVal
Branch value function type for integer variables.
Definition int.hh:4222
Gecode::BoolBranchCommit
std::function< void(Space &home, unsigned int a, BoolVar x, int i, int n)> BoolBranchCommit
Branch commit function type for Boolean variables.
Definition int.hh:4263
Gecode::IntBranchCommit
std::function< void(Space &home, unsigned int a, IntVar x, int i, int n)> IntBranchCommit
Branch commit function type for integer variables.
Definition int.hh:4249
Gecode
Gecode toplevel namespace
Gecode::INT_ASSIGN
IntAssign INT_ASSIGN(IntBranchVal v, IntBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c.
Definition assign.hpp:75
Gecode::INT_ASSIGN_RND
IntAssign INT_ASSIGN_RND(Rnd r)
Select random value.
Definition assign.hpp:70
Gecode::BOOL_ASSIGN_MAX
BoolAssign BOOL_ASSIGN_MAX(void)
Select largest value.
Definition assign.hpp:105
Gecode::BOOL_ASSIGN_RND
BoolAssign BOOL_ASSIGN_RND(Rnd r)
Select random value.
Definition assign.hpp:110
Gecode::INT_ASSIGN_MED
IntAssign INT_ASSIGN_MED(void)
Select greatest value not greater than the median.
Definition assign.hpp:60
Gecode::BOOL_ASSIGN
BoolAssign BOOL_ASSIGN(BoolBranchVal v, BoolBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c.
Definition assign.hpp:115
Gecode::INT_ASSIGN_MIN
IntAssign INT_ASSIGN_MIN(void)
Select smallest value.
Definition assign.hpp:55
Gecode::BOOL_ASSIGN_MIN
BoolAssign BOOL_ASSIGN_MIN(void)
Select smallest value.
Definition assign.hpp:100
Gecode::INT_ASSIGN_MAX
IntAssign INT_ASSIGN_MAX(void)
Select largest value.
Definition assign.hpp:65
forceinline
#define forceinline
Definition config.hpp:187