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 |
529
|
131 void |
|
132 install_mapper_functions (void) |
|
133 { |
3249
|
134 DEFUN_MAPPER (abs, 0, 0, 0, fabs, abs, 0, 0.0, 0.0, 0, |
3321
|
135 "-*- texinfo -*-\n\ |
|
136 @deftypefn {Mapping Function} {} abs (@var{z})\n\ |
|
137 Compute the magnitude of @var{z}, defined as\n\ |
|
138 @iftex\n\ |
|
139 @tex\n\ |
|
140 $|z| = \\sqrt{x^2 + y^2}$.\n\ |
|
141 @end tex\n\ |
|
142 @end iftex\n\ |
|
143 @ifinfo\n\ |
|
144 |@var{z}| = @code{sqrt (x^2 + y^2)}.\n\ |
|
145 @end ifinfo\n\ |
|
146 \n\ |
|
147 For example,\n\ |
|
148 \n\ |
|
149 @example\n\ |
|
150 @group\n\ |
|
151 abs (3 + 4i)\n\ |
|
152 @result{} 5\n\ |
|
153 @end group\n\ |
|
154 @end example\n\ |
|
155 @end deftypefn"); |
529
|
156 |
3249
|
157 DEFUN_MAPPER (acos, 0, 0, 0, acos, 0, acos, -1.0, 1.0, 1, |
3321
|
158 "-*- texinfo -*-\n\ |
|
159 @deftypefn {Mapping Function} {} acos (@var{X})\n\ |
|
160 acos (X): compute the inverse cosine of X for each element of X\n\ |
|
161 @end deftypefn"); |
529
|
162 |
3249
|
163 DEFUN_MAPPER (acosh, 0, 0, 0, acosh, 0, acosh, 1.0, DBL_MAX, 1, |
3321
|
164 "-*- texinfo -*-\n\ |
|
165 @deftypefn {Mapping Function} {} acosh (@var{X})\n\ |
|
166 acosh (X): compute the inverse hyperbolic cosine of X for each element of X.\n\ |
|
167 @end deftypefn"); |
529
|
168 |
3249
|
169 DEFUN_MAPPER (angle, 0, 0, 0, arg, arg, 0, 0.0, 0.0, 0, |
3322
|
170 "See arg."); |
529
|
171 |
3249
|
172 DEFUN_MAPPER (arg, 0, 0, 0, arg, arg, 0, 0.0, 0.0, 0, |
3321
|
173 "-*- texinfo -*-\n\ |
|
174 @deftypefn {Mapping Function} {} angle (@var{z})\n\ |
|
175 Compute the argument of @var{z}, defined as\n\ |
|
176 @iftex\n\ |
|
177 @tex\n\ |
|
178 $\\theta = \\tan^{-1}(y/x)$.\n\ |
|
179 @end tex\n\ |
|
180 @end iftex\n\ |
|
181 @ifinfo\n\ |
|
182 @var{theta} = @code{atan (@var{y}/@var{x})}.\n\ |
|
183 @end ifinfo\n\ |
|
184 \n\ |
|
185 @noindent\n\ |
|
186 in radians. \n\ |
|
187 \n\ |
|
188 For example,\n\ |
|
189 \n\ |
|
190 @example\n\ |
|
191 @group\n\ |
|
192 arg (3 + 4i)\n\ |
|
193 @result{} 0.92730\n\ |
|
194 @end group\n\ |
|
195 @end example\n\ |
|
196 @end deftypefn"); |
529
|
197 |
3249
|
198 DEFUN_MAPPER (asin, 0, 0, 0, asin, 0, asin, -1.0, 1.0, 1, |
3321
|
199 "-*- texinfo -*-\n\ |
|
200 @deftypefn {Mapping Function} {} asin (@var{X})\n\ |
|
201 asin (X): compute inverse sin (X) for each element of X\n\ |
|
202 @end deftypefn"); |
529
|
203 |
3249
|
204 DEFUN_MAPPER (asinh, 0, 0, 0, asinh, 0, asinh, 0.0, 0.0, 0, |
3321
|
205 "-*- texinfo -*-\n\ |
|
206 @deftypefn {Mapping Function} {} asinh (@var{X})\n\ |
|
207 asinh (X): compute the inverse hyperbolic sin (X) for each element of X\n\ |
|
208 @end deftypefn"); |
529
|
209 |
3249
|
210 DEFUN_MAPPER (atan, 0, 0, 0, atan, 0, atan, 0.0, 0.0, 0, |
3321
|
211 "-*- texinfo -*-\n\ |
|
212 @deftypefn {Mapping Function} {} atan (@var{X})\n\ |
|
213 atan (X): compute the inverse tangent of (X) for each element of X\n\ |
|
214 @end deftypefn"); |
529
|
215 |
3249
|
216 DEFUN_MAPPER (atanh, 0, 0, 0, atanh, 0, atanh, -1.0, 1.0, 1, |
3321
|
217 "-*- texinfo -*-\n\ |
|
218 @deftypefn {Mapping Function} {} atanh (@var{X})\n\ |
|
219 atanh (X): compute the inverse hyperbolic tanget of X for each element of X\n\ |
|
220 @end deftypefn"); |
529
|
221 |
3249
|
222 DEFUN_MAPPER (ceil, 0, 0, 0, ceil, 0, ceil, 0.0, 0.0, 0, |
3321
|
223 "-*- texinfo -*-\n\ |
|
224 @deftypefn {Usage} {} ceil (@var{x})\n\ |
|
225 Return the smallest integer not less than @var{x}. If @var{x} is\n\ |
|
226 complex, return @code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}.\n\ |
|
227 @end deftypefn"); |
529
|
228 |
3249
|
229 DEFUN_MAPPER (conj, 0, 0, 0, conj, 0, conj, 0.0, 0.0, 0, |
3321
|
230 "-* texinfo -*-\n\ |
|
231 @deftypefn {Mapping Function} {} conj (@var{z})\n\ |
|
232 Return the complex conjugate of @var{z}, defined as\n\ |
|
233 @iftex\n\ |
|
234 @tex\n\ |
|
235 $\\bar{z} = x - iy$.\n\ |
|
236 @end tex\n\ |
|
237 @end iftex\n\ |
|
238 @ifinfo\n\ |
|
239 @code{conj (@var{z})} = @var{x} - @var{i}@var{y}.\n\ |
|
240 @end ifinfo\n\ |
|
241 @end deftypefn\n\ |
|
242 \n\ |
|
243 See also: real, imag"); |
529
|
244 |
3249
|
245 DEFUN_MAPPER (cos, 0, 0, 0, cos, 0, cos, 0.0, 0.0, 0, |
3321
|
246 "-*- texinfo -*-\n\ |
|
247 @deftypefn {Mapping Function} {} cos (@var{X})\n\ |
|
248 cos (X): compute the cosine of X for each element of X\n\ |
|
249 @end deftypefn"); |
529
|
250 |
3249
|
251 DEFUN_MAPPER (cosh, 0, 0, 0, cosh, 0, cosh, 0.0, 0.0, 0, |
3321
|
252 "-*- texinfo -*-\n\ |
|
253 @deftypefn {Mapping Function} {} acosh (@var{X})\n\ |
|
254 acosh (X): compute the inverse hyperbolic cosine of X for each element of X\n\ |
|
255 @end deftypefn"); |
529
|
256 |
3249
|
257 DEFUN_MAPPER (erf, 0, 0, 0, xerf, 0, 0, 0.0, 0.0, 0, |
3321
|
258 "-*- texinfo -*-\n\ |
|
259 @deftypefn {Mapping Function} {} erf (@var{z})\n\ |
|
260 Computes the error function,\n\ |
|
261 @iftex\n\ |
|
262 @tex\n\ |
|
263 $$\n\ |
|
264 {\\rm erf} (z) = {2 \\over \\sqrt{\\pi}}\\int_0^z e^{-t^2} dt\n\ |
|
265 $$\n\ |
|
266 @end tex\n\ |
|
267 @end iftex\n\ |
|
268 @ifinfo\n\ |
|
269 \n\ |
|
270 @smallexample\n\ |
|
271 z\n\ |
|
272 /\n\ |
|
273 erf (z) = (2/sqrt (pi)) | e^(-t^2) dt\n\ |
|
274 /\n\ |
|
275 t=0\n\ |
|
276 @end smallexample\n\ |
|
277 @end ifinfo\n\ |
|
278 @end deftypefn\n\ |
|
279 |
|
280 See also: erfc, erfinv"); |
624
|
281 |
3249
|
282 DEFUN_MAPPER (erfc, 0, 0, 0, xerfc, 0, 0, 0.0, 0.0, 0, |
3321
|
283 "-*- texinfo -*-\n\ |
|
284 @deftypefn {Mapping Function} {} erfc (@var{z})\n\ |
|
285 Computes the complementary error function,\n\ |
|
286 @iftex\n\ |
|
287 @tex\n\ |
|
288 $1 - {\\rm erf} (z)$.\n\ |
|
289 @end tex\n\ |
|
290 @end iftex\n\ |
|
291 @ifinfo\n\ |
|
292 @code{1 - erf (@var{z})}.\n\ |
|
293 @end ifinfo\n\ |
|
294 @end deftypefn\n\ |
|
295 \n\ |
|
296 See also: erf, erfinv"); |
624
|
297 |
3249
|
298 DEFUN_MAPPER (exp, 0, 0, 0, exp, 0, exp, 0.0, 0.0, 0, |
3321
|
299 "-*- texinfo -*-\n\ |
|
300 @deftypefn {Usage} {} exp (@var{x})\n\ |
|
301 Compute the exponential of @var{x}. To compute the matrix exponential,\n\ |
|
302 see @ref{Linear Algebra}.\n\ |
|
303 @end deftypefn"); |
529
|
304 |
3249
|
305 DEFUN_MAPPER (finite, 0, xfinite, xfinite, 0, 0, 0, 0.0, 0.0, 0, |
529
|
306 "finite (X): return 1 for finite elements of X"); |
|
307 |
3249
|
308 DEFUN_MAPPER (fix, 0, 0, 0, fix, 0, fix, 0.0, 0.0, 0, |
3321
|
309 "-*- texinfo -*-\n\ |
|
310 @deftypefn {Usage} {} fix (@var{x})\n\ |
|
311 Truncate @var{x} toward zero. If @var{x} is complex, return\n\ |
|
312 @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}.\n\ |
|
313 @end deftypefn"); |
529
|
314 |
3249
|
315 DEFUN_MAPPER (floor, 0, 0, 0, floor, 0, floor, 0.0, 0.0, 0, |
3321
|
316 "-*- texinfo -*-\n\ |
|
317 @deftypefn {Usage} {} floor (@var{x})\n\ |
|
318 Return the largest integer not greater than @var{x}. If @var{x} is\n\ |
|
319 complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}.\n\ |
|
320 @end deftypefn"); |
529
|
321 |
3249
|
322 DEFUN_MAPPER (gamma, 0, 0, 0, xgamma, 0, 0, 0.0, 0.0, 0, |
3321
|
323 "-*- texinfo -*-\n\ |
|
324 @deftypefn {Mapping Function} {} gamma (@var{z})\n\ |
|
325 Computes the Gamma function,\n\ |
|
326 @iftex\n\ |
|
327 @tex\n\ |
|
328 $$\n\ |
|
329 \\Gamma (z) = \\int_0^\\infty t^{z-1} e^{-t} dt.\n\ |
|
330 $$\n\ |
|
331 @end tex\n\ |
|
332 @end iftex\n\ |
|
333 @ifinfo\n\ |
|
334 \n\ |
|
335 @example\n\ |
|
336 infinity\n\ |
|
337 /\n\ |
|
338 gamma (z) = | t^(z-1) exp (-t) dt.\n\ |
|
339 /\n\ |
|
340 t=0\n\ |
|
341 @end example\n\ |
|
342 @end ifinfo\n\ |
|
343 @end deftypefn\n\ |
|
344 \n\ |
|
345 See also: gammai, lgamma"); |
624
|
346 |
3249
|
347 DEFUN_MAPPER (imag, 0, 0, 0, imag, imag, 0, 0.0, 0.0, 0, |
3321
|
348 "-*- texinfo -*-\n\ |
|
349 @deftypefn {Mapping Function} {} imag (@var{z})\n\ |
|
350 Return the imaginary part of @var{z} as a real number.\n\ |
|
351 @end deftypefn\n\ |
|
352 \n\ |
|
353 See also: real, conj"); |
2089
|
354 |
3249
|
355 DEFUN_MAPPER (isalnum, xisalnum, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
356 "-*- texinfo -*-\n\ |
|
357 @deftypefn {Mapping Function} {} isalnum (@var{s})\n\ |
|
358 Return 1 for characters that are letters or digits (@code{isalpha\n\ |
|
359 (@var{a})} or @code{isdigit (@var{a})} is true).\n\ |
|
360 @end deftypefn"); |
2089
|
361 |
3249
|
362 DEFUN_MAPPER (isalpha, xisalpha, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
363 "-*- texinfo -*-\n\ |
|
364 @deftypefn {Mapping Function} {} isalpha (@var{s})\n\ |
|
365 Return true for characters that are letters (@code{isupper (@var{a})}\n\ |
|
366 or @code{islower (@var{})} is true).\n\ |
|
367 @end deftypefn"); |
2089
|
368 |
3249
|
369 DEFUN_MAPPER (isascii, xisascii, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
370 "-*- texinfo -*-\n\ |
|
371 @deftypefn {Mapping Function} {} isascii (@var{s})\n\ |
|
372 Return 1 for characters that are ASCII (in the range 0 to 127 decimal).\n\ |
|
373 @end deftypefn"); |
2089
|
374 |
3249
|
375 DEFUN_MAPPER (iscntrl, xiscntrl, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
376 "-*- texinfo -*-\n\ |
|
377 @deftypefn {Mapping Function} {} iscntrl (@var{s})\n\ |
|
378 Return 1 for control characters.\n\ |
|
379 @end deftypefn"); |
2089
|
380 |
3249
|
381 DEFUN_MAPPER (isdigit, xisdigit, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
382 "-*- texinfo -*-\n\ |
|
383 @deftypefn {Mapping Function} {} isdigit (@var{s})\n\ |
|
384 Return 1 for characters that are decimal digits.\n\ |
|
385 @end deftypefn"); |
2089
|
386 |
3249
|
387 DEFUN_MAPPER (isinf, 0, xisinf, xisinf, 0, 0, 0, 0.0, 0.0, 0, |
529
|
388 "isinf (X): return 1 for elements of X infinite"); |
|
389 |
3249
|
390 DEFUN_MAPPER (isgraph, xisgraph, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
391 "-*- texinfo -*-\n\ |
|
392 @deftypefn {Mapping Function} {} isgraph (@var{s})\n\ |
|
393 Return 1 for printable characters (but not the space character).\n\ |
|
394 @end deftypefn"); |
529
|
395 |
3249
|
396 DEFUN_MAPPER (islower, xislower, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
397 "-*- texinfo -*-\n\ |
|
398 @deftypefn {Mapping Function} {} islower (@var{s})\n\ |
|
399 Return 1 for characters that are lower case letters.\n\ |
|
400 @end deftypefn"); |
2089
|
401 |
3249
|
402 DEFUN_MAPPER (isnan, 0, xisnan, xisnan, 0, 0, 0, 0.0, 0.0, 0, |
529
|
403 "isnan (X): return 1 where elements of X are NaNs"); |
624
|
404 |
3249
|
405 DEFUN_MAPPER (isprint, xisprint, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
406 "-*- texinfo -*-\n\ |
|
407 @deftypefn {Mapping Function} {} isprint (@var{s})\n\ |
|
408 Return 1 for printable characters (including the space character).\n\ |
|
409 @end deftypefn"); |
2089
|
410 |
3249
|
411 DEFUN_MAPPER (ispunct, xispunct, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
412 "-*- texinfo -*-\n\ |
|
413 @deftypefn {Mapping Function} {} ispunct (@var{s})\n\ |
|
414 Return 1 for punctuation characters.\n\ |
|
415 @end deftypefn"); |
2089
|
416 |
3249
|
417 DEFUN_MAPPER (isspace, xisspace, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
418 "-*- texinfo -*-\n\ |
|
419 @deftypefn {Mapping Function} {} isspace (@var{s})\n\ |
|
420 Return 1 for whitespace characters (space, formfeed, newline,\n\ |
|
421 carriage return, tab, and vertical tab).\n\ |
|
422 @end deftypefn"); |
2089
|
423 |
3249
|
424 DEFUN_MAPPER (isupper, xisupper, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
425 "-*- texinfo -*-\n\ |
|
426 @deftypefn {Mapping Function} {} isupper (@var{s})\n\ |
|
427 Return 1 for upper case letters.\n\ |
|
428 @end deftypefn"); |
2089
|
429 |
3249
|
430 DEFUN_MAPPER (isxdigit, xisxdigit, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
431 "-*- texinfo -*-\n\ |
|
432 @deftypefn {Mapping Function} {} isxdigit (@var{s})\n\ |
|
433 Return 1 for characters that are hexadecimal digits.\n\ |
|
434 @end deftypefn"); |
2089
|
435 |
3249
|
436 DEFUN_MAPPER (lgamma, 0, 0, 0, xlgamma, 0, 0, 0.0, 0.0, 0, |
3321
|
437 "-*- texinfo -*-\n\ |
|
438 @deftypefn {Mapping Function} {} lgamma (@var{a}, @var{x})\n\ |
|
439 @deftypefnx {Mapping Function} {} gammaln (@var{a}, @var{x})\n\ |
|
440 Return the natural logarithm of the gamma function.\n\ |
|
441 @end deftypefn\n\ |
|
442 \n\ |
|
443 See also: gamma, gammai"); |
529
|
444 |
3249
|
445 DEFUN_MAPPER (log, 0, 0, 0, log, 0, log, 0.0, DBL_MAX, 1, |
3321
|
446 "-*- texinfo -*-\n\ |
|
447 @deftypefn {Mapping Function} {} log (@var{x})\n\ |
|
448 Compute the natural logarithm for each element of @var{x}. To compute the\n\ |
|
449 matrix logarithm, see @ref{Linear Algebra}.\n\ |
|
450 @end deftypefn\n\ |
|
451 \n\ |
|
452 See also: log2, log10, logspace, exp"); |
529
|
453 |
3249
|
454 DEFUN_MAPPER (log10, 0, 0, 0, log10, 0, log10, 0.0, DBL_MAX, 1, |
3321
|
455 "-*- texinfo -*-\n\ |
|
456 @deftypefn {Mapping Function} {} log10 (@var{x})\n\ |
|
457 Compute the base-10 logarithm for each element of @var{x}.\n\ |
|
458 @end deftypefn\n\ |
|
459 \n\ |
|
460 See also: log, log2, logspace, exp"); |
529
|
461 |
3249
|
462 DEFUN_MAPPER (real, 0, 0, 0, real, real, 0, 0.0, 0.0, 0, |
3321
|
463 "-*-texinfo -*-\n\ |
|
464 @deftypefn {Mapping Function} {} real (@var{z})\n\ |
|
465 Return the real part of @var{z}.\n\ |
|
466 @end deftypefn\n\ |
|
467 \n\ |
|
468 See also: imag, conj"); |
529
|
469 |
3249
|
470 DEFUN_MAPPER (round, 0, 0, 0, round, 0, round, 0.0, 0.0, 0, |
3321
|
471 "-*- texinfo -*-\n\ |
|
472 @deftypefn {Mapping Function} {} round (@var{x})\n\ |
|
473 Return the integer nearest to @var{x}. If @var{x} is complex, return\n\ |
|
474 @code{round (real (@var{x})) + round (imag (@var{x})) * I}.\n\ |
|
475 @end deftypefn\n\ |
|
476 \n\ |
|
477 See also: rem"); |
529
|
478 |
3249
|
479 DEFUN_MAPPER (sign, 0, 0, 0, signum, 0, signum, 0.0, 0.0, 0, |
3321
|
480 "-*- texinfo -*-\n\ |
|
481 @deftypefn {Mapping Function} {} sign (@var{x})\n\ |
|
482 Compute the @dfn{signum} function, which is defined as\n\ |
|
483 @iftex\n\ |
|
484 @tex\n\ |
|
485 $$\n\ |
|
486 {\\rm sign} (@var{x}) = \\cases{1,&$x>0$;\\cr 0,&$x=0$;\\cr -1,&$x<0$.\\cr}\n\ |
|
487 $$\n\ |
|
488 @end tex\n\ |
|
489 @end iftex\n\ |
|
490 @ifinfo\n\ |
|
491 \n\ |
|
492 @example\n\ |
|
493 -1, x < 0;\n\ |
|
494 sign (x) = 0, x = 0;\n\ |
|
495 1, x > 0.\n\ |
|
496 @end example\n\ |
|
497 @end ifinfo\n\ |
|
498 \n\ |
|
499 For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}.\n\ |
|
500 @end deftypefn"); |
529
|
501 |
3249
|
502 DEFUN_MAPPER (sin, 0, 0, 0, sin, 0, sin, 0.0, 0.0, 0, |
3321
|
503 "-*- texinfo -*-\n\ |
|
504 @deftypefn {Mapping Function} {} sin (@var{X})\n\ |
|
505 sin (X): compute the sin of X for each element of X\n\ |
|
506 @end deftypefn"); |
529
|
507 |
3249
|
508 DEFUN_MAPPER (sinh, 0, 0, 0, sinh, 0, sinh, 0.0, 0.0, 0, |
3321
|
509 "-*- texinfo -*-\n\ |
|
510 @deftypefn {Mapping Function} {} sinh (@var{X})\n\ |
|
511 sinh (X): compute the inverse hyperbolic sin of X for each element of X\n\ |
|
512 @end deftypefn"); |
529
|
513 |
3249
|
514 DEFUN_MAPPER (sqrt, 0, 0, 0, sqrt, 0, sqrt, 0.0, DBL_MAX, 1, |
3321
|
515 "-*- texinfo -*-\n\ |
|
516 @deftypefn {Mapping Function} {} sqrt (@var{x})\n\ |
|
517 Compute the square root of @var{x}. If @var{x} is negative, a complex\n\ |
|
518 result is returned. To compute the matrix square root, see\n\ |
|
519 @ref{Linear Algebra}.\n\ |
|
520 @end deftypefn"); |
529
|
521 |
3249
|
522 DEFUN_MAPPER (tan, 0, 0, 0, tan, 0, tan, 0.0, 0.0, 0, |
3321
|
523 "-*- texinfo -*-\n\ |
|
524 @deftypefn {Mapping Function} {} tan (@var{z})\n\ |
|
525 tan (X): compute tanget of X for each element of X\n\ |
|
526 @end deftypefn"); |
529
|
527 |
3249
|
528 DEFUN_MAPPER (tanh, 0, 0, 0, tanh, 0, tanh, 0.0, 0.0, 0, |
3321
|
529 "-*- texinfo -*-\n\ |
|
530 @deftypefn {Mapping Function} {} tanh (@var{X})\n\ |
|
531 tanh (X): compute hyperbolic tangent of X for each element of X\n\ |
|
532 @end deftypefn"); |
1562
|
533 |
3249
|
534 DEFUN_MAPPER (toascii, xtoascii, 0, 0, 0, 0, 0, 0.0, 0.0, 1, |
3361
|
535 "-*- texinfo -*-\n\ |
|
536 @deftypefn {Mapping Function} {} toascii (@var{s})\n\ |
|
537 Return ASCII representation of @var{s} in a matrix. For example,\n\ |
|
538 \n\ |
|
539 @example\n\ |
|
540 @group\n\ |
|
541 toascii (\"ASCII\")\n\ |
|
542 @result{} [ 65, 83, 67, 73, 73 ]\n\ |
|
543 @end group\n\ |
|
544 \n\ |
|
545 @end example\n\ |
|
546 @end deftypefn") |
2267
|
547 |
3249
|
548 DEFUN_MAPPER (tolower, xtolower, 0, 0, 0, 0, 0, 0.0, 0.0, 2, |
3361
|
549 "-*- texinfo -*-\n\ |
|
550 @deftypefn {Mapping Function} {} tolower (@var{s})\n\ |
|
551 Return a copy of the string @var{s}, with each upper-case character\n\ |
|
552 replaced by the corresponding lower-case one; nonalphabetic characters\n\ |
|
553 are left unchanged. For example,\n\ |
|
554 \n\ |
|
555 @example\n\ |
|
556 tolower (\"MiXeD cAsE 123\")\n\ |
|
557 @result{} \"mixed case 123\"\n\ |
|
558 @end example\n\ |
|
559 @end deftypefn") |
2267
|
560 |
3249
|
561 DEFUN_MAPPER (toupper, xtoupper, 0, 0, 0, 0, 0, 0.0, 0.0, 2, |
3361
|
562 "-*- texinfo -*-\n\ |
|
563 @deftypefn {Function File} {} toupper (@var{s})\n\ |
|
564 Return a copy of the string @var{s}, with each lower-case character\n\ |
|
565 replaced by the corresponding upper-case one; nonalphabetic characters\n\ |
|
566 are left unchanged. For example,\n\ |
|
567 \n\ |
|
568 @example\n\ |
|
569 @group\n\ |
|
570 toupper (\"MiXeD cAsE 123\") |
|
571 @result{} \"MIXED CASE 123\"\n\ |
|
572 @end group\n\ |
|
573 @end example\n\ |
|
574 @end deftypefn") |
2267
|
575 |
1562
|
576 DEFALIAS (gammaln, lgamma); |
3206
|
577 |
|
578 DEFALIAS (isfinite, finite); |
3321
|
579 |
|
580 // Leave the previous new line, mkgendoc needs it! |
529
|
581 } |
|
582 |
1
|
583 /* |
|
584 ;;; Local Variables: *** |
|
585 ;;; mode: C++ *** |
|
586 ;;; End: *** |
|
587 */ |