1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
20 |
|
21 */ |
|
22 |
240
|
23 #ifdef HAVE_CONFIG_H |
1192
|
24 #include <config.h> |
1
|
25 #endif |
|
26 |
2089
|
27 #include <cctype> |
1
|
28 |
1352
|
29 #include "defun.h" |
|
30 #include "error.h" |
1
|
31 #include "mappers.h" |
|
32 |
2190
|
33 // XXX FIXME XXX -- perhaps this could be avoided by determining |
|
34 // whether the is* functions are actually functions or just macros. |
|
35 |
|
36 int |
|
37 xisalnum (int c) |
|
38 { |
|
39 return isalnum (c); |
|
40 } |
|
41 |
|
42 int |
|
43 xisalpha (int c) |
|
44 { |
|
45 return isalpha (c); |
|
46 } |
|
47 |
|
48 int |
|
49 xisascii (int c) |
|
50 { |
|
51 return isascii (c); |
|
52 } |
|
53 |
|
54 int |
|
55 xiscntrl (int c) |
|
56 { |
|
57 return iscntrl (c); |
|
58 } |
|
59 |
|
60 int |
|
61 xisdigit (int c) |
|
62 { |
|
63 return isdigit (c); |
|
64 } |
|
65 |
|
66 int |
|
67 xisgraph (int c) |
|
68 { |
|
69 return isgraph (c); |
|
70 } |
|
71 |
|
72 int |
|
73 xislower (int c) |
|
74 { |
|
75 return islower (c); |
|
76 } |
|
77 |
|
78 int |
|
79 xisprint (int c) |
|
80 { |
|
81 return isprint (c); |
|
82 } |
|
83 |
|
84 int |
|
85 xispunct (int c) |
|
86 { |
|
87 return ispunct (c); |
|
88 } |
|
89 |
|
90 int |
|
91 xisspace (int c) |
|
92 { |
|
93 return isspace (c); |
|
94 } |
|
95 |
|
96 int |
|
97 xisupper (int c) |
|
98 { |
|
99 return isupper (c); |
|
100 } |
|
101 |
|
102 int |
|
103 xisxdigit (int c) |
|
104 { |
|
105 return isxdigit (c); |
|
106 } |
|
107 |
2267
|
108 int |
|
109 xtoascii (int c) |
|
110 { |
|
111 return toascii (c); |
|
112 } |
|
113 |
|
114 int |
|
115 xtolower (int c) |
|
116 { |
|
117 return tolower (c); |
|
118 } |
|
119 |
|
120 int |
|
121 xtoupper (int c) |
|
122 { |
|
123 return toupper (c); |
|
124 } |
|
125 |
529
|
126 void |
|
127 install_mapper_functions (void) |
|
128 { |
2089
|
129 DEFUN_MAPPER (abs, 0, fabs, abs, 0, 0.0, 0.0, 0, |
529
|
130 "abs (X): compute abs (X) for each element of X"); |
|
131 |
2089
|
132 DEFUN_MAPPER (acos, 0, acos, 0, acos, -1.0, 1.0, 1, |
529
|
133 "acos (X): compute acos (X) for each element of X"); |
|
134 |
2089
|
135 DEFUN_MAPPER (acosh, 0, acosh, 0, acosh, 1.0, DBL_MAX, 1, |
529
|
136 "acosh (X): compute acosh (X) for each element of X"); |
|
137 |
2089
|
138 DEFUN_MAPPER (angle, 0, arg, arg, 0, 0.0, 0.0, 0, |
529
|
139 "angle (X): compute arg (X) for each element of X"); |
|
140 |
2089
|
141 DEFUN_MAPPER (arg, 0, arg, arg, 0, 0.0, 0.0, 0, |
529
|
142 "arg (X): compute arg (X) for each element of X"); |
|
143 |
2089
|
144 DEFUN_MAPPER (asin, 0, asin, 0, asin, -1.0, 1.0, 1, |
529
|
145 "asin (X): compute asin (X) for each element of X"); |
|
146 |
2089
|
147 DEFUN_MAPPER (asinh, 0, asinh, 0, asinh, 0.0, 0.0, 0, |
529
|
148 "asinh (X): compute asinh (X) for each element of X"); |
|
149 |
2089
|
150 DEFUN_MAPPER (atan, 0, atan, 0, atan, 0.0, 0.0, 0, |
529
|
151 "atan (X): compute atan (X) for each element of X"); |
|
152 |
2089
|
153 DEFUN_MAPPER (atanh, 0, atanh, 0, atanh, -1.0, 1.0, 1, |
529
|
154 "atanh (X): compute atanh (X) for each element of X"); |
|
155 |
2089
|
156 DEFUN_MAPPER (ceil, 0, ceil, 0, ceil, 0.0, 0.0, 0, |
529
|
157 "ceil (X): round elements of X toward +Inf"); |
|
158 |
2089
|
159 DEFUN_MAPPER (conj, 0, conj, 0, conj, 0.0, 0.0, 0, |
529
|
160 "conj (X): compute complex conjugate for each element of X"); |
|
161 |
2089
|
162 DEFUN_MAPPER (cos, 0, cos, 0, cos, 0.0, 0.0, 0, |
529
|
163 "cos (X): compute cos (X) for each element of X"); |
|
164 |
2089
|
165 DEFUN_MAPPER (cosh, 0, cosh, 0, cosh, 0.0, 0.0, 0, |
529
|
166 "cosh (X): compute cosh (X) for each element of X"); |
|
167 |
2089
|
168 DEFUN_MAPPER (erf, 0, xerf, 0, 0, 0.0, 0.0, 0, |
624
|
169 "erf (X): compute erf (X) for each element of X"); |
|
170 |
2089
|
171 DEFUN_MAPPER (erfc, 0, xerfc, 0, 0, 0.0, 0.0, 0, |
624
|
172 "erfc (X): compute erfc (X) for each element of X"); |
|
173 |
2089
|
174 DEFUN_MAPPER (exp, 0, exp, 0, exp, 0.0, 0.0, 0, |
529
|
175 "exp (X): compute exp (X) for each element of X"); |
|
176 |
2089
|
177 DEFUN_MAPPER (finite, 0, xfinite, xfinite, 0, 0.0, 0.0, 0, |
529
|
178 "finite (X): return 1 for finite elements of X"); |
|
179 |
2089
|
180 DEFUN_MAPPER (fix, 0, fix, 0, fix, 0.0, 0.0, 0, |
529
|
181 "fix (X): round elements of X toward zero"); |
|
182 |
2089
|
183 DEFUN_MAPPER (floor, 0, floor, 0, floor, 0.0, 0.0, 0, |
529
|
184 "floor (X): round elements of X toward -Inf"); |
|
185 |
2089
|
186 DEFUN_MAPPER (gamma, 0, xgamma, 0, 0, 0.0, 0.0, 0, |
624
|
187 "gamma (X): compute gamma (X) for each element of X"); |
|
188 |
2089
|
189 DEFUN_MAPPER (imag, 0, imag, imag, 0, 0.0, 0.0, 0, |
|
190 "imag (X): return imaginary part for each elements of X"); |
|
191 |
2190
|
192 DEFUN_MAPPER (isalnum, xisalnum, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
193 "isalnum (X): "); |
|
194 |
2190
|
195 DEFUN_MAPPER (isalpha, xisalpha, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
196 "isalpha (X): "); |
|
197 |
2190
|
198 DEFUN_MAPPER (isascii, xisascii, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
199 "isascii (X): "); |
|
200 |
2190
|
201 DEFUN_MAPPER (iscntrl, xiscntrl, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
202 "iscntrl (X): "); |
|
203 |
2190
|
204 DEFUN_MAPPER (isdigit, xisdigit, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
205 "isdigit (X): "); |
|
206 |
|
207 DEFUN_MAPPER (isinf, 0, xisinf, xisinf, 0, 0.0, 0.0, 0, |
529
|
208 "isinf (X): return 1 for elements of X infinite"); |
|
209 |
2190
|
210 DEFUN_MAPPER (isgraph, xisgraph, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
211 "isgraph (X): "); |
529
|
212 |
2190
|
213 DEFUN_MAPPER (islower, xislower, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
214 "islower (X): "); |
|
215 |
|
216 DEFUN_MAPPER (isnan, 0, xisnan, xisnan, 0, 0.0, 0.0, 0, |
529
|
217 "isnan (X): return 1 where elements of X are NaNs"); |
624
|
218 |
2190
|
219 DEFUN_MAPPER (isprint, xisprint, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
220 "isprint (X): "); |
|
221 |
2190
|
222 DEFUN_MAPPER (ispunct, xispunct, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
223 "ispunct (X): "); |
|
224 |
2190
|
225 DEFUN_MAPPER (isspace, xisspace, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
226 "isspace (X): "); |
|
227 |
2190
|
228 DEFUN_MAPPER (isupper, xisupper, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
229 "isupper (X): "); |
|
230 |
2190
|
231 DEFUN_MAPPER (isxdigit, xisxdigit, 0, 0, 0, 0.0, 0.0, 0, |
2089
|
232 "isxdigit (X): "); |
|
233 |
|
234 DEFUN_MAPPER (lgamma, 0, xlgamma, 0, 0, 0.0, 0.0, 0, |
624
|
235 "lgamma (X): compute log gamma (X) for each element of X"); |
529
|
236 |
2089
|
237 DEFUN_MAPPER (log, 0, log, 0, log, 0.0, DBL_MAX, 1, |
529
|
238 "log (X): compute log (X) for each element of X"); |
|
239 |
2089
|
240 DEFUN_MAPPER (log10, 0, log10, 0, log10, 0.0, DBL_MAX, 1, |
529
|
241 "log10 (X): compute log10 (X) for each element of X"); |
|
242 |
2089
|
243 DEFUN_MAPPER (real, 0, real, real, 0, 0.0, 0.0, 0, |
529
|
244 "real (X): return real part for each element of X"); |
|
245 |
2089
|
246 DEFUN_MAPPER (round, 0, round, 0, round, 0.0, 0.0, 0, |
529
|
247 "round (X): round elements of X to nearest integer"); |
|
248 |
2089
|
249 DEFUN_MAPPER (sign, 0, signum, 0, signum, 0.0, 0.0, 0, |
529
|
250 "sign (X): apply signum function to elements of X"); |
|
251 |
2089
|
252 DEFUN_MAPPER (sin, 0, sin, 0, sin, 0.0, 0.0, 0, |
529
|
253 "sin (X): compute sin (X) for each element of X"); |
|
254 |
2089
|
255 DEFUN_MAPPER (sinh, 0, sinh, 0, sinh, 0.0, 0.0, 0, |
529
|
256 "sinh (X): compute sinh (X) for each element of X"); |
|
257 |
2089
|
258 DEFUN_MAPPER (sqrt, 0, sqrt, 0, sqrt, 0.0, DBL_MAX, 1, |
529
|
259 "sqrt (X): compute sqrt (X) for each element of X"); |
|
260 |
2089
|
261 DEFUN_MAPPER (tan, 0, tan, 0, tan, 0.0, 0.0, 0, |
529
|
262 "tan (X): compute tan (X) for each element of X"); |
|
263 |
2089
|
264 DEFUN_MAPPER (tanh, 0, tanh, 0, tanh, 0.0, 0.0, 0, |
529
|
265 "tanh (X): compute tanh (X) for each element of X"); |
1562
|
266 |
2267
|
267 DEFUN_MAPPER (toascii, xtoascii, 0, 0, 0, 0.0, 0.0, 1, |
|
268 "toascii (STRING): return ASCII representation of STRING in a matrix"); |
|
269 |
|
270 DEFUN_MAPPER (tolower, xtolower, 0, 0, 0, 0.0, 0.0, 2, |
|
271 "tolower (STRING): convert upper case characters to lower case in STRING"); |
|
272 |
|
273 DEFUN_MAPPER (toupper, xtoupper, 0, 0, 0, 0.0, 0.0, 2, |
|
274 "toupper (STRING): convert lower case characters to upper case in STRING"); |
|
275 |
1562
|
276 DEFALIAS (gammaln, lgamma); |
529
|
277 } |
|
278 |
1
|
279 /* |
|
280 ;;; Local Variables: *** |
|
281 ;;; mode: C++ *** |
|
282 ;;; End: *** |
|
283 */ |