xtensor
Loading...
Searching...
No Matches
Classification functions

Functions

template<class E >
auto xt::isfinite (E &&e) noexcept -> detail::xfunction_type_t< math::isfinite_fun, E >
 finite value check
 
template<class E >
auto xt::isinf (E &&e) noexcept -> detail::xfunction_type_t< math::isinf_fun, E >
 infinity check
 
template<class E >
auto xt::isnan (E &&e) noexcept -> detail::xfunction_type_t< math::isnan_fun, E >
 NaN check.
 
template<class E1 , class E2 >
auto xt::isclose (E1 &&e1, E2 &&e2, double rtol=1e-05, double atol=1e-08, bool equal_nan=false) noexcept
 Element-wise closeness detection.
 
template<class E1 , class E2 >
auto xt::allclose (E1 &&e1, E2 &&e2, double rtol=1e-05, double atol=1e-08) noexcept
 Check if all elements in e1 are close to the corresponding elements in e2.
 

Detailed Description

Function Documentation

◆ allclose()

template<class E1 , class E2 >
auto xt::allclose ( E1 && e1,
E2 && e2,
double rtol = 1e-05,
double atol = 1e-08 )
inlinenoexcept

Check if all elements in e1 are close to the corresponding elements in e2.

Returns true if all elements in e1 and e2 are close to each other according to parameters atol and rtol.

Parameters
e1input array to compare
e2input arrays to compare
rtolthe relative tolerance parameter (default 1e-05)
atolthe absolute tolerance parameter (default 1e-08)
Returns
a boolean

Definition at line 1813 of file xmath.hpp.

◆ isclose()

template<class E1 , class E2 >
auto xt::isclose ( E1 && e1,
E2 && e2,
double rtol = 1e-05,
double atol = 1e-08,
bool equal_nan = false )
inlinenoexcept

Element-wise closeness detection.

Returns an xfunction that evaluates to true if the elements in e1 and e2 are close to each other according to parameters atol and rtol. The equation is: std::abs(a - b) <= (m_atol + m_rtol * std::abs(b)).

Parameters
e1input array to compare
e2input array to compare
rtolthe relative tolerance parameter (default 1e-05)
atolthe absolute tolerance parameter (default 1e-08)
equal_nanif true, isclose returns true if both elements of e1 and e2 are NaN
Returns
an xfunction

Definition at line 1790 of file xmath.hpp.

◆ isfinite()

template<class E >
auto xt::isfinite ( E && e) -> detail::xfunction_type_t<math::isfinite_fun, E>
inlinenoexcept

finite value check

Returns an xfunction for the element-wise finite value check tangent of e.

Parameters
ean xexpression
Returns
an xfunction

Definition at line 1678 of file xmath.hpp.

◆ isinf()

template<class E >
auto xt::isinf ( E && e) -> detail::xfunction_type_t<math::isinf_fun, E>
inlinenoexcept

infinity check

Returns an xfunction for the element-wise infinity check tangent of e.

Parameters
ean xexpression
Returns
an xfunction

Definition at line 1693 of file xmath.hpp.

◆ isnan()

template<class E >
auto xt::isnan ( E && e) -> detail::xfunction_type_t<math::isnan_fun, E>
inlinenoexcept

NaN check.

Returns an xfunction for the element-wise NaN check tangent of e.

Parameters
ean xexpression
Returns
an xfunction

Definition at line 1708 of file xmath.hpp.