val.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
IntValBranch::IntValBranch(Select s0)
: s(s0) {}
forceinline
IntValBranch::IntValBranch(Rnd r)
: ValBranch<IntVar>(r), s(SEL_RND) {}
forceinline
IntValBranch::IntValBranch(IntBranchVal v, IntBranchCommit c)
: ValBranch<IntVar>(v,c), s(SEL_VAL_COMMIT) {}
forceinline IntValBranch::Select
IntValBranch::select(void) const {
return s;
}
inline IntValBranch
INT_VAL_MIN(void) {
return IntValBranch(IntValBranch::SEL_MIN);
}
inline IntValBranch
INT_VAL_MED(void) {
return IntValBranch(IntValBranch::SEL_MED);
}
inline IntValBranch
INT_VAL_MAX(void) {
return IntValBranch(IntValBranch::SEL_MAX);
}
inline IntValBranch
INT_VAL_RND(Rnd r) {
return IntValBranch(r);
}
inline IntValBranch
INT_VAL_SPLIT_MIN(void) {
return IntValBranch(IntValBranch::SEL_SPLIT_MIN);
}
inline IntValBranch
INT_VAL_SPLIT_MAX(void) {
return IntValBranch(IntValBranch::SEL_SPLIT_MAX);
}
inline IntValBranch
INT_VAL_RANGE_MIN(void) {
return IntValBranch(IntValBranch::SEL_RANGE_MIN);
}
inline IntValBranch
INT_VAL_RANGE_MAX(void) {
return IntValBranch(IntValBranch::SEL_RANGE_MAX);
}
inline IntValBranch
INT_VAL(IntBranchVal v, IntBranchCommit c) {
return IntValBranch(v,c);
}
inline IntValBranch
INT_VALUES_MIN(void) {
return IntValBranch(IntValBranch::SEL_VALUES_MIN);
}
inline IntValBranch
INT_VALUES_MAX(void) {
return IntValBranch(IntValBranch::SEL_VALUES_MAX);
}
forceinline
BoolValBranch::BoolValBranch(Select s0)
: s(s0) {}
forceinline
BoolValBranch::BoolValBranch(Rnd r)
: ValBranch<BoolVar>(r), s(SEL_RND) {}
forceinline
BoolValBranch::BoolValBranch(BoolBranchVal v, BoolBranchCommit c)
: ValBranch<BoolVar>(v,c), s(SEL_VAL_COMMIT) {}
forceinline BoolValBranch::Select
BoolValBranch::select(void) const {
return s;
}
inline BoolValBranch
BOOL_VAL_MIN(void) {
return BoolValBranch(BoolValBranch::SEL_MIN);
}
inline BoolValBranch
BOOL_VAL_MAX(void) {
return BoolValBranch(BoolValBranch::SEL_MAX);
}
inline BoolValBranch
BOOL_VAL_RND(Rnd r) {
return BoolValBranch(r);
}
inline BoolValBranch
BOOL_VAL(BoolBranchVal v, BoolBranchCommit c) {
return BoolValBranch(v,c);
}
}
// STATISTICS: int-branch
Gecode::BoolValBranch
Which values to select for branching first.
Definition int.hh:4889
Gecode::BoolValBranch::s
Select s
Which value to select.
Definition int.hh:4900
Gecode::BoolValBranch::Select
Select
Which value selection.
Definition int.hh:4892
Gecode::BoolValBranch::SEL_MIN
@ SEL_MIN
Select smallest value.
Definition int.hh:4893
Gecode::BoolValBranch::SEL_RND
@ SEL_RND
Select random value.
Definition int.hh:4895
Gecode::BoolValBranch::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:4896
Gecode::BoolValBranch::SEL_MAX
@ SEL_MAX
Select largest value.
Definition int.hh:4894
Gecode::BoolValBranch::select
Select select(void) const
Return selection strategy.
Definition val.hpp:124
Gecode::BoolValBranch::BoolValBranch
BoolValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition val.hpp:112
Gecode::BoolVar
Boolean integer variables.
Definition int.hh:512
Gecode::IntValBranch
Which values to select for branching first.
Definition int.hh:4854
Gecode::IntValBranch::Select
Select
Which value selection.
Definition int.hh:4857
Gecode::IntValBranch::SEL_VALUES_MIN
@ SEL_VALUES_MIN
Select all values starting from smallest.
Definition int.hh:4867
Gecode::IntValBranch::SEL_RND
@ SEL_RND
Select random value.
Definition int.hh:4861
Gecode::IntValBranch::SEL_SPLIT_MAX
@ SEL_SPLIT_MAX
Select values greater than mean of smallest and largest value.
Definition int.hh:4863
Gecode::IntValBranch::SEL_MIN
@ SEL_MIN
Select smallest value.
Definition int.hh:4858
Gecode::IntValBranch::SEL_MAX
@ SEL_MAX
Select largest value.
Definition int.hh:4860
Gecode::IntValBranch::SEL_RANGE_MAX
@ SEL_RANGE_MAX
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition int.hh:4865
Gecode::IntValBranch::SEL_RANGE_MIN
@ SEL_RANGE_MIN
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition int.hh:4864
Gecode::IntValBranch::SEL_VALUES_MAX
@ SEL_VALUES_MAX
Select all values starting from largest.
Definition int.hh:4868
Gecode::IntValBranch::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition int.hh:4866
Gecode::IntValBranch::SEL_MED
@ SEL_MED
Select greatest value not greater than the median.
Definition int.hh:4859
Gecode::IntValBranch::SEL_SPLIT_MIN
@ SEL_SPLIT_MIN
Select values not greater than mean of smallest and largest value.
Definition int.hh:4862
Gecode::IntValBranch::select
Select select(void) const
Return selection strategy.
Definition val.hpp:49
Gecode::IntValBranch::IntValBranch
IntValBranch(Select s=SEL_MIN)
Initialize with selection strategy s.
Definition val.hpp:37
Gecode::IntValBranch::s
Select s
Which value to select.
Definition int.hh:4872
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_VAL_SPLIT_MIN
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition val.hpp:75
Gecode::INT_VAL_RANGE_MIN
IntValBranch INT_VAL_RANGE_MIN(void)
Select the smallest range of the variable domain if it has several ranges, otherwise select values no...
Definition val.hpp:85
Gecode::INT_VAL_RANGE_MAX
IntValBranch INT_VAL_RANGE_MAX(void)
Select the largest range of the variable domain if it has several ranges, otherwise select values gre...
Definition val.hpp:90
Gecode::BOOL_VAL
BoolValBranch BOOL_VAL(BoolBranchVal v, BoolBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition val.hpp:145
Gecode::INT_VALUES_MAX
IntValBranch INT_VALUES_MAX(void)
Try all values starting from largest.
Definition val.hpp:105
Gecode::INT_VAL_MED
IntValBranch INT_VAL_MED(void)
Select greatest value not greater than the median.
Definition val.hpp:60
Gecode::INT_VAL
IntValBranch INT_VAL(IntBranchVal v, IntBranchCommit c=nullptr)
Select value as defined by the value function v and commit function c Uses a commit function as defau...
Definition val.hpp:95
Gecode::BOOL_VAL_MIN
BoolValBranch BOOL_VAL_MIN(void)
Select smallest value.
Definition val.hpp:130
Gecode::INT_VALUES_MIN
IntValBranch INT_VALUES_MIN(void)
Try all values starting from smallest.
Definition val.hpp:100
Gecode::INT_VAL_MAX
IntValBranch INT_VAL_MAX(void)
Select largest value.
Definition val.hpp:65
Gecode::BOOL_VAL_MAX
BoolValBranch BOOL_VAL_MAX(void)
Select largest value.
Definition val.hpp:135
Gecode::INT_VAL_SPLIT_MAX
IntValBranch INT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition val.hpp:80
Gecode::INT_VAL_MIN
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition val.hpp:55
Gecode::BOOL_VAL_RND
BoolValBranch BOOL_VAL_RND(Rnd r)
Select random value.
Definition val.hpp:140
Gecode::INT_VAL_RND
IntValBranch INT_VAL_RND(Rnd r)
Select random value.
Definition val.hpp:70
forceinline
#define forceinline
Definition config.hpp:187