Discontinuous Galerkin Library
#include "dg/algorithm.h"
dg::ISNFINITE< T > Struct Template Reference

\( f(x) = \mathrm{!std::isfinite(x)}\) More...

Public Member Functions

bool operator() (T x)
 

Detailed Description

template<class T>
struct dg::ISNFINITE< T >

\( f(x) = \mathrm{!std::isfinite(x)}\)

return true if x is NaN or Inf

//Check if a vector contains Inf or NaN
thrust::device_vector<double> x( 100);
bool hasnan = dg::blas1::reduce( x, false, thrust::logical_or<bool>(),
std::cout << "x contains Inf or NaN "<<std::boolalpha<<hasnan<<"\n";
OutputType reduce(const ContainerType &x, OutputType zero, BinaryOp binary_op, UnaryOp unary_op=UnaryOp())
Custom (transform) reduction
Definition: blas1.h:139
@ x
x direction
Definition: functors.h:239

Member Function Documentation

◆ operator()()

template<class T >
bool dg::ISNFINITE< T >::operator() ( x)
inline

The documentation for this struct was generated from the following file: