Mercurial > hg > octave-nkf
diff src/mappers.cc @ 529:7ea224e713cd
[project @ 1994-07-20 18:54:27 by jwe]
author | jwe |
---|---|
date | Wed, 20 Jul 1994 19:19:08 +0000 |
parents | ee2dbf1eb16c |
children | 1a7dea6fa26b |
line wrap: on
line diff
--- a/src/mappers.cc +++ b/src/mappers.cc @@ -28,8 +28,11 @@ #include <float.h> #include <Complex.h> +#include "missing-math.h" +#include "variables.h" #include "mappers.h" #include "utils.h" +#include "defun.h" #if defined (_AIX) && defined (__GNUG__) #undef finite @@ -272,6 +275,102 @@ return retval; } +void +install_mapper_functions (void) +{ + DEFUN_MAPPER ("abs", Sabs, 0, 0.0, 0.0, fabs, abs, 0, + "abs (X): compute abs (X) for each element of X"); + + DEFUN_MAPPER ("acos", Sacos, 1, -1.0, 1.0, acos, 0, acos, + "acos (X): compute acos (X) for each element of X"); + + DEFUN_MAPPER ("acosh", Sacosh, 1, 1.0, DBL_MAX, acosh, 0, acosh, + "acosh (X): compute acosh (X) for each element of X"); + + DEFUN_MAPPER ("angle", Sangle, 0, 0.0, 0.0, arg, arg, 0, + "angle (X): compute arg (X) for each element of X"); + + DEFUN_MAPPER ("arg", Sarg, 0, 0.0, 0.0, arg, arg, 0, + "arg (X): compute arg (X) for each element of X"); + + DEFUN_MAPPER ("asin", Sasin, 1, -1.0, 1.0, asin, 0, asin, + "asin (X): compute asin (X) for each element of X"); + + DEFUN_MAPPER ("asinh", Sasinh, 0, 0.0, 0.0, asinh, 0, asinh, + "asinh (X): compute asinh (X) for each element of X"); + + DEFUN_MAPPER ("atan", Satan, 0, 0.0, 0.0, atan, 0, atan, + "atan (X): compute atan (X) for each element of X"); + + DEFUN_MAPPER ("atanh", Satanh, 1, -1.0, 1.0, atanh, 0, atanh, + "atanh (X): compute atanh (X) for each element of X"); + + DEFUN_MAPPER ("ceil", Sceil, 0, 0.0, 0.0, ceil, 0, ceil, + "ceil (X): round elements of X toward +Inf"); + + DEFUN_MAPPER ("conj", Sconj, 0, 0.0, 0.0, conj, 0, conj, + "conj (X): compute complex conjugate for each element of X"); + + DEFUN_MAPPER ("cos", Scos, 0, 0.0, 0.0, cos, 0, cos, + "cos (X): compute cos (X) for each element of X"); + + DEFUN_MAPPER ("cosh", Scosh, 0, 0.0, 0.0, cosh, 0, cosh, + "cosh (X): compute cosh (X) for each element of X"); + + DEFUN_MAPPER ("exp", Sexp, 0, 0.0, 0.0, exp, 0, exp, + "exp (X): compute exp (X) for each element of X"); + + DEFUN_MAPPER ("finite", Sfinite, 0, 0.0, 0.0, xfinite, xfinite, 0, + "finite (X): return 1 for finite elements of X"); + + DEFUN_MAPPER ("fix", Sfix, 0, 0.0, 0.0, fix, 0, fix, + "fix (X): round elements of X toward zero"); + + DEFUN_MAPPER ("floor", Sfloor, 0, 0.0, 0.0, floor, 0, floor, + "floor (X): round elements of X toward -Inf"); + + DEFUN_MAPPER ("isinf", Sisinf, 0, 0.0, 0.0, xisinf, xisinf, 0, + "isinf (X): return 1 for elements of X infinite"); + + DEFUN_MAPPER ("imag", Simag, 0, 0.0, 0.0, imag, imag, 0, + "imag (X): return imaginary part for each elements of X"); + +#ifdef HAVE_ISNAN + DEFUN_MAPPER ("isnan", Sisnan, 0, 0.0, 0.0, xisnan, xisnan, 0, + "isnan (X): return 1 where elements of X are NaNs"); +#endif + + DEFUN_MAPPER ("log", Slog, 1, 0.0, DBL_MAX, log, 0, log, + "log (X): compute log (X) for each element of X"); + + DEFUN_MAPPER ("log10", Slog10, 1, 0.0, DBL_MAX, log10, 0, log10, + "log10 (X): compute log10 (X) for each element of X"); + + DEFUN_MAPPER ("real", Sreal, 0, 0.0, 0.0, real, real, 0, + "real (X): return real part for each element of X"); + + DEFUN_MAPPER ("round", Sround, 0, 0.0, 0.0, round, 0, round, + "round (X): round elements of X to nearest integer"); + + DEFUN_MAPPER ("sign", Ssign, 0, 0.0, 0.0, signum, 0, signum, + "sign (X): apply signum function to elements of X"); + + DEFUN_MAPPER ("sin", Ssin, 0, 0.0, 0.0, sin, 0, sin, + "sin (X): compute sin (X) for each element of X"); + + DEFUN_MAPPER ("sinh", Ssinh, 0, 0.0, 0.0, sinh, 0, sinh, + "sinh (X): compute sinh (X) for each element of X"); + + DEFUN_MAPPER ("sqrt", Ssqrt, 1, 0.0, DBL_MAX, sqrt, 0, sqrt, + "sqrt (X): compute sqrt (X) for each element of X"); + + DEFUN_MAPPER ("tan", Stan, 0, 0.0, 0.0, tan, 0, tan, + "tan (X): compute tan (X) for each element of X"); + + DEFUN_MAPPER ("tanh", Stanh, 0, 0.0, 0.0, tanh, 0, tanh, + "tanh (X): compute tanh (X) for each element of X"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***