coord/ops: add isfinite call for vectors

This commit is contained in:
Danny Robson 2020-01-14 14:07:52 +11:00
parent 4bea2668c3
commit 49c0b35fe7

View File

@ -1491,7 +1491,23 @@ namespace cruft {
val
);
}
};
//-------------------------------------------------------------------------
template <
std::size_t S,
typename T,
typename = std::enable_if_t<std::is_floating_point_v<T>>
>
vector<S,bool>
isfinite (vector<S,T> const &val)
{
vector<S,bool> res;
for (std::size_t i = 0; i < S; ++i)
res[i] = std::isfinite (val[i]);
return res;
}
}
///////////////////////////////////////////////////////////////////////////////