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
FloatValBranch::FloatValBranch(Select s0)
: s(s0) {}
forceinline
FloatValBranch::FloatValBranch(Rnd r)
: ValBranch<FloatVar>(r), s(SEL_SPLIT_RND) {}
forceinline
FloatValBranch::FloatValBranch(FloatBranchVal v, FloatBranchCommit c)
: ValBranch<FloatVar>(v,c), s(SEL_VAL_COMMIT) {}
forceinline FloatValBranch::Select
FloatValBranch::select(void) const {
return s;
}
inline FloatValBranch
FLOAT_VAL_SPLIT_MIN(void) {
return FloatValBranch(FloatValBranch::SEL_SPLIT_MIN);
}
inline FloatValBranch
FLOAT_VAL_SPLIT_MAX(void) {
return FloatValBranch(FloatValBranch::SEL_SPLIT_MAX);
}
inline FloatValBranch
FLOAT_VAL_SPLIT_RND(Rnd r) {
return FloatValBranch(r);
}
inline FloatValBranch
FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c) {
return FloatValBranch(v,c);
}
}
// STATISTICS: float-branch
Gecode::FloatValBranch
Which values to select for branching first.
Definition float.hh:1820
Gecode::FloatValBranch::select
Select select(void) const
Return selection strategy.
Definition val.hpp:49
Gecode::FloatValBranch::Select
Select
Which value selection.
Definition float.hh:1823
Gecode::FloatValBranch::SEL_SPLIT_RND
@ SEL_SPLIT_RND
Select values randomly which are not greater or not smaller than mean of largest and smallest value.
Definition float.hh:1826
Gecode::FloatValBranch::SEL_SPLIT_MIN
@ SEL_SPLIT_MIN
Select values not greater than mean of smallest and largest value.
Definition float.hh:1824
Gecode::FloatValBranch::SEL_VAL_COMMIT
@ SEL_VAL_COMMIT
Select value according to user-defined functions.
Definition float.hh:1827
Gecode::FloatValBranch::SEL_SPLIT_MAX
@ SEL_SPLIT_MAX
Select values greater than mean of smallest and largest value.
Definition float.hh:1825
Gecode::FloatValBranch::s
Select s
Which value to select.
Definition float.hh:1831
Gecode::FloatValBranch::FloatValBranch
FloatValBranch(Select s=SEL_SPLIT_MIN)
Initialize with selection strategy s.
Definition val.hpp:37
Gecode::FloatVar
Float variables.
Definition float.hh:870
Gecode::Rnd
Random number generator.
Definition rnd.hpp:42
Gecode::ValBranch< FloatVar >::ValBranch
ValBranch(void)
Definition val.hpp:72
Gecode::ValBranch< FloatVar >::r
Rnd r
Definition val.hpp:49
Gecode::FloatBranchVal
std::function< FloatNumBranch(const Space &home, FloatVar x, int i)> FloatBranchVal
Branch value function type for float variables.
Definition float.hh:1481
Gecode::FloatBranchCommit
std::function< void(Space &home, unsigned int a, FloatVar x, int i, FloatNumBranch nl)> FloatBranchCommit
Branch commit function type for float variables.
Definition float.hh:1496
Gecode
Gecode toplevel namespace
Gecode::FLOAT_VAL_SPLIT_MAX
FloatValBranch FLOAT_VAL_SPLIT_MAX(void)
Select values greater than mean of smallest and largest value.
Definition val.hpp:60
Gecode::FLOAT_VAL_SPLIT_RND
FloatValBranch FLOAT_VAL_SPLIT_RND(Rnd r)
Select values randomly which are not greater or not smaller than mean of largest and smallest value.
Definition val.hpp:65
Gecode::FLOAT_VAL
FloatValBranch FLOAT_VAL(FloatBranchVal v, FloatBranchCommit c=nullptr)
Definition val.hpp:70
Gecode::FLOAT_VAL_SPLIT_MIN
FloatValBranch FLOAT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition val.hpp:55
forceinline
#define forceinline
Definition config.hpp:187