49#ifndef DOXYGEN_SHOULD_SKIP_THIS
67 INLINE K2::K2(K2&& from) :
68 GreedyHillClimbing(
std::move(from)), _order_(
std::move(from._order_)) {
79 INLINE K2& K2::operator=(
const K2& from) {
81 GreedyHillClimbing::operator=(from);
82 _order_ = from._order_;
88 INLINE K2& K2::operator=(K2&& from) {
90 GreedyHillClimbing::operator=(std::move(from));
91 _order_ = std::move(from._order_);
97 INLINE
void K2::setOrder(
const Sequence< NodeId >& order) { _order_ = order; }
100 INLINE
void K2::setOrder(
const std::vector< NodeId >& order) {
102 for (
const auto node: order) {
103 _order_.insert(node);
108 INLINE
const Sequence< NodeId >& K2::order() const noexcept {
return _order_; }
112 INLINE
void K2::_checkOrder_(
const std::vector< Size >& modal) {
113 if (modal.size() != _order_.size()) {
115 "the number of elements in the order given "
116 "to K2 is not the same as the number of nodes");
118 bool order_ok =
true;
119 for (
const auto node: _order_) {
120 if (node >= _order_.size()) {
127 "there exist at least one node in the order "
128 "given to K2 that has no domain size");
133 INLINE ApproximationScheme& K2::approximationScheme() {
134 return GreedyHillClimbing::approximationScheme();
Exception: at least one argument passed to a function is not what was expected.
The greedy hill climbing learning algorithm (for directed graphs).
#define GUM_ERROR(type, msg)
include the inlined functions if necessary
gum is the global namespace for all aGrUM entities