Update testlib

This commit is contained in:
2023-10-31 20:10:56 +01:00
parent 865a3e4b47
commit f5404307e1
2 changed files with 41 additions and 21 deletions

View File

@@ -12,8 +12,6 @@
#include "testlib.hpp"
#include <type_traits>
static void print_message(std::string msg)
{
if (msg.size() > 0) {
@@ -42,17 +40,3 @@ void m_assert(bool expr, std::string expr_str, std::string f, std::string file,
abort();
}
}
bool close_to(arma::vec &a, arma::vec &b, double tol)
{
if (a.n_elem != b.n_elem) {
return false;
}
for (size_t i = 0; i < a.n_elem; i++) {
if (std::abs(a(i) - b(i)) >= tol) {
return false;
}
}
return true;
}