Ice Sheet System Model
4.18
Code documentation
src
c
shared
Numerics
isnan.h
Go to the documentation of this file.
1
#ifndef _XISNAN_H_
2
#define _XISNAN_H_
3
4
#ifdef HAVE_CONFIG_H
5
#include <config.h>
6
#else
7
#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
8
#endif
9
10
/*cmath defines isnan and isinf*/
11
#include <cmath>
12
13
#ifdef _INTEL_WIN_
14
template
<
class
T>
int
xIsNan
(
const
T& X){
return
(X!=X)?1:0;}
15
#else
16
template
<
class
T>
int
xIsNan
(
const
T& X){
return
std::isnan(X); }
17
#endif
18
template
<
class
T>
int
xIsInf
(
const
T& X){
return
std::isinf(X); }
19
20
/*Special overloading definitions for AD*/
21
22
#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
23
#include "
./types.h
"
24
template
<>
int
xIsNan<adouble> (
const
adouble& X);
25
template
<>
int
xIsInf<adouble> (
const
adouble& X);
26
#endif
27
28
#if defined(_HAVE_CODIPACK_) && !defined(_WRAPPERS_)
29
#include "
./types.h
"
30
template
<>
int
xIsNan<IssmDouble> (
const
IssmDouble
& X);
31
template
<>
int
xIsInf<IssmDouble> (
const
IssmDouble
& X);
32
#endif
33
34
#endif
IssmDouble
double IssmDouble
Definition:
types.h:37
xIsNan
int xIsNan(const T &X)
Definition:
isnan.h:16
types.h
prototypes for types.h
xIsInf
int xIsInf(const T &X)
Definition:
isnan.h:18
Generated on Thu Jul 2 2020 08:09:22 for Ice Sheet System Model by
1.8.19