use templated is_nan check
parent
a807127b51
commit
6fb3f0f209
|
|
@ -18,7 +18,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
@ -433,7 +432,7 @@ class IncompleteGammaInverse {
|
||||||
*/
|
*/
|
||||||
static constexpr T compute(const T a, const T p) noexcept {
|
static constexpr T compute(const T a, const T p) noexcept {
|
||||||
// Perform checks on the input and return the corresponding best answer
|
// Perform checks on the input and return the corresponding best answer
|
||||||
if (isnan(a) || isnan(p)) { // NaN check
|
if (is_nan(a) || is_nan(p)) { // NaN check
|
||||||
return LIM<T>::quiet_NaN();
|
return LIM<T>::quiet_NaN();
|
||||||
} else if (LIM<T>::min() > p) { // Check lower bound
|
} else if (LIM<T>::min() > p) { // Check lower bound
|
||||||
return T(0);
|
return T(0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue