Mercurial > hg > octave-lyh
annotate liboctave/lo-mappers.h @ 10396:a0b51ac0f88a
optimize accumdim with summation
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 05 Mar 2010 12:31:30 +0100 |
parents | 9a16a61ed43d |
children | 00219bdd2d17 |
rev | line source |
---|---|
1967 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, |
8920 | 4 2006, 2007, 2008 John W. Eaton |
1967 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
1967 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
1967 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_liboctave_mappers_h) | |
25 #define octave_liboctave_mappers_h 1 | |
26 | |
27 #include "oct-cmplx.h" | |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
28 #include "lo-math.h" |
1967 | 29 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
30 // Double Precision |
6108 | 31 extern OCTAVE_API double arg (double x); |
32 extern OCTAVE_API double conj (double x); | |
33 extern OCTAVE_API double fix (double x); | |
34 extern OCTAVE_API double imag (double x); | |
35 extern OCTAVE_API double real (double x); | |
36 extern OCTAVE_API double xround (double x); | |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
37 extern OCTAVE_API double xroundb (double x); |
6108 | 38 extern OCTAVE_API double signum (double x); |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
39 extern OCTAVE_API double xtrunc (double x); |
6108 | 40 extern OCTAVE_API double xlog2 (double x); |
7740 | 41 extern OCTAVE_API Complex xlog2 (const Complex& x); |
42 extern OCTAVE_API double xlog2 (double x, int& exp); | |
43 extern OCTAVE_API Complex xlog2 (const Complex& x, int& exp); | |
6108 | 44 extern OCTAVE_API double xexp2 (double x); |
1967 | 45 |
7922
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
46 // These are used by the BOOL_OP macros in mx-op-defs.h. |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
47 inline bool xisnan (bool) { return false; } |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
48 inline bool xisnan (char) { return false; } |
935be827eaf8
error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
49 |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
50 #if defined (HAVE_CMATH_ISNAN) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
51 inline bool xisnan (double x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
52 { return std::isnan (x); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
53 #else |
6108 | 54 extern OCTAVE_API bool xisnan (double x); |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
55 #endif |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
56 #if defined (HAVE_CMATH_ISFINITE) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
57 inline bool xfinite (double x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
58 { return std::isfinite (x); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
59 #else |
6108 | 60 extern OCTAVE_API bool xfinite (double x); |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
61 #endif |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
62 #if defined (HAVE_CMATH_ISINF) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
63 inline bool xisinf (double x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
64 { return std::isinf (x); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
65 #else |
6108 | 66 extern OCTAVE_API bool xisinf (double x); |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
67 #endif |
3248 | 68 |
6108 | 69 extern OCTAVE_API bool octave_is_NA (double x); |
70 extern OCTAVE_API bool octave_is_NaN_or_NA (double x) GCC_ATTR_DEPRECATED; | |
4025 | 71 |
10268
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
72 // Generic xmin, xmax definitions |
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
73 template <class T> |
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
74 inline T xmin (T x, T y) |
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
75 { return x <= y ? x : y; } |
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
76 template <class T> |
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
77 inline T xmax (T x, T y) |
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
78 { return x >= y ? x : y; } |
9a16a61ed43d
new optimizations for accumarray
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
79 |
10146
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
80 // This form is favorable. GCC will translate (x <= y ? x : y) without a jump, |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
81 // hence the only conditional jump involved will be the first (xisnan), infrequent |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
82 // and hence friendly to branch prediction. |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
83 inline double xmin (double x, double y) |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
84 { return xisnan (y) ? x : (x <= y ? x : y);; } |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
85 inline double xmax (double x, double y) |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
86 { return xisnan (y) ? x : (x >= y ? x : y);; } |
1967 | 87 |
6108 | 88 extern OCTAVE_API Complex acos (const Complex& x); |
89 extern OCTAVE_API Complex acosh (const Complex& x); | |
90 extern OCTAVE_API Complex asin (const Complex& x); | |
91 extern OCTAVE_API Complex asinh (const Complex& x); | |
92 extern OCTAVE_API Complex atan (const Complex& x); | |
93 extern OCTAVE_API Complex atanh (const Complex& x); | |
3777 | 94 |
6108 | 95 extern OCTAVE_API Complex ceil (const Complex& x); |
96 extern OCTAVE_API Complex fix (const Complex& x); | |
97 extern OCTAVE_API Complex floor (const Complex& x); | |
98 extern OCTAVE_API Complex xround (const Complex& x); | |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7017
diff
changeset
|
99 extern OCTAVE_API Complex xroundb (const Complex& x); |
6108 | 100 extern OCTAVE_API Complex signum (const Complex& x); |
3776 | 101 |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
102 inline bool |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
103 xisnan (const Complex& x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
104 { return (xisnan (real (x)) || xisnan (imag (x))); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
105 inline bool |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
106 xfinite (const Complex& x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
107 { return (xfinite (real (x)) && xfinite (imag (x))); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
108 inline bool |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
109 xisinf (const Complex& x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
110 { return (xisinf (real (x)) || xisinf (imag (x))); } |
3248 | 111 |
6108 | 112 extern OCTAVE_API bool octave_is_NA (const Complex& x); |
113 extern OCTAVE_API bool octave_is_NaN_or_NA (const Complex& x); | |
4469 | 114 |
6108 | 115 extern OCTAVE_API Complex xmin (const Complex& x, const Complex& y); |
116 extern OCTAVE_API Complex xmax (const Complex& x, const Complex& y); | |
3248 | 117 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
118 // Single Precision |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
119 extern OCTAVE_API float arg (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
120 extern OCTAVE_API float conj (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
121 extern OCTAVE_API float fix (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
122 extern OCTAVE_API float imag (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
123 extern OCTAVE_API float real (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
124 extern OCTAVE_API float xround (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
125 extern OCTAVE_API float xroundb (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
126 extern OCTAVE_API float signum (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
127 extern OCTAVE_API float xtrunc (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
128 extern OCTAVE_API float xlog2 (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
129 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
130 extern OCTAVE_API float xlog2 (float x, int& exp); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
131 extern OCTAVE_API FloatComplex xlog2 (const FloatComplex& x, int& exp); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
132 extern OCTAVE_API float xexp2 (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
133 |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
134 #if defined (HAVE_CMATH_ISNANF) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
135 inline bool xisnan (float x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
136 { return std::isnan (x); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
137 #else |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
138 extern OCTAVE_API bool xisnan (float x); |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
139 #endif |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
140 #if defined (HAVE_CMATH_ISFINITEF) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
141 inline bool xfinite (float x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
142 { return std::isfinite (x); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
143 #else |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
144 extern OCTAVE_API bool xfinite (float x); |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
145 #endif |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
146 #if defined (HAVE_CMATH_ISINFF) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
147 inline bool xisinf (float x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
148 { return std::isinf (x); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
149 #else |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
150 extern OCTAVE_API bool xisinf (float x); |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
151 #endif |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
152 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
153 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
154 extern OCTAVE_API bool octave_is_NA (float x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
155 extern OCTAVE_API bool octave_is_NaN_or_NA (float x) GCC_ATTR_DEPRECATED; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
156 |
10146
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
157 inline float xmin (float x, float y) |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
158 { return xisnan (y) ? x : (x <= y ? x : y);; } |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
159 inline float xmax (float x, float y) |
9597eea7fa36
inline xmin/xmax & optimize special cases
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
160 { return xisnan (y) ? x : (x >= y ? x : y);; } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
161 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
162 extern OCTAVE_API FloatComplex acos (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
163 extern OCTAVE_API FloatComplex acosh (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
164 extern OCTAVE_API FloatComplex asin (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
165 extern OCTAVE_API FloatComplex asinh (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
166 extern OCTAVE_API FloatComplex atan (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
167 extern OCTAVE_API FloatComplex atanh (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
168 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
169 extern OCTAVE_API FloatComplex ceil (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
170 extern OCTAVE_API FloatComplex fix (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
171 extern OCTAVE_API FloatComplex floor (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
172 extern OCTAVE_API FloatComplex xround (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
173 extern OCTAVE_API FloatComplex xroundb (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
174 extern OCTAVE_API FloatComplex signum (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
175 |
8998
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
176 inline bool |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
177 xisnan (const FloatComplex& x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
178 { return (xisnan (real (x)) || xisnan (imag (x))); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
179 inline bool |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
180 xfinite (const FloatComplex& x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
181 { return (xfinite (real (x)) && xfinite (imag (x))); } |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
182 inline bool |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
183 xisinf (const FloatComplex& x) |
a48fba01e4ac
optimize isnan/isinf/isfinite mappers
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
184 { return (xisinf (real (x)) || xisinf (imag (x))); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
185 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
186 extern OCTAVE_API bool octave_is_NA (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
187 extern OCTAVE_API bool octave_is_NaN_or_NA (const FloatComplex& x); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
188 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
189 extern OCTAVE_API FloatComplex xmin (const FloatComplex& x, const FloatComplex& y); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
190 extern OCTAVE_API FloatComplex xmax (const FloatComplex& x, const FloatComplex& y); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7740
diff
changeset
|
191 |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
192 // These map reals to Complex. |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
193 |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
194 extern OCTAVE_API Complex rc_acos (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
195 extern OCTAVE_API FloatComplex rc_acos (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
196 extern OCTAVE_API Complex rc_acosh (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
197 extern OCTAVE_API FloatComplex rc_acosh (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
198 extern OCTAVE_API Complex rc_asin (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
199 extern OCTAVE_API FloatComplex rc_asin (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
200 extern OCTAVE_API Complex rc_atanh (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
201 extern OCTAVE_API FloatComplex rc_atanh (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
202 extern OCTAVE_API Complex rc_log (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
203 extern OCTAVE_API FloatComplex rc_log (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
204 extern OCTAVE_API Complex rc_log2 (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
205 extern OCTAVE_API FloatComplex rc_log2 (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
206 extern OCTAVE_API Complex rc_log10 (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
207 extern OCTAVE_API FloatComplex rc_log10 (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
208 extern OCTAVE_API Complex rc_sqrt (double); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
209 extern OCTAVE_API FloatComplex rc_sqrt (float); |
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
8998
diff
changeset
|
210 |
1967 | 211 #endif |