Skip to content
Snippets Groups Projects
Commit f836a3df authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: Tweak test tolerance

parent ecdc3ec5
No related branches found
No related tags found
1 merge request!22TEST: Tweak test tolerance
Pipeline #26952 passed
......@@ -5,6 +5,7 @@
#include <armadillo>
#include <cmath>
#include <filesystem>
#include <stdlib.h>
#include <vector>
......@@ -141,10 +142,18 @@ public:
// compare two float vectors
void compare(std::vector<float> a, std::vector<float> b, float tol=1e-5) {
void compare(std::vector<float> a, std::vector<float> b, float tol=1e-4) {
BOOST_CHECK_EQUAL(a.size(), b.size());
for (auto i = 0; i < a.size(); i++) {
BOOST_CHECK_SMALL(a[i] - b[i], tol);
auto va = a[i];
auto vb = b[i];
if (std::abs(va) < 1e-10) va = 0;
if (std::abs(vb) < 1e-10) vb = 0;
BOOST_CHECK_CLOSE(va, vb, tol);
}
}
......
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