From 3b389cb31f77fb86dcab87f8ad979cd852908fba Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 5 Feb 2018 09:34:50 +0100 Subject: compat/nan: retire It was broken for MSVC where isnan doesn't work with fast math. Fall back to `fpclassify'. Adjust usages. --- tracker-pt/point_tracker.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tracker-pt') diff --git a/tracker-pt/point_tracker.cpp b/tracker-pt/point_tracker.cpp index 56a029fe..5efbbfe8 100644 --- a/tracker-pt/point_tracker.cpp +++ b/tracker-pt/point_tracker.cpp @@ -6,7 +6,6 @@ */ #include "point_tracker.h" -#include "compat/nan.hpp" #include "compat/math-imports.hpp" using namespace types; @@ -372,18 +371,24 @@ int PointTracker::POSIT(const PointModel& model, const PointOrder& order, f foca for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) - if (nanp(r(i, j))) + { + int ret = std::fpclassify(r(i, j)); + if (ret == FP_NAN || ret == FP_INFINITE) { - qDebug() << "posit nan"; + qDebug() << "posit nan -- R"; return -1; } + } for (unsigned i = 0; i < 3; i++) - if (nanp(t[i])) + { + int ret = std::fpclassify(t[i]); + if (ret == FP_NAN || ret == FP_INFINITE) { - qDebug() << "posit nan"; + qDebug() << "posit nan -- T"; return -1; } + } // apply results X_CM.R = r; -- cgit v1.2.3