51#ifndef DOXYGEN_SHOULD_SKIP_THIS
69 INLINE K2::K2(K2&& from) :
70 GreedyHillClimbing(
std::move(from)), _order_(
std::move(from._order_)) {
81 INLINE K2& K2::operator=(
const K2& from) {
83 GreedyHillClimbing::operator=(from);
84 _order_ = from._order_;
90 INLINE K2& K2::operator=(K2&& from) {
92 GreedyHillClimbing::operator=(std::move(from));
93 _order_ = std::move(from._order_);
99 INLINE
void K2::setOrder(
const Sequence< NodeId >& order) { _order_ = order; }
102 INLINE
void K2::setOrder(
const std::vector< NodeId >& order) {
104 for (
const auto node: order) {
105 _order_.insert(node);
110 INLINE
const Sequence< NodeId >& K2::order() const noexcept {
return _order_; }
114 INLINE
void K2::_checkOrder_(
const std::vector< Size >& modal) {
115 if (modal.size() != _order_.size()) {
117 "the number of elements in the order given "
118 "to K2 is not the same as the number of nodes");
120 bool order_ok =
true;
121 for (
const auto node: _order_) {
122 if (node >= _order_.size()) {
129 "there exist at least one node in the order "
130 "given to K2 that has no domain size");
135 INLINE ApproximationScheme& K2::approximationScheme() {
136 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