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> |
3010
|
28 #include <cfloat> |
1
|
29 |
3156
|
30 #include "lo-specfun.h" |
2889
|
31 #include "lo-mappers.h" |
|
32 |
1352
|
33 #include "defun.h" |
|
34 #include "error.h" |
2970
|
35 #include "ov-mapper.h" |
2955
|
36 #include "variables.h" |
1
|
37 |
2190
|
38 // XXX FIXME XXX -- perhaps this could be avoided by determining |
|
39 // whether the is* functions are actually functions or just macros. |
|
40 |
2889
|
41 static int |
2190
|
42 xisalnum (int c) |
|
43 { |
|
44 return isalnum (c); |
|
45 } |
|
46 |
2889
|
47 static int |
2190
|
48 xisalpha (int c) |
|
49 { |
|
50 return isalpha (c); |
|
51 } |
|
52 |
2889
|
53 static int |
2190
|
54 xisascii (int c) |
|
55 { |
|
56 return isascii (c); |
|
57 } |
|
58 |
2889
|
59 static int |
2190
|
60 xiscntrl (int c) |
|
61 { |
|
62 return iscntrl (c); |
|
63 } |
|
64 |
2889
|
65 static int |
2190
|
66 xisdigit (int c) |
|
67 { |
|
68 return isdigit (c); |
|
69 } |
|
70 |
2889
|
71 static int |
2190
|
72 xisgraph (int c) |
|
73 { |
|
74 return isgraph (c); |
|
75 } |
|
76 |
2889
|
77 static int |
2190
|
78 xislower (int c) |
|
79 { |
|
80 return islower (c); |
|
81 } |
|
82 |
2889
|
83 static int |
2190
|
84 xisprint (int c) |
|
85 { |
|
86 return isprint (c); |
|
87 } |
|
88 |
2889
|
89 static int |
2190
|
90 xispunct (int c) |
|
91 { |
|
92 return ispunct (c); |
|
93 } |
|
94 |
2889
|
95 static int |
2190
|
96 xisspace (int c) |
|
97 { |
|
98 return isspace (c); |
|
99 } |
|
100 |
2889
|
101 static int |
2190
|
102 xisupper (int c) |
|
103 { |
|
104 return isupper (c); |
|
105 } |
|
106 |
2889
|
107 static int |
2190
|
108 xisxdigit (int c) |
|
109 { |
|
110 return isxdigit (c); |
|
111 } |
|
112 |
2889
|
113 static int |
2267
|
114 xtoascii (int c) |
|
115 { |
|
116 return toascii (c); |
|
117 } |
|
118 |
2889
|
119 static int |
2267
|
120 xtolower (int c) |
|
121 { |
|
122 return tolower (c); |
|
123 } |
|
124 |
2889
|
125 static int |
2267
|
126 xtoupper (int c) |
|
127 { |
|
128 return toupper (c); |
|
129 } |
|
130 |
3564
|
131 static Complex |
|
132 xconj (const Complex& x) |
|
133 { |
|
134 return conj (x); |
|
135 } |
|
136 |
|
137 static double |
|
138 xconj (double x) |
|
139 { |
|
140 return x; |
|
141 } |
|
142 |
3586
|
143 static double |
3564
|
144 ximag (const Complex& x) |
|
145 { |
3586
|
146 return x.imag (); |
3564
|
147 } |
|
148 |
3586
|
149 static double |
3564
|
150 xreal (const Complex& x) |
|
151 { |
3586
|
152 return x.real (); |
3564
|
153 } |
|
154 |
529
|
155 void |
|
156 install_mapper_functions (void) |
|
157 { |
3775
|
158 DEFUN_MAPPER (abs, 0, 0, 0, std::fabs, abs, 0, 0.0, 0.0, 0, |
3321
|
159 "-*- texinfo -*-\n\ |
|
160 @deftypefn {Mapping Function} {} abs (@var{z})\n\ |
|
161 Compute the magnitude of @var{z}, defined as\n\ |
|
162 @iftex\n\ |
|
163 @tex\n\ |
|
164 $|z| = \\sqrt{x^2 + y^2}$.\n\ |
|
165 @end tex\n\ |
|
166 @end iftex\n\ |
|
167 @ifinfo\n\ |
|
168 |@var{z}| = @code{sqrt (x^2 + y^2)}.\n\ |
|
169 @end ifinfo\n\ |
|
170 \n\ |
|
171 For example,\n\ |
|
172 \n\ |
|
173 @example\n\ |
|
174 @group\n\ |
|
175 abs (3 + 4i)\n\ |
|
176 @result{} 5\n\ |
|
177 @end group\n\ |
|
178 @end example\n\ |
|
179 @end deftypefn"); |
529
|
180 |
3775
|
181 DEFUN_MAPPER (acos, 0, 0, 0, std::acos, 0, acos, -1.0, 1.0, 1, |
3321
|
182 "-*- texinfo -*-\n\ |
3428
|
183 @deftypefn {Mapping Function} {} acos (@var{x})\n\ |
|
184 Compute the inverse cosine of each element of @var{x}.\n\ |
3321
|
185 @end deftypefn"); |
529
|
186 |
3249
|
187 DEFUN_MAPPER (acosh, 0, 0, 0, acosh, 0, acosh, 1.0, DBL_MAX, 1, |
3321
|
188 "-*- texinfo -*-\n\ |
3428
|
189 @deftypefn {Mapping Function} {} acosh (@var{x})\n\ |
|
190 Compute the inverse hyperbolic cosine of each element of @var{x}.\n\ |
3321
|
191 @end deftypefn"); |
529
|
192 |
3249
|
193 DEFUN_MAPPER (angle, 0, 0, 0, arg, arg, 0, 0.0, 0.0, 0, |
3458
|
194 "-*- texinfo -*-\n\ |
|
195 @deftypefn {Mapping Function} {} angle (@var{z})\n\ |
|
196 See arg.\n\ |
|
197 @end deftypefn"); |
529
|
198 |
3249
|
199 DEFUN_MAPPER (arg, 0, 0, 0, arg, arg, 0, 0.0, 0.0, 0, |
3321
|
200 "-*- texinfo -*-\n\ |
3446
|
201 @deftypefn {Mapping Function} {} arg (@var{z})\n\ |
3458
|
202 @deftypefnx {Mapping Function} {} angle (@var{z})\n\ |
3321
|
203 Compute the argument of @var{z}, defined as\n\ |
|
204 @iftex\n\ |
|
205 @tex\n\ |
|
206 $\\theta = \\tan^{-1}(y/x)$.\n\ |
|
207 @end tex\n\ |
|
208 @end iftex\n\ |
|
209 @ifinfo\n\ |
|
210 @var{theta} = @code{atan (@var{y}/@var{x})}.\n\ |
|
211 @end ifinfo\n\ |
|
212 \n\ |
|
213 @noindent\n\ |
|
214 in radians. \n\ |
|
215 \n\ |
|
216 For example,\n\ |
|
217 \n\ |
|
218 @example\n\ |
|
219 @group\n\ |
|
220 arg (3 + 4i)\n\ |
|
221 @result{} 0.92730\n\ |
|
222 @end group\n\ |
|
223 @end example\n\ |
|
224 @end deftypefn"); |
529
|
225 |
3775
|
226 DEFUN_MAPPER (asin, 0, 0, 0, std::asin, 0, asin, -1.0, 1.0, 1, |
3321
|
227 "-*- texinfo -*-\n\ |
3428
|
228 @deftypefn {Mapping Function} {} asin (@var{x})\n\ |
|
229 Compute the inverse sine of each element of @var{x}.\n\ |
3321
|
230 @end deftypefn"); |
529
|
231 |
3249
|
232 DEFUN_MAPPER (asinh, 0, 0, 0, asinh, 0, asinh, 0.0, 0.0, 0, |
3321
|
233 "-*- texinfo -*-\n\ |
3428
|
234 @deftypefn {Mapping Function} {} asinh (@var{x})\n\ |
|
235 Ompute the inverse hyperbolic sine of each element of @var{x}.\n\ |
3321
|
236 @end deftypefn"); |
529
|
237 |
3775
|
238 DEFUN_MAPPER (atan, 0, 0, 0, std::atan, 0, atan, 0.0, 0.0, 0, |
3321
|
239 "-*- texinfo -*-\n\ |
3428
|
240 @deftypefn {Mapping Function} {} atan (@var{x})\n\ |
|
241 Compute the inverse tangent of each element of @var{x}.\n\ |
3321
|
242 @end deftypefn"); |
529
|
243 |
3249
|
244 DEFUN_MAPPER (atanh, 0, 0, 0, atanh, 0, atanh, -1.0, 1.0, 1, |
3321
|
245 "-*- texinfo -*-\n\ |
3428
|
246 @deftypefn {Mapping Function} {} atanh (@var{x})\n\ |
|
247 Compute the inverse hyperbolic tanget of each element of @var{x}.\n\ |
3321
|
248 @end deftypefn"); |
529
|
249 |
3775
|
250 DEFUN_MAPPER (ceil, 0, 0, 0, std::ceil, 0, ceil, 0.0, 0.0, 0, |
3321
|
251 "-*- texinfo -*-\n\ |
3373
|
252 @deftypefn {Mapping Function} {} ceil (@var{x})\n\ |
3321
|
253 Return the smallest integer not less than @var{x}. If @var{x} is\n\ |
|
254 complex, return @code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}.\n\ |
|
255 @end deftypefn"); |
529
|
256 |
3564
|
257 DEFUN_MAPPER (conj, 0, 0, 0, xconj, 0, xconj, 0.0, 0.0, 0, |
3381
|
258 "-*- texinfo -*-\n\ |
3321
|
259 @deftypefn {Mapping Function} {} conj (@var{z})\n\ |
|
260 Return the complex conjugate of @var{z}, defined as\n\ |
|
261 @iftex\n\ |
|
262 @tex\n\ |
|
263 $\\bar{z} = x - iy$.\n\ |
|
264 @end tex\n\ |
|
265 @end iftex\n\ |
|
266 @ifinfo\n\ |
|
267 @code{conj (@var{z})} = @var{x} - @var{i}@var{y}.\n\ |
|
268 @end ifinfo\n\ |
|
269 @end deftypefn\n\ |
3411
|
270 @seealso{real and imag}"); |
529
|
271 |
3775
|
272 DEFUN_MAPPER (cos, 0, 0, 0, std::cos, 0, cos, 0.0, 0.0, 0, |
3321
|
273 "-*- texinfo -*-\n\ |
3428
|
274 @deftypefn {Mapping Function} {} cos (@var{x})\n\ |
|
275 Compute the cosine of each element of @var{x}.\n\ |
3321
|
276 @end deftypefn"); |
529
|
277 |
3775
|
278 DEFUN_MAPPER (cosh, 0, 0, 0, std::cosh, 0, cosh, 0.0, 0.0, 0, |
3321
|
279 "-*- texinfo -*-\n\ |
3428
|
280 @deftypefn {Mapping Function} {} cosh (@var{x})\n\ |
|
281 Compute the hyperbolic cosine of each element of @var{x}.\n\ |
3321
|
282 @end deftypefn"); |
529
|
283 |
3249
|
284 DEFUN_MAPPER (erf, 0, 0, 0, xerf, 0, 0, 0.0, 0.0, 0, |
3321
|
285 "-*- texinfo -*-\n\ |
|
286 @deftypefn {Mapping Function} {} erf (@var{z})\n\ |
|
287 Computes the error function,\n\ |
|
288 @iftex\n\ |
|
289 @tex\n\ |
|
290 $$\n\ |
|
291 {\\rm erf} (z) = {2 \\over \\sqrt{\\pi}}\\int_0^z e^{-t^2} dt\n\ |
|
292 $$\n\ |
|
293 @end tex\n\ |
|
294 @end iftex\n\ |
|
295 @ifinfo\n\ |
|
296 \n\ |
|
297 @smallexample\n\ |
|
298 z\n\ |
|
299 /\n\ |
|
300 erf (z) = (2/sqrt (pi)) | e^(-t^2) dt\n\ |
|
301 /\n\ |
|
302 t=0\n\ |
|
303 @end smallexample\n\ |
|
304 @end ifinfo\n\ |
|
305 @end deftypefn\n\ |
3411
|
306 @seealso{erfc and erfinv}"); |
624
|
307 |
3249
|
308 DEFUN_MAPPER (erfc, 0, 0, 0, xerfc, 0, 0, 0.0, 0.0, 0, |
3321
|
309 "-*- texinfo -*-\n\ |
|
310 @deftypefn {Mapping Function} {} erfc (@var{z})\n\ |
|
311 Computes the complementary error function,\n\ |
|
312 @iftex\n\ |
|
313 @tex\n\ |
|
314 $1 - {\\rm erf} (z)$.\n\ |
|
315 @end tex\n\ |
|
316 @end iftex\n\ |
|
317 @ifinfo\n\ |
|
318 @code{1 - erf (@var{z})}.\n\ |
|
319 @end ifinfo\n\ |
|
320 @end deftypefn\n\ |
|
321 \n\ |
3411
|
322 @seealso{erf and erfinv}"); |
624
|
323 |
3775
|
324 DEFUN_MAPPER (exp, 0, 0, 0, std::exp, 0, exp, 0.0, 0.0, 0, |
3321
|
325 "-*- texinfo -*-\n\ |
3373
|
326 @deftypefn {Mapping Function} {} exp (@var{x})\n\ |
3321
|
327 Compute the exponential of @var{x}. To compute the matrix exponential,\n\ |
|
328 see @ref{Linear Algebra}.\n\ |
|
329 @end deftypefn"); |
529
|
330 |
3249
|
331 DEFUN_MAPPER (finite, 0, xfinite, xfinite, 0, 0, 0, 0.0, 0.0, 0, |
3369
|
332 "-*- texinfo -*-\n\ |
|
333 @deftypefn {Mapping Function} {} finite (@var{x})\n\ |
3600
|
334 Return 1 for elements of @var{x} that are finite values and zero\n\ |
3369
|
335 otherwise. For example,\n\ |
|
336 \n\ |
|
337 @example\n\ |
|
338 @group\n\ |
|
339 finite ([13, Inf, NaN])\n\ |
|
340 @result{} [ 1, 0, 0 ]\n\ |
|
341 @end group\n\ |
|
342 @end example\n\ |
|
343 @end deftypefn"); |
529
|
344 |
3249
|
345 DEFUN_MAPPER (fix, 0, 0, 0, fix, 0, fix, 0.0, 0.0, 0, |
3321
|
346 "-*- texinfo -*-\n\ |
3373
|
347 @deftypefn {Mapping Function} {} fix (@var{x})\n\ |
3321
|
348 Truncate @var{x} toward zero. If @var{x} is complex, return\n\ |
|
349 @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}.\n\ |
|
350 @end deftypefn"); |
529
|
351 |
3775
|
352 DEFUN_MAPPER (floor, 0, 0, 0, std::floor, 0, floor, 0.0, 0.0, 0, |
3321
|
353 "-*- texinfo -*-\n\ |
3373
|
354 @deftypefn {Mapping Function} {} floor (@var{x})\n\ |
3321
|
355 Return the largest integer not greater than @var{x}. If @var{x} is\n\ |
|
356 complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}.\n\ |
|
357 @end deftypefn"); |
529
|
358 |
3249
|
359 DEFUN_MAPPER (gamma, 0, 0, 0, xgamma, 0, 0, 0.0, 0.0, 0, |
3321
|
360 "-*- texinfo -*-\n\ |
|
361 @deftypefn {Mapping Function} {} gamma (@var{z})\n\ |
|
362 Computes the Gamma function,\n\ |
|
363 @iftex\n\ |
|
364 @tex\n\ |
|
365 $$\n\ |
|
366 \\Gamma (z) = \\int_0^\\infty t^{z-1} e^{-t} dt.\n\ |
|
367 $$\n\ |
|
368 @end tex\n\ |
|
369 @end iftex\n\ |
|
370 @ifinfo\n\ |
|
371 \n\ |
|
372 @example\n\ |
|
373 infinity\n\ |
|
374 /\n\ |
|
375 gamma (z) = | t^(z-1) exp (-t) dt.\n\ |
|
376 /\n\ |
|
377 t=0\n\ |
|
378 @end example\n\ |
|
379 @end ifinfo\n\ |
|
380 @end deftypefn\n\ |
|
381 \n\ |
3411
|
382 @seealso{gammai and lgamma}"); |
624
|
383 |
3564
|
384 DEFUN_MAPPER (imag, 0, 0, 0, imag, ximag, 0, 0.0, 0.0, 0, |
3321
|
385 "-*- texinfo -*-\n\ |
|
386 @deftypefn {Mapping Function} {} imag (@var{z})\n\ |
|
387 Return the imaginary part of @var{z} as a real number.\n\ |
|
388 @end deftypefn\n\ |
|
389 \n\ |
3411
|
390 @seealso{real and conj}"); |
2089
|
391 |
3249
|
392 DEFUN_MAPPER (isalnum, xisalnum, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
393 "-*- texinfo -*-\n\ |
|
394 @deftypefn {Mapping Function} {} isalnum (@var{s})\n\ |
|
395 Return 1 for characters that are letters or digits (@code{isalpha\n\ |
|
396 (@var{a})} or @code{isdigit (@var{a})} is true).\n\ |
|
397 @end deftypefn"); |
2089
|
398 |
3249
|
399 DEFUN_MAPPER (isalpha, xisalpha, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
400 "-*- texinfo -*-\n\ |
|
401 @deftypefn {Mapping Function} {} isalpha (@var{s})\n\ |
|
402 Return true for characters that are letters (@code{isupper (@var{a})}\n\ |
|
403 or @code{islower (@var{})} is true).\n\ |
|
404 @end deftypefn"); |
2089
|
405 |
3249
|
406 DEFUN_MAPPER (isascii, xisascii, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
407 "-*- texinfo -*-\n\ |
|
408 @deftypefn {Mapping Function} {} isascii (@var{s})\n\ |
|
409 Return 1 for characters that are ASCII (in the range 0 to 127 decimal).\n\ |
|
410 @end deftypefn"); |
2089
|
411 |
3249
|
412 DEFUN_MAPPER (iscntrl, xiscntrl, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
413 "-*- texinfo -*-\n\ |
|
414 @deftypefn {Mapping Function} {} iscntrl (@var{s})\n\ |
|
415 Return 1 for control characters.\n\ |
|
416 @end deftypefn"); |
2089
|
417 |
3249
|
418 DEFUN_MAPPER (isdigit, xisdigit, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
419 "-*- texinfo -*-\n\ |
|
420 @deftypefn {Mapping Function} {} isdigit (@var{s})\n\ |
|
421 Return 1 for characters that are decimal digits.\n\ |
|
422 @end deftypefn"); |
2089
|
423 |
3249
|
424 DEFUN_MAPPER (isinf, 0, xisinf, xisinf, 0, 0, 0, 0.0, 0.0, 0, |
3369
|
425 "-*- texinfo -*-\n\ |
|
426 @deftypefn {Mapping Function} {} isinf (@var{x})\n\ |
|
427 Return 1 for elements of @var{x} that are infinite and zero\n\ |
|
428 otherwise. For example,\n\ |
|
429 \n\ |
|
430 @example\n\ |
|
431 @group\n\ |
4025
|
432 isinf ([13, Inf, NA, NaN])\n\ |
|
433 @result{} [ 0, 1, 0, 0 ]\n\ |
3369
|
434 @end group\n\ |
|
435 @end example\n\ |
|
436 @end deftypefn"); |
529
|
437 |
3249
|
438 DEFUN_MAPPER (isgraph, xisgraph, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
439 "-*- texinfo -*-\n\ |
|
440 @deftypefn {Mapping Function} {} isgraph (@var{s})\n\ |
|
441 Return 1 for printable characters (but not the space character).\n\ |
|
442 @end deftypefn"); |
529
|
443 |
3249
|
444 DEFUN_MAPPER (islower, xislower, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
445 "-*- texinfo -*-\n\ |
|
446 @deftypefn {Mapping Function} {} islower (@var{s})\n\ |
|
447 Return 1 for characters that are lower case letters.\n\ |
|
448 @end deftypefn"); |
2089
|
449 |
4025
|
450 DEFUN_MAPPER (isna, 0, octave_is_NA, octave_is_NA, 0, 0, 0, 0.0, 0.0, 0, |
|
451 "-*- texinfo -*-\n\ |
|
452 @deftypefn {Mapping Function} {} isna (@var{x})\n\ |
|
453 Return 1 for elements of @var{x} that are NA (missing) values and zero\n\ |
|
454 otherwise. For example,\n\ |
|
455 \n\ |
|
456 @example\n\ |
|
457 @group\n\ |
|
458 is_NA ([13, Inf, NA, NaN])\n\ |
|
459 @result{} [ 0, 0, 1, 0 ]\n\ |
|
460 @end group\n\ |
|
461 @end example\n\ |
|
462 @end deftypefn"); |
|
463 |
|
464 DEFUN_MAPPER (is_nan_or_na, 0, octave_is_NaN_or_NA, |
|
465 octave_is_NaN_or_NA, 0, 0, 0, 0.0, 0.0, 0, |
|
466 "-*- texinfo -*-\n\ |
|
467 @deftypefn {Mapping Function} {} is_nan_or_na (@var{x})\n\ |
|
468 Return 1 for elements of @var{x} that are NaN or NA (missing) values\n\ |
|
469 and zero otherwise. For example,\n\ |
|
470 \n\ |
|
471 @example\n\ |
|
472 @group\n\ |
|
473 is_NAN_or_NA ([13, Inf, NA, NaN])\n\ |
|
474 @result{} [ 0, 0, 1, 1 ]\n\ |
|
475 @end group\n\ |
|
476 @end example\n\ |
|
477 @end deftypefn"); |
|
478 |
3249
|
479 DEFUN_MAPPER (isnan, 0, xisnan, xisnan, 0, 0, 0, 0.0, 0.0, 0, |
3369
|
480 "-*- texinfo -*-\n\ |
|
481 @deftypefn {Mapping Function} {} isnan (@var{x})\n\ |
|
482 Return 1 for elements of @var{x} that are NaN values and zero\n\ |
|
483 otherwise. For example,\n\ |
|
484 \n\ |
|
485 @example\n\ |
|
486 @group\n\ |
4025
|
487 isnan ([13, Inf, NA, NaN])\n\ |
|
488 @result{} [ 0, 0, 0, 1 ]\n\ |
3369
|
489 @end group\n\ |
|
490 @end example\n\ |
|
491 @end deftypefn"); |
624
|
492 |
3249
|
493 DEFUN_MAPPER (isprint, xisprint, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
494 "-*- texinfo -*-\n\ |
|
495 @deftypefn {Mapping Function} {} isprint (@var{s})\n\ |
|
496 Return 1 for printable characters (including the space character).\n\ |
|
497 @end deftypefn"); |
2089
|
498 |
3249
|
499 DEFUN_MAPPER (ispunct, xispunct, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
500 "-*- texinfo -*-\n\ |
|
501 @deftypefn {Mapping Function} {} ispunct (@var{s})\n\ |
|
502 Return 1 for punctuation characters.\n\ |
|
503 @end deftypefn"); |
2089
|
504 |
3249
|
505 DEFUN_MAPPER (isspace, xisspace, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
506 "-*- texinfo -*-\n\ |
|
507 @deftypefn {Mapping Function} {} isspace (@var{s})\n\ |
|
508 Return 1 for whitespace characters (space, formfeed, newline,\n\ |
|
509 carriage return, tab, and vertical tab).\n\ |
|
510 @end deftypefn"); |
2089
|
511 |
3249
|
512 DEFUN_MAPPER (isupper, xisupper, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
513 "-*- texinfo -*-\n\ |
|
514 @deftypefn {Mapping Function} {} isupper (@var{s})\n\ |
|
515 Return 1 for upper case letters.\n\ |
|
516 @end deftypefn"); |
2089
|
517 |
3249
|
518 DEFUN_MAPPER (isxdigit, xisxdigit, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
519 "-*- texinfo -*-\n\ |
|
520 @deftypefn {Mapping Function} {} isxdigit (@var{s})\n\ |
|
521 Return 1 for characters that are hexadecimal digits.\n\ |
|
522 @end deftypefn"); |
2089
|
523 |
3249
|
524 DEFUN_MAPPER (lgamma, 0, 0, 0, xlgamma, 0, 0, 0.0, 0.0, 0, |
3321
|
525 "-*- texinfo -*-\n\ |
|
526 @deftypefn {Mapping Function} {} lgamma (@var{a}, @var{x})\n\ |
|
527 @deftypefnx {Mapping Function} {} gammaln (@var{a}, @var{x})\n\ |
|
528 Return the natural logarithm of the gamma function.\n\ |
|
529 @end deftypefn\n\ |
3411
|
530 @seealso{gamma and gammai}"); |
529
|
531 |
3775
|
532 DEFUN_MAPPER (log, 0, 0, 0, std::log, 0, log, 0.0, DBL_MAX, 1, |
3321
|
533 "-*- texinfo -*-\n\ |
|
534 @deftypefn {Mapping Function} {} log (@var{x})\n\ |
|
535 Compute the natural logarithm for each element of @var{x}. To compute the\n\ |
|
536 matrix logarithm, see @ref{Linear Algebra}.\n\ |
|
537 @end deftypefn\n\ |
3411
|
538 @seealso{log2, log10, logspace, and exp}"); |
529
|
539 |
3775
|
540 DEFUN_MAPPER (log10, 0, 0, 0, std::log10, 0, log10, 0.0, DBL_MAX, 1, |
3321
|
541 "-*- texinfo -*-\n\ |
|
542 @deftypefn {Mapping Function} {} log10 (@var{x})\n\ |
|
543 Compute the base-10 logarithm for each element of @var{x}.\n\ |
|
544 @end deftypefn\n\ |
3411
|
545 @seealso{log, log2, logspace, and exp}"); |
529
|
546 |
3564
|
547 DEFUN_MAPPER (real, 0, 0, 0, real, xreal, 0, 0.0, 0.0, 0, |
3381
|
548 "-*- texinfo -*-\n\ |
3321
|
549 @deftypefn {Mapping Function} {} real (@var{z})\n\ |
|
550 Return the real part of @var{z}.\n\ |
|
551 @end deftypefn\n\ |
3411
|
552 @seealso{imag and conj}"); |
529
|
553 |
3249
|
554 DEFUN_MAPPER (round, 0, 0, 0, round, 0, round, 0.0, 0.0, 0, |
3321
|
555 "-*- texinfo -*-\n\ |
|
556 @deftypefn {Mapping Function} {} round (@var{x})\n\ |
|
557 Return the integer nearest to @var{x}. If @var{x} is complex, return\n\ |
|
558 @code{round (real (@var{x})) + round (imag (@var{x})) * I}.\n\ |
|
559 @end deftypefn\n\ |
3411
|
560 @seealso{rem}"); |
529
|
561 |
3249
|
562 DEFUN_MAPPER (sign, 0, 0, 0, signum, 0, signum, 0.0, 0.0, 0, |
3321
|
563 "-*- texinfo -*-\n\ |
|
564 @deftypefn {Mapping Function} {} sign (@var{x})\n\ |
|
565 Compute the @dfn{signum} function, which is defined as\n\ |
|
566 @iftex\n\ |
|
567 @tex\n\ |
|
568 $$\n\ |
|
569 {\\rm sign} (@var{x}) = \\cases{1,&$x>0$;\\cr 0,&$x=0$;\\cr -1,&$x<0$.\\cr}\n\ |
|
570 $$\n\ |
|
571 @end tex\n\ |
|
572 @end iftex\n\ |
|
573 @ifinfo\n\ |
|
574 \n\ |
|
575 @example\n\ |
|
576 -1, x < 0;\n\ |
|
577 sign (x) = 0, x = 0;\n\ |
|
578 1, x > 0.\n\ |
|
579 @end example\n\ |
|
580 @end ifinfo\n\ |
|
581 \n\ |
|
582 For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}.\n\ |
|
583 @end deftypefn"); |
529
|
584 |
3775
|
585 DEFUN_MAPPER (sin, 0, 0, 0, std::sin, 0, sin, 0.0, 0.0, 0, |
3321
|
586 "-*- texinfo -*-\n\ |
3428
|
587 @deftypefn {Mapping Function} {} sin (@var{x})\n\ |
|
588 Compute the sin of each element of @var{x}.\n\ |
3321
|
589 @end deftypefn"); |
529
|
590 |
3775
|
591 DEFUN_MAPPER (sinh, 0, 0, 0, std::sinh, 0, sinh, 0.0, 0.0, 0, |
3321
|
592 "-*- texinfo -*-\n\ |
3428
|
593 @deftypefn {Mapping Function} {} sinh (@var{x})\n\ |
|
594 Compute the inverse hyperbolic sin of each element of @var{x}.\n\ |
3321
|
595 @end deftypefn"); |
529
|
596 |
3775
|
597 DEFUN_MAPPER (sqrt, 0, 0, 0, std::sqrt, 0, sqrt, 0.0, DBL_MAX, 1, |
3321
|
598 "-*- texinfo -*-\n\ |
|
599 @deftypefn {Mapping Function} {} sqrt (@var{x})\n\ |
|
600 Compute the square root of @var{x}. If @var{x} is negative, a complex\n\ |
|
601 result is returned. To compute the matrix square root, see\n\ |
|
602 @ref{Linear Algebra}.\n\ |
|
603 @end deftypefn"); |
529
|
604 |
3775
|
605 DEFUN_MAPPER (tan, 0, 0, 0, std::tan, 0, tan, 0.0, 0.0, 0, |
3321
|
606 "-*- texinfo -*-\n\ |
|
607 @deftypefn {Mapping Function} {} tan (@var{z})\n\ |
3428
|
608 Compute tanget of each element of @var{x}.\n\ |
3321
|
609 @end deftypefn"); |
529
|
610 |
3775
|
611 DEFUN_MAPPER (tanh, 0, 0, 0, std::tanh, 0, tanh, 0.0, 0.0, 0, |
3321
|
612 "-*- texinfo -*-\n\ |
3428
|
613 @deftypefn {Mapping Function} {} tanh (@var{x})\n\ |
|
614 Compute hyperbolic tangent of each element of @var{x}.\n\ |
3321
|
615 @end deftypefn"); |
1562
|
616 |
3249
|
617 DEFUN_MAPPER (toascii, xtoascii, 0, 0, 0, 0, 0, 0.0, 0.0, 1, |
3361
|
618 "-*- texinfo -*-\n\ |
|
619 @deftypefn {Mapping Function} {} toascii (@var{s})\n\ |
|
620 Return ASCII representation of @var{s} in a matrix. For example,\n\ |
|
621 \n\ |
|
622 @example\n\ |
|
623 @group\n\ |
|
624 toascii (\"ASCII\")\n\ |
|
625 @result{} [ 65, 83, 67, 73, 73 ]\n\ |
|
626 @end group\n\ |
|
627 \n\ |
|
628 @end example\n\ |
3362
|
629 @end deftypefn"); |
2267
|
630 |
3249
|
631 DEFUN_MAPPER (tolower, xtolower, 0, 0, 0, 0, 0, 0.0, 0.0, 2, |
3361
|
632 "-*- texinfo -*-\n\ |
|
633 @deftypefn {Mapping Function} {} tolower (@var{s})\n\ |
|
634 Return a copy of the string @var{s}, with each upper-case character\n\ |
|
635 replaced by the corresponding lower-case one; nonalphabetic characters\n\ |
|
636 are left unchanged. For example,\n\ |
|
637 \n\ |
|
638 @example\n\ |
|
639 tolower (\"MiXeD cAsE 123\")\n\ |
|
640 @result{} \"mixed case 123\"\n\ |
|
641 @end example\n\ |
3362
|
642 @end deftypefn"); |
2267
|
643 |
3249
|
644 DEFUN_MAPPER (toupper, xtoupper, 0, 0, 0, 0, 0, 0.0, 0.0, 2, |
3361
|
645 "-*- texinfo -*-\n\ |
3368
|
646 @deftypefn {Built-in Function} {} toupper (@var{s})\n\ |
3361
|
647 Return a copy of the string @var{s}, with each lower-case character\n\ |
|
648 replaced by the corresponding upper-case one; nonalphabetic characters\n\ |
|
649 are left unchanged. For example,\n\ |
|
650 \n\ |
|
651 @example\n\ |
|
652 @group\n\ |
3552
|
653 toupper (\"MiXeD cAsE 123\")\n\ |
3361
|
654 @result{} \"MIXED CASE 123\"\n\ |
|
655 @end group\n\ |
|
656 @end example\n\ |
3362
|
657 @end deftypefn"); |
2267
|
658 |
1562
|
659 DEFALIAS (gammaln, lgamma); |
3206
|
660 |
|
661 DEFALIAS (isfinite, finite); |
3321
|
662 |
|
663 // Leave the previous new line, mkgendoc needs it! |
529
|
664 } |
|
665 |
1
|
666 /* |
|
667 ;;; Local Variables: *** |
|
668 ;;; mode: C++ *** |
|
669 ;;; End: *** |
|
670 */ |