00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if !defined (octave_liboctave_mappers_h)
00025 #define octave_liboctave_mappers_h 1
00026
00027 #include "oct-cmplx.h"
00028 #include "lo-math.h"
00029
00030
00031 extern OCTAVE_API double arg (double x);
00032 extern OCTAVE_API double conj (double x);
00033 extern OCTAVE_API double fix (double x);
00034 extern OCTAVE_API double imag (double x);
00035 extern OCTAVE_API double real (double x);
00036 extern OCTAVE_API double xround (double x);
00037 extern OCTAVE_API double xroundb (double x);
00038 extern OCTAVE_API double signum (double x);
00039 extern OCTAVE_API double xtrunc (double x);
00040 extern OCTAVE_API double xlog2 (double x);
00041 extern OCTAVE_API Complex xlog2 (const Complex& x);
00042 extern OCTAVE_API double xlog2 (double x, int& exp);
00043 extern OCTAVE_API Complex xlog2 (const Complex& x, int& exp);
00044 extern OCTAVE_API double xexp2 (double x);
00045
00046
00047 inline bool xisnan (bool) { return false; }
00048 inline bool xisnan (char) { return false; }
00049
00050 #if defined (HAVE_CMATH_ISNAN)
00051 inline bool xisnan (double x)
00052 { return std::isnan (x); }
00053 #else
00054 extern OCTAVE_API bool xisnan (double x);
00055 #endif
00056 #if defined (HAVE_CMATH_ISFINITE)
00057 inline bool xfinite (double x)
00058 { return std::isfinite (x); }
00059 #else
00060 extern OCTAVE_API bool xfinite (double x);
00061 #endif
00062 #if defined (HAVE_CMATH_ISINF)
00063 inline bool xisinf (double x)
00064 { return std::isinf (x); }
00065 #else
00066 extern OCTAVE_API bool xisinf (double x);
00067 #endif
00068
00069 extern OCTAVE_API bool octave_is_NA (double x);
00070 extern OCTAVE_API bool octave_is_NaN_or_NA (double x) GCC_ATTR_DEPRECATED;
00071
00072 extern OCTAVE_API double xmin (double x, double y);
00073 extern OCTAVE_API double xmax (double x, double y);
00074
00075 extern OCTAVE_API Complex acos (const Complex& x);
00076 extern OCTAVE_API Complex acosh (const Complex& x);
00077 extern OCTAVE_API Complex asin (const Complex& x);
00078 extern OCTAVE_API Complex asinh (const Complex& x);
00079 extern OCTAVE_API Complex atan (const Complex& x);
00080 extern OCTAVE_API Complex atanh (const Complex& x);
00081
00082 extern OCTAVE_API Complex ceil (const Complex& x);
00083 extern OCTAVE_API Complex fix (const Complex& x);
00084 extern OCTAVE_API Complex floor (const Complex& x);
00085 extern OCTAVE_API Complex xround (const Complex& x);
00086 extern OCTAVE_API Complex xroundb (const Complex& x);
00087 extern OCTAVE_API Complex signum (const Complex& x);
00088
00089 inline bool
00090 xisnan (const Complex& x)
00091 { return (xisnan (real (x)) || xisnan (imag (x))); }
00092 inline bool
00093 xfinite (const Complex& x)
00094 { return (xfinite (real (x)) && xfinite (imag (x))); }
00095 inline bool
00096 xisinf (const Complex& x)
00097 { return (xisinf (real (x)) || xisinf (imag (x))); }
00098
00099 extern OCTAVE_API bool octave_is_NA (const Complex& x);
00100 extern OCTAVE_API bool octave_is_NaN_or_NA (const Complex& x);
00101
00102 extern OCTAVE_API Complex xmin (const Complex& x, const Complex& y);
00103 extern OCTAVE_API Complex xmax (const Complex& x, const Complex& y);
00104
00105
00106 extern OCTAVE_API float arg (float x);
00107 extern OCTAVE_API float conj (float x);
00108 extern OCTAVE_API float fix (float x);
00109 extern OCTAVE_API float imag (float x);
00110 extern OCTAVE_API float real (float x);
00111 extern OCTAVE_API float xround (float x);
00112 extern OCTAVE_API float xroundb (float x);
00113 extern OCTAVE_API float signum (float x);
00114 extern OCTAVE_API float xtrunc (float x);
00115 extern OCTAVE_API float xlog2 (float x);
00116 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x);
00117 extern OCTAVE_API float xlog2 (float x, int& exp);
00118 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x, int& exp);
00119 extern OCTAVE_API float xexp2 (float x);
00120
00121 #if defined (HAVE_CMATH_ISNANF)
00122 inline bool xisnan (float x)
00123 { return std::isnan (x); }
00124 #else
00125 extern OCTAVE_API bool xisnan (float x);
00126 #endif
00127 #if defined (HAVE_CMATH_ISFINITEF)
00128 inline bool xfinite (float x)
00129 { return std::isfinite (x); }
00130 #else
00131 extern OCTAVE_API bool xfinite (float x);
00132 #endif
00133 #if defined (HAVE_CMATH_ISINFF)
00134 inline bool xisinf (float x)
00135 { return std::isinf (x); }
00136 #else
00137 extern OCTAVE_API bool xisinf (float x);
00138 #endif
00139
00140
00141 extern OCTAVE_API bool octave_is_NA (float x);
00142 extern OCTAVE_API bool octave_is_NaN_or_NA (float x) GCC_ATTR_DEPRECATED;
00143
00144 extern OCTAVE_API float xmin (float x, float y);
00145 extern OCTAVE_API float xmax (float x, float y);
00146
00147 extern OCTAVE_API FloatComplex acos (const FloatComplex& x);
00148 extern OCTAVE_API FloatComplex acosh (const FloatComplex& x);
00149 extern OCTAVE_API FloatComplex asin (const FloatComplex& x);
00150 extern OCTAVE_API FloatComplex asinh (const FloatComplex& x);
00151 extern OCTAVE_API FloatComplex atan (const FloatComplex& x);
00152 extern OCTAVE_API FloatComplex atanh (const FloatComplex& x);
00153
00154 extern OCTAVE_API FloatComplex ceil (const FloatComplex& x);
00155 extern OCTAVE_API FloatComplex fix (const FloatComplex& x);
00156 extern OCTAVE_API FloatComplex floor (const FloatComplex& x);
00157 extern OCTAVE_API FloatComplex xround (const FloatComplex& x);
00158 extern OCTAVE_API FloatComplex xroundb (const FloatComplex& x);
00159 extern OCTAVE_API FloatComplex signum (const FloatComplex& x);
00160
00161 inline bool
00162 xisnan (const FloatComplex& x)
00163 { return (xisnan (real (x)) || xisnan (imag (x))); }
00164 inline bool
00165 xfinite (const FloatComplex& x)
00166 { return (xfinite (real (x)) && xfinite (imag (x))); }
00167 inline bool
00168 xisinf (const FloatComplex& x)
00169 { return (xisinf (real (x)) || xisinf (imag (x))); }
00170
00171 extern OCTAVE_API bool octave_is_NA (const FloatComplex& x);
00172 extern OCTAVE_API bool octave_is_NaN_or_NA (const FloatComplex& x);
00173
00174 extern OCTAVE_API FloatComplex xmin (const FloatComplex& x, const FloatComplex& y);
00175 extern OCTAVE_API FloatComplex xmax (const FloatComplex& x, const FloatComplex& y);
00176
00177 #endif
00178
00179
00180
00181
00182
00183