summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-02-05 09:34:50 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-02-05 10:16:37 +0100
commit3b389cb31f77fb86dcab87f8ad979cd852908fba (patch)
tree9d70fde118c689c535d39eaf6b85b350a39cddce /tracker-pt
parent0d82a0ccc3c9bb49f28f18e7460a5366e06516bc (diff)
compat/nan: retire
It was broken for MSVC where isnan doesn't work with fast math. Fall back to `fpclassify'. Adjust usages.
Diffstat (limited to 'tracker-pt')
-rw-r--r--tracker-pt/point_tracker.cpp15
1 files changed, 10 insertions, 5 deletions
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;