itcompat.h
Go to the documentation of this file.
#ifndef ITCOMPAT_H
#define ITCOMPAT_H
#ifndef _MSC_VER
# include <itpp/config.h>
#else
# include <itpp/config_msvc.h>
#endif
// Microsoft Visual C++ underscore prefixed functions
#if defined(_MSC_VER)
# include <cfloat>
# define finite(x) _finite(x)
# define isfinite(x) _finite(x)
# define isnan(x) _isnan(x)
# define fpclass(x) _fpclass(x)
# define FP_NINF _FPCLASS_NINF
# define FP_PINF _FPCLASS_PINF
# define jn(a, b) _jn(a, b)
# define yn(a, b) _yn(a, b)
# define j0(a) _j0(a)
# define j1(a) _j1(a)
#endif // defined(_MSC_VER)
// Solaris uses <ieeefp.h> for declaring isnan() and finite() functions
#if defined(HAVE_IEEEFP_H)
# include <ieeefp.h>
#endif
// These definitions would collide with IT++ functions
#if defined(min)
# undef min
#endif
#if defined(max)
# undef max
#endif
#if defined(log2)
# undef log2
#endif
namespace std
{
#ifndef HAVE_STD_ISINF
#if (HAVE_DECL_ISINF == 1) || defined(HAVE_ISINF)
inline int isinf(double x) { return ::isinf(x); }
#elif defined(FPCLASS)
inline int isinf(double x)
{
if (::fpclass(a) == FP_NINF) return -1;
else if (::fpclass(a) == FP_PINF) return 1;
else return 0;
}
#else
inline int isinf(double x)
{
if ((x == x) && ((x - x) != 0.0)) return (x < 0.0 ? -1 : 1);
else return 0;
}
#endif // #if (HAVE_DECL_ISINF == 1) || defined(HAVE_ISINF)
#endif // #ifndef HAVE_STD_ISINF
#ifndef HAVE_STD_ISNAN
#if (HAVE_DECL_ISNAN == 1) || defined(HAVE_ISNAN)
inline int isnan(double x) { return ::isnan(x); }
#else
inline int isnan(double x) { return ((x != x) ? 1 : 0); }
#endif // #if (HAVE_DECL_ISNAN == 1) || defined(HAVE_ISNAN)
#endif // #ifndef HAVE_STD_ISNAN
#ifndef HAVE_STD_ISFINITE
#if (HAVE_DECL_ISFINITE == 1) || defined(HAVE_ISFINITE)
inline int isfinite(double x) { return ::isfinite(x); }
#elif defined(HAVE_FINITE)
inline int isfinite(double x) { return ::finite(x); }
#else
inline int isfinite(double x)
{
return ((!std::isnan(x) && !std::isinf(x)) ? 1 : 0);
}
#endif // #if (HAVE_DECL_ISFINITE == 1) || defined(HAVE_ISFINITE)
#endif // #ifndef HAVE_STD_ISFINITE
} // namespace std
#ifndef HAVE_TGAMMA
double tgamma(double x);
#endif
#if !defined(HAVE_LGAMMA) || (HAVE_DECL_SIGNGAM != 1)
double lgamma(double x);
extern int signgam;
#endif
#ifndef HAVE_CBRT
double cbrt(double x);
#endif
#ifndef HAVE_LOG1P
inline double log1p(double x) { return std::log(1.0 + x); }
#endif
#ifndef HAVE_LOG2
inline double log2(double x)
{
static const double one_over_log2 = 1.0 / std::log(2.0);
return std::log(x) * one_over_log2;
}
#endif
#ifndef HAVE_EXPM1
double expm1(double x);
#endif // HAVE_EXPM1
#ifndef HAVE_ERFC
double erfc(double x);
#endif
#ifndef HAVE_ERF
inline double erf(double x) { return (1.0 - ::erfc(x)); }
#endif
#ifndef HAVE_ASINH
double asinh(double x);
#endif
#ifndef HAVE_ACOSH
double acosh(double x);
#endif
#ifndef HAVE_ATANH
double atanh(double x);
#endif
#ifndef HAVE_RINT
double rint(double x);
#endif
// Represent GCC version in a concise form
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#endif // ITCOMPAT_H
itpp::erf
std::complex< double > erf(const std::complex< double > &z)
Error function for complex argument.
Definition error.cpp:154
itpp::erfc
vec erfc(const vec &x)
Complementary error function.
Definition error.cpp:240
itpp::asinh
vec asinh(const vec &x)
Inverse sine hyperbolic function.
Definition trig_hyp.cpp:36
itpp::acosh
vec acosh(const vec &x)
Inverse cosine hyperbolic function.
Definition trig_hyp.cpp:40
itpp::atanh
vec atanh(const vec &x)
Inverse tan hyperbolic function.
Definition trig_hyp.cpp:44
itpp::log2
vec log2(const vec &x)
log-2 of the elements
Definition log_exp.cpp:36
std
STL namespace.

Generated on Mon Jun 10 2024 11:49:17 for IT++ by Doxygen 1.9.8