Skip to content
Snippets Groups Projects
Commit 23572ae6 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Merge branch '289-problem-check-more-exhaustive' into 'devel'

Resolve "Problem::check() more exhaustive"

Closes #289

See merge request !340
parents c8b354bd 4b988af9
No related branches found
No related tags found
1 merge request!340Resolve "Problem::check() more exhaustive"
Pipeline #5044 passed
......@@ -181,6 +181,7 @@ SET(HDRS_MATH
include/core/math/covariance.h
)
SET(HDRS_UTILS
include/core/utils/check_log.hpp
include/core/utils/converter.h
include/core/utils/eigen_assert.h
include/core/utils/eigen_predicates.h
......
......@@ -330,6 +330,11 @@ class Problem : public std::enable_shared_from_this<Problem>
public:
// Print and check ---------------------------------------
void print(int depth, //
std::ostream& stream ,
bool constr_by, //
bool metric, //
bool state_blocks) const;
/**
* \brief print wolf tree
* \param depth : levels to show ( 0: H, T, M : 1: H:S:p, T:F, M:L ; 2: T:F:C ; 3: T:F:C:f ; 4: T:F:C:f:c )
......@@ -345,11 +350,8 @@ class Problem : public std::enable_shared_from_this<Problem>
bool constr_by = false, //
bool metric = true, //
bool state_blocks = false) const;
std::string printToString(int depth = 4, //
bool constr_by = false, //
bool metric = true, //
bool state_blocks = false) const;
bool check(int verbose_level = 0) const;
bool check(int verbose_level) const;
bool check(bool verbose, std::ostream& stream) const;
};
......@@ -394,7 +396,8 @@ inline wolf::SizeStd Problem::getFactorNotificationMapSize() const
return factor_notification_map_.size();
}
} // namespace wolf
#endif // PROBLEM_H
#ifndef CHECK_LOG_HPP
#define CHECK_LOG_HPP
#include <iostream>
#include <string>
class CheckLog {
public:
bool is_consistent_;
std::string explanation_;
CheckLog() {
is_consistent_ = true;
explanation_ = "";
}
CheckLog(bool consistent, std::string explanation) {
is_consistent_ = consistent;
if (not consistent)
explanation_ = explanation;
else
explanation_ = "";
}
~CheckLog(){};
void compose(CheckLog l) {
CheckLog result_log;
is_consistent_ = is_consistent_ and l.is_consistent_;
explanation_ = explanation_ + l.explanation_;
}
};
#endif
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment