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\ |
3373
|
224 @deftypefn {Mapping Function} {} ceil (@var{x})\n\ |
3321
|
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, |
3381
|
230 "-*- texinfo -*-\n\ |
3321
|
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\ |
3373
|
300 @deftypefn {Mapping Function} {} exp (@var{x})\n\ |
3321
|
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, |
3369
|
306 "-*- texinfo -*-\n\ |
|
307 @deftypefn {Mapping Function} {} finite (@var{x})\n\ |
|
308 Return 1 for elements of @var{x} that are NaN values and zero\n\ |
|
309 otherwise. For example,\n\ |
|
310 \n\ |
|
311 @example\n\ |
|
312 @group\n\ |
|
313 finite ([13, Inf, NaN])\n\ |
|
314 @result{} [ 1, 0, 0 ]\n\ |
|
315 @end group\n\ |
|
316 @end example\n\ |
|
317 @end deftypefn"); |
529
|
318 |
3249
|
319 DEFUN_MAPPER (fix, 0, 0, 0, fix, 0, fix, 0.0, 0.0, 0, |
3321
|
320 "-*- texinfo -*-\n\ |
3373
|
321 @deftypefn {Mapping Function} {} fix (@var{x})\n\ |
3321
|
322 Truncate @var{x} toward zero. If @var{x} is complex, return\n\ |
|
323 @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}.\n\ |
|
324 @end deftypefn"); |
529
|
325 |
3249
|
326 DEFUN_MAPPER (floor, 0, 0, 0, floor, 0, floor, 0.0, 0.0, 0, |
3321
|
327 "-*- texinfo -*-\n\ |
3373
|
328 @deftypefn {Mapping Function} {} floor (@var{x})\n\ |
3321
|
329 Return the largest integer not greater than @var{x}. If @var{x} is\n\ |
|
330 complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}.\n\ |
|
331 @end deftypefn"); |
529
|
332 |
3249
|
333 DEFUN_MAPPER (gamma, 0, 0, 0, xgamma, 0, 0, 0.0, 0.0, 0, |
3321
|
334 "-*- texinfo -*-\n\ |
|
335 @deftypefn {Mapping Function} {} gamma (@var{z})\n\ |
|
336 Computes the Gamma function,\n\ |
|
337 @iftex\n\ |
|
338 @tex\n\ |
|
339 $$\n\ |
|
340 \\Gamma (z) = \\int_0^\\infty t^{z-1} e^{-t} dt.\n\ |
|
341 $$\n\ |
|
342 @end tex\n\ |
|
343 @end iftex\n\ |
|
344 @ifinfo\n\ |
|
345 \n\ |
|
346 @example\n\ |
|
347 infinity\n\ |
|
348 /\n\ |
|
349 gamma (z) = | t^(z-1) exp (-t) dt.\n\ |
|
350 /\n\ |
|
351 t=0\n\ |
|
352 @end example\n\ |
|
353 @end ifinfo\n\ |
|
354 @end deftypefn\n\ |
|
355 \n\ |
|
356 See also: gammai, lgamma"); |
624
|
357 |
3249
|
358 DEFUN_MAPPER (imag, 0, 0, 0, imag, imag, 0, 0.0, 0.0, 0, |
3321
|
359 "-*- texinfo -*-\n\ |
|
360 @deftypefn {Mapping Function} {} imag (@var{z})\n\ |
|
361 Return the imaginary part of @var{z} as a real number.\n\ |
|
362 @end deftypefn\n\ |
|
363 \n\ |
|
364 See also: real, conj"); |
2089
|
365 |
3249
|
366 DEFUN_MAPPER (isalnum, xisalnum, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
367 "-*- texinfo -*-\n\ |
|
368 @deftypefn {Mapping Function} {} isalnum (@var{s})\n\ |
|
369 Return 1 for characters that are letters or digits (@code{isalpha\n\ |
|
370 (@var{a})} or @code{isdigit (@var{a})} is true).\n\ |
|
371 @end deftypefn"); |
2089
|
372 |
3249
|
373 DEFUN_MAPPER (isalpha, xisalpha, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
374 "-*- texinfo -*-\n\ |
|
375 @deftypefn {Mapping Function} {} isalpha (@var{s})\n\ |
|
376 Return true for characters that are letters (@code{isupper (@var{a})}\n\ |
|
377 or @code{islower (@var{})} is true).\n\ |
|
378 @end deftypefn"); |
2089
|
379 |
3249
|
380 DEFUN_MAPPER (isascii, xisascii, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
381 "-*- texinfo -*-\n\ |
|
382 @deftypefn {Mapping Function} {} isascii (@var{s})\n\ |
|
383 Return 1 for characters that are ASCII (in the range 0 to 127 decimal).\n\ |
|
384 @end deftypefn"); |
2089
|
385 |
3249
|
386 DEFUN_MAPPER (iscntrl, xiscntrl, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
387 "-*- texinfo -*-\n\ |
|
388 @deftypefn {Mapping Function} {} iscntrl (@var{s})\n\ |
|
389 Return 1 for control characters.\n\ |
|
390 @end deftypefn"); |
2089
|
391 |
3249
|
392 DEFUN_MAPPER (isdigit, xisdigit, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
393 "-*- texinfo -*-\n\ |
|
394 @deftypefn {Mapping Function} {} isdigit (@var{s})\n\ |
|
395 Return 1 for characters that are decimal digits.\n\ |
|
396 @end deftypefn"); |
2089
|
397 |
3249
|
398 DEFUN_MAPPER (isinf, 0, xisinf, xisinf, 0, 0, 0, 0.0, 0.0, 0, |
3369
|
399 "-*- texinfo -*-\n\ |
|
400 @deftypefn {Mapping Function} {} isinf (@var{x})\n\ |
|
401 Return 1 for elements of @var{x} that are infinite and zero\n\ |
|
402 otherwise. For example,\n\ |
|
403 \n\ |
|
404 @example\n\ |
|
405 @group\n\ |
|
406 isinf ([13, Inf, NaN])\n\ |
|
407 @result{} [ 0, 1, 0 ]\n\ |
|
408 @end group\n\ |
|
409 @end example\n\ |
|
410 @end deftypefn"); |
529
|
411 |
3249
|
412 DEFUN_MAPPER (isgraph, xisgraph, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
413 "-*- texinfo -*-\n\ |
|
414 @deftypefn {Mapping Function} {} isgraph (@var{s})\n\ |
|
415 Return 1 for printable characters (but not the space character).\n\ |
|
416 @end deftypefn"); |
529
|
417 |
3249
|
418 DEFUN_MAPPER (islower, xislower, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
419 "-*- texinfo -*-\n\ |
|
420 @deftypefn {Mapping Function} {} islower (@var{s})\n\ |
|
421 Return 1 for characters that are lower case letters.\n\ |
|
422 @end deftypefn"); |
2089
|
423 |
3249
|
424 DEFUN_MAPPER (isnan, 0, xisnan, xisnan, 0, 0, 0, 0.0, 0.0, 0, |
3369
|
425 "-*- texinfo -*-\n\ |
|
426 @deftypefn {Mapping Function} {} isnan (@var{x})\n\ |
|
427 Return 1 for elements of @var{x} that are NaN values and zero\n\ |
|
428 otherwise. For example,\n\ |
|
429 \n\ |
|
430 @example\n\ |
|
431 @group\n\ |
|
432 isnan ([13, Inf, NaN])\n\ |
|
433 @result{} [ 0, 0, 1 ]\n\ |
|
434 @end group\n\ |
|
435 @end example\n\ |
|
436 @end deftypefn"); |
624
|
437 |
3249
|
438 DEFUN_MAPPER (isprint, xisprint, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
439 "-*- texinfo -*-\n\ |
|
440 @deftypefn {Mapping Function} {} isprint (@var{s})\n\ |
|
441 Return 1 for printable characters (including the space character).\n\ |
|
442 @end deftypefn"); |
2089
|
443 |
3249
|
444 DEFUN_MAPPER (ispunct, xispunct, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
445 "-*- texinfo -*-\n\ |
|
446 @deftypefn {Mapping Function} {} ispunct (@var{s})\n\ |
|
447 Return 1 for punctuation characters.\n\ |
|
448 @end deftypefn"); |
2089
|
449 |
3249
|
450 DEFUN_MAPPER (isspace, xisspace, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
451 "-*- texinfo -*-\n\ |
|
452 @deftypefn {Mapping Function} {} isspace (@var{s})\n\ |
|
453 Return 1 for whitespace characters (space, formfeed, newline,\n\ |
|
454 carriage return, tab, and vertical tab).\n\ |
|
455 @end deftypefn"); |
2089
|
456 |
3249
|
457 DEFUN_MAPPER (isupper, xisupper, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
458 "-*- texinfo -*-\n\ |
|
459 @deftypefn {Mapping Function} {} isupper (@var{s})\n\ |
|
460 Return 1 for upper case letters.\n\ |
|
461 @end deftypefn"); |
2089
|
462 |
3249
|
463 DEFUN_MAPPER (isxdigit, xisxdigit, 0, 0, 0, 0, 0, 0.0, 0.0, 0, |
3361
|
464 "-*- texinfo -*-\n\ |
|
465 @deftypefn {Mapping Function} {} isxdigit (@var{s})\n\ |
|
466 Return 1 for characters that are hexadecimal digits.\n\ |
|
467 @end deftypefn"); |
2089
|
468 |
3249
|
469 DEFUN_MAPPER (lgamma, 0, 0, 0, xlgamma, 0, 0, 0.0, 0.0, 0, |
3321
|
470 "-*- texinfo -*-\n\ |
|
471 @deftypefn {Mapping Function} {} lgamma (@var{a}, @var{x})\n\ |
|
472 @deftypefnx {Mapping Function} {} gammaln (@var{a}, @var{x})\n\ |
|
473 Return the natural logarithm of the gamma function.\n\ |
|
474 @end deftypefn\n\ |
|
475 \n\ |
|
476 See also: gamma, gammai"); |
529
|
477 |
3249
|
478 DEFUN_MAPPER (log, 0, 0, 0, log, 0, log, 0.0, DBL_MAX, 1, |
3321
|
479 "-*- texinfo -*-\n\ |
|
480 @deftypefn {Mapping Function} {} log (@var{x})\n\ |
|
481 Compute the natural logarithm for each element of @var{x}. To compute the\n\ |
|
482 matrix logarithm, see @ref{Linear Algebra}.\n\ |
|
483 @end deftypefn\n\ |
|
484 \n\ |
|
485 See also: log2, log10, logspace, exp"); |
529
|
486 |
3249
|
487 DEFUN_MAPPER (log10, 0, 0, 0, log10, 0, log10, 0.0, DBL_MAX, 1, |
3321
|
488 "-*- texinfo -*-\n\ |
|
489 @deftypefn {Mapping Function} {} log10 (@var{x})\n\ |
|
490 Compute the base-10 logarithm for each element of @var{x}.\n\ |
|
491 @end deftypefn\n\ |
|
492 \n\ |
|
493 See also: log, log2, logspace, exp"); |
529
|
494 |
3249
|
495 DEFUN_MAPPER (real, 0, 0, 0, real, real, 0, 0.0, 0.0, 0, |
3381
|
496 "-*- texinfo -*-\n\ |
3321
|
497 @deftypefn {Mapping Function} {} real (@var{z})\n\ |
|
498 Return the real part of @var{z}.\n\ |
|
499 @end deftypefn\n\ |
|
500 \n\ |
|
501 See also: imag, conj"); |
529
|
502 |
3249
|
503 DEFUN_MAPPER (round, 0, 0, 0, round, 0, round, 0.0, 0.0, 0, |
3321
|
504 "-*- texinfo -*-\n\ |
|
505 @deftypefn {Mapping Function} {} round (@var{x})\n\ |
|
506 Return the integer nearest to @var{x}. If @var{x} is complex, return\n\ |
|
507 @code{round (real (@var{x})) + round (imag (@var{x})) * I}.\n\ |
|
508 @end deftypefn\n\ |
|
509 \n\ |
|
510 See also: rem"); |
529
|
511 |
3249
|
512 DEFUN_MAPPER (sign, 0, 0, 0, signum, 0, signum, 0.0, 0.0, 0, |
3321
|
513 "-*- texinfo -*-\n\ |
|
514 @deftypefn {Mapping Function} {} sign (@var{x})\n\ |
|
515 Compute the @dfn{signum} function, which is defined as\n\ |
|
516 @iftex\n\ |
|
517 @tex\n\ |
|
518 $$\n\ |
|
519 {\\rm sign} (@var{x}) = \\cases{1,&$x>0$;\\cr 0,&$x=0$;\\cr -1,&$x<0$.\\cr}\n\ |
|
520 $$\n\ |
|
521 @end tex\n\ |
|
522 @end iftex\n\ |
|
523 @ifinfo\n\ |
|
524 \n\ |
|
525 @example\n\ |
|
526 -1, x < 0;\n\ |
|
527 sign (x) = 0, x = 0;\n\ |
|
528 1, x > 0.\n\ |
|
529 @end example\n\ |
|
530 @end ifinfo\n\ |
|
531 \n\ |
|
532 For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}.\n\ |
|
533 @end deftypefn"); |
529
|
534 |
3249
|
535 DEFUN_MAPPER (sin, 0, 0, 0, sin, 0, sin, 0.0, 0.0, 0, |
3321
|
536 "-*- texinfo -*-\n\ |
|
537 @deftypefn {Mapping Function} {} sin (@var{X})\n\ |
|
538 sin (X): compute the sin of X for each element of X\n\ |
|
539 @end deftypefn"); |
529
|
540 |
3249
|
541 DEFUN_MAPPER (sinh, 0, 0, 0, sinh, 0, sinh, 0.0, 0.0, 0, |
3321
|
542 "-*- texinfo -*-\n\ |
|
543 @deftypefn {Mapping Function} {} sinh (@var{X})\n\ |
|
544 sinh (X): compute the inverse hyperbolic sin of X for each element of X\n\ |
|
545 @end deftypefn"); |
529
|
546 |
3249
|
547 DEFUN_MAPPER (sqrt, 0, 0, 0, sqrt, 0, sqrt, 0.0, DBL_MAX, 1, |
3321
|
548 "-*- texinfo -*-\n\ |
|
549 @deftypefn {Mapping Function} {} sqrt (@var{x})\n\ |
|
550 Compute the square root of @var{x}. If @var{x} is negative, a complex\n\ |
|
551 result is returned. To compute the matrix square root, see\n\ |
|
552 @ref{Linear Algebra}.\n\ |
|
553 @end deftypefn"); |
529
|
554 |
3249
|
555 DEFUN_MAPPER (tan, 0, 0, 0, tan, 0, tan, 0.0, 0.0, 0, |
3321
|
556 "-*- texinfo -*-\n\ |
|
557 @deftypefn {Mapping Function} {} tan (@var{z})\n\ |
|
558 tan (X): compute tanget of X for each element of X\n\ |
|
559 @end deftypefn"); |
529
|
560 |
3249
|
561 DEFUN_MAPPER (tanh, 0, 0, 0, tanh, 0, tanh, 0.0, 0.0, 0, |
3321
|
562 "-*- texinfo -*-\n\ |
|
563 @deftypefn {Mapping Function} {} tanh (@var{X})\n\ |
|
564 tanh (X): compute hyperbolic tangent of X for each element of X\n\ |
|
565 @end deftypefn"); |
1562
|
566 |
3249
|
567 DEFUN_MAPPER (toascii, xtoascii, 0, 0, 0, 0, 0, 0.0, 0.0, 1, |
3361
|
568 "-*- texinfo -*-\n\ |
|
569 @deftypefn {Mapping Function} {} toascii (@var{s})\n\ |
|
570 Return ASCII representation of @var{s} in a matrix. For example,\n\ |
|
571 \n\ |
|
572 @example\n\ |
|
573 @group\n\ |
|
574 toascii (\"ASCII\")\n\ |
|
575 @result{} [ 65, 83, 67, 73, 73 ]\n\ |
|
576 @end group\n\ |
|
577 \n\ |
|
578 @end example\n\ |
3362
|
579 @end deftypefn"); |
2267
|
580 |
3249
|
581 DEFUN_MAPPER (tolower, xtolower, 0, 0, 0, 0, 0, 0.0, 0.0, 2, |
3361
|
582 "-*- texinfo -*-\n\ |
|
583 @deftypefn {Mapping Function} {} tolower (@var{s})\n\ |
|
584 Return a copy of the string @var{s}, with each upper-case character\n\ |
|
585 replaced by the corresponding lower-case one; nonalphabetic characters\n\ |
|
586 are left unchanged. For example,\n\ |
|
587 \n\ |
|
588 @example\n\ |
|
589 tolower (\"MiXeD cAsE 123\")\n\ |
|
590 @result{} \"mixed case 123\"\n\ |
|
591 @end example\n\ |
3362
|
592 @end deftypefn"); |
2267
|
593 |
3249
|
594 DEFUN_MAPPER (toupper, xtoupper, 0, 0, 0, 0, 0, 0.0, 0.0, 2, |
3361
|
595 "-*- texinfo -*-\n\ |
3368
|
596 @deftypefn {Built-in Function} {} toupper (@var{s})\n\ |
3361
|
597 Return a copy of the string @var{s}, with each lower-case character\n\ |
|
598 replaced by the corresponding upper-case one; nonalphabetic characters\n\ |
|
599 are left unchanged. For example,\n\ |
|
600 \n\ |
|
601 @example\n\ |
|
602 @group\n\ |
|
603 toupper (\"MiXeD cAsE 123\") |
|
604 @result{} \"MIXED CASE 123\"\n\ |
|
605 @end group\n\ |
|
606 @end example\n\ |
3362
|
607 @end deftypefn"); |
2267
|
608 |
1562
|
609 DEFALIAS (gammaln, lgamma); |
3206
|
610 |
|
611 DEFALIAS (isfinite, finite); |
3321
|
612 |
|
613 // Leave the previous new line, mkgendoc needs it! |
529
|
614 } |
|
615 |
1
|
616 /* |
|
617 ;;; Local Variables: *** |
|
618 ;;; mode: C++ *** |
|
619 ;;; End: *** |
|
620 */ |