Navigation

Operators and Keywords

Function List:

C++ API

mappers.cc File Reference

#include <cctype>
#include <cfloat>
#include "lo-ieee.h"
#include "lo-specfun.h"
#include "lo-mappers.h"
#include "defun.h"
#include "error.h"
#include "variables.h"

Include dependency graph for mappers.cc:


Functions

 DEFUN (abs, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} abs (@var{z})\n\ Compute the magnitude of @var{z}, defined as\n\ @tex\n\ $|z| = \\sqrt{x^2 + y^2}$.\n\ @end tex\n\ @ifnottex\n\ |@var{z}| = @code{sqrt (x^2 + y^2)}.\n\ @end ifnottex\n\ \n\ For example,\n\ \n\ @example\n\ @group\n\ abs (3 + 4i)\n\ @result{} 5\n\ @end group\n\ @end example\n\ @end deftypefn")
 DEFUN (acos, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} acos (@var{x})\n\ Compute the inverse cosine in radians for each element of @var{x}.\n\ @seealso{cos, acosd}\n\ @end deftypefn")
 DEFUN (acosh, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} acosh (@var{x})\n\ Compute the inverse hyperbolic cosine for each element of @var{x}.\n\ @seealso{cosh}\n\ @end deftypefn")
 DEFUN (angle, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} angle (@var{z})\n\ See arg.\n\ @end deftypefn")
 DEFUN (arg, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} arg (@var{z})\n\ @deftypefnx {Mapping Function} {} angle (@var{z})\n\ Compute the argument of @var{z}, defined as,\n\ @tex\n\ $\\theta = atan2 (y, x),$\n\ @end tex\n\ @ifnottex\n\ @var{theta} = @code{atan2 (@var{y}, @var{x})},\n\ @end ifnottex\n\ in radians.\n\ \n\ For example,\n\ \n\ @example\n\ @group\n\ arg (3 + 4i)\n\ @result{} 0.92730\n\ @end group\n\ @end example\n\ @end deftypefn")
 DEFUN (asin, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} asin (@var{x})\n\ Compute the inverse sine in radians for each element of @var{x}.\n\ @seealso{sin, asind}\n\ @end deftypefn")
 DEFUN (asinh, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} asinh (@var{x})\n\ Compute the inverse hyperbolic sine for each element of @var{x}.\n\ @seealso{sinh}\n\ @end deftypefn")
 DEFUN (atan, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} atan (@var{x})\n\ Compute the inverse tangent in radians for each element of @var{x}.\n\ @seealso{tan, atand}\n\ @end deftypefn")
 DEFUN (atanh, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} atanh (@var{x})\n\ Compute the inverse hyperbolic tangent for each element of @var{x}.\n\ @seealso{tanh}\n\ @end deftypefn")
 DEFUN (ceil, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} ceil (@var{x})\n\ Return the smallest integer not less than @var{x}. This is equivalent to\n\ rounding towards positive infinity. If @var{x} is\n\ complex, return @code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}.\n\ @example\n\ @group\n\ ceil ([-2.7, 2.7])\n\ @result{} -2 3\n\ @end group\n\ @end example\n\ @seealso{floor, round, fix}\n\ @end deftypefn")
 DEFUN (conj, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} conj (@var{z})\n\ Return the complex conjugate of @var{z}, defined as\n\ @tex\n\ $\\bar{z} = x - iy$.\n\ @end tex\n\ @ifnottex\n\ @code{conj (@var{z})} = @var{x} - @var{i}@var{y}.\n\ @end ifnottex\n\ @seealso{real, imag}\n\ @end deftypefn")
 DEFUN (cos, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} cos (@var{x})\n\ Compute the cosine for each element of @var{x} in radians.\n\ @seealso{acos, cosd, cosh}\n\ @end deftypefn")
 DEFUN (cosh, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} cosh (@var{x})\n\ Compute the hyperbolic cosine for each element of @var{x}.\n\ @seealso{acosh, sinh, tanh}\n\ @end deftypefn")
 DEFUN (erf, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erf (@var{z})\n\ Computes the error function,\n\ @iftex\n\ @tex\n\ $$\n\ {\\rm erf} (z) = {2 \\over \\sqrt{\\pi}}\\int_0^z e^{-t^2} dt\n\ $$\n\ @end tex\n\ @end iftex\n\ @ifnottex\n\ \n\ @example\n\ @group\n\ z\n\ /\n\ erf (z) = (2/sqrt (pi)) | e^(-t^2) dt\n\ /\n\ t=0\n\ @end group\n\ @end example\n\ @end ifnottex\n\ @seealso{erfc, erfinv}\n\ @end deftypefn")
 DEFUN (erfc, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfc (@var{z})\n\ Computes the complementary error function,\n\ @iftex\n\ @tex\n\ $1 - {\\rm erf} (z)$.\n\ @end tex\n\ @end iftex\n\ @ifnottex\n\ @code{1 - erf (@var{z})}.\n\ @end ifnottex\n\ @seealso{erf, erfinv}\n\ @end deftypefn")
 DEFUN (exp, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} exp (@var{x})\n\ Compute\n\ @tex\n\ $e^{x}$\n\ @end tex\n\ @ifnottex\n\ @code{e^x}\n\ @end ifnottex\n\ for each element of @var{x}. To compute the matrix\n\ exponential, see @ref{Linear Algebra}.\n\ @seealso{log}\n\ @end deftypefn")
 DEFUN (expm1, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} expm1 (@var{x})\n\ Compute\n\ @tex\n\ $ e^{x} - 1 $\n\ @end tex\n\ @ifnottex\n\ @code{exp (@var{x}) - 1}\n\ @end ifnottex\n\ accurately in the neighborhood of zero.\n\ @seealso{exp}\n\ @end deftypefn")
 DEFUN (finite, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} finite (@var{x})\n\ Return 1 for elements of @var{x} that are finite values and zero\n\ otherwise. For example,\n\ \n\ @example\n\ @group\n\ finite ([13, Inf, NA, NaN])\n\ @result{} [ 1, 0, 0, 0 ]\n\ @end group\n\ @end example\n\ @end deftypefn")
 DEFUN (fix, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} fix (@var{x})\n\ Truncate fractional portion of @var{x} and return the integer portion. This\n\ is equivalent to rounding towards zero. If @var{x} is complex, return\n\ @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}.\n\ @example\n\ @group\n\ fix ([-2.7, 2.7])\n\ @result{} -2 2\n\ @end group\n\ @end example\n\ @seealso{ceil, floor, round}\n\ @end deftypefn")
 DEFUN (floor, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} floor (@var{x})\n\ Return the largest integer not greater than @var{x}. This is equivalent to\n\ rounding towards negative infinity. If @var{x} is\n\ complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}.\n\ @example\n\ @group\n\ floor ([-2.7, 2.7])\n\ @result{} -3 2\n\ @end group\n\ @end example\n\ @seealso{ceil, round, fix}\n\ @end deftypefn")
 DEFUN (gamma, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} gamma (@var{z})\n\ Computes the Gamma function,\n\ @iftex\n\ @tex\n\ $$\n\ \\Gamma (z) = \\int_0^\\infty t^{z-1} e^{-t} dt.\n\ $$\n\ @end tex\n\ @end iftex\n\ @ifnottex\n\ \n\ @example\n\ @group\n\ infinity\n\ /\n\ gamma (z) = | t^(z-1) exp (-t) dt.\n\ /\n\ t=0\n\ @end group\n\ @end example\n\ @end ifnottex\n\ @seealso{gammainc, lgamma}\n\ @end deftypefn")
 DEFUN (imag, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} imag (@var{z})\n\ Return the imaginary part of @var{z} as a real number.\n\ @seealso{real, conj}\n\ @end deftypefn")
 DEFUNX ("isalnum", Fisalnum, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isalnum (@var{s})\n\ Return 1 for characters that are letters or digits (@code{isalpha\n\ (@var{s})} or @code{isdigit (@var{s})} is true).\n\ @end deftypefn")
 DEFUNX ("isalpha", Fisalpha, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isalpha (@var{s})\n\ @deftypefnx {Mapping Function} {} isletter (@var{s})\n\ Return true for characters that are letters (@code{isupper (@var{s})}\n\ or @code{islower (@var{s})} is true).\n\ @end deftypefn")
 DEFUNX ("isascii", Fisascii, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isascii (@var{s})\n\ Return 1 for characters that are ASCII (in the range 0 to 127 decimal).\n\ @end deftypefn")
 DEFUNX ("iscntrl", Fiscntrl, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} iscntrl (@var{s})\n\ Return 1 for control characters.\n\ @end deftypefn")
 DEFUNX ("isdigit", Fisdigit, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isdigit (@var{s})\n\ Return 1 for characters that are decimal digits.\n\ @end deftypefn")
 DEFUN (isinf, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isinf (@var{x})\n\ Return 1 for elements of @var{x} that are infinite and zero\n\ otherwise. For example,\n\ \n\ @example\n\ @group\n\ isinf ([13, Inf, NA, NaN])\n\ @result{} [ 0, 1, 0, 0 ]\n\ @end group\n\ @end example\n\ @end deftypefn")
 DEFUNX ("isgraph", Fisgraph, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isgraph (@var{s})\n\ Return 1 for printable characters (but not the space character).\n\ @end deftypefn")
 DEFUNX ("islower", Fislower, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} islower (@var{s})\n\ Return 1 for characters that are lower case letters.\n\ @end deftypefn")
 DEFUN (isna, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isna (@var{x})\n\ Return 1 for elements of @var{x} that are NA (missing) values and zero\n\ otherwise. For example,\n\ \n\ @example\n\ @group\n\ isna ([13, Inf, NA, NaN])\n\ @result{} [ 0, 0, 1, 0 ]\n\ @end group\n\ @end example\n\ @seealso{isnan}\n\ @end deftypefn")
 DEFUN (isnan, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isnan (@var{x})\n\ Return 1 for elements of @var{x} that are NaN values and zero\n\ otherwise. NA values are also considered NaN values. For example,\n\ \n\ @example\n\ @group\n\ isnan ([13, Inf, NA, NaN])\n\ @result{} [ 0, 0, 1, 1 ]\n\ @end group\n\ @end example\n\ @seealso{isna}\n\ @end deftypefn")
 DEFUNX ("isprint", Fisprint, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isprint (@var{s})\n\ Return 1 for printable characters (including the space character).\n\ @end deftypefn")
 DEFUNX ("ispunct", Fispunct, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} ispunct (@var{s})\n\ Return 1 for punctuation characters.\n\ @end deftypefn")
 DEFUNX ("isspace", Fisspace, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isspace (@var{s})\n\ Return 1 for whitespace characters (space, formfeed, newline,\n\ carriage return, tab, and vertical tab).\n\ @end deftypefn")
 DEFUNX ("isupper", Fisupper, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isupper (@var{s})\n\ Return 1 for upper case letters.\n\ @end deftypefn")
 DEFUNX ("isxdigit", Fisxdigit, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isxdigit (@var{s})\n\ Return 1 for characters that are hexadecimal digits.\n\ @end deftypefn")
 DEFUN (lgamma, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} lgamma (@var{x})\n\ @deftypefnx {Mapping Function} {} gammaln (@var{x})\n\ Return the natural logarithm of the gamma function of @var{x}.\n\ @seealso{gamma, gammainc}\n\ @end deftypefn")
 DEFUN (log, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} log (@var{x})\n\ Compute the natural logarithm,\n\ @tex\n\ $\\ln{(x)},$\n\ @end tex\n\ @ifnottex\n\ @code{ln (@var{x})},\n\ @end ifnottex\n\ for each element of @var{x}. To compute the\n\ matrix logarithm, see @ref{Linear Algebra}.\n\ @seealso{exp, log1p, log2, log10, logspace}\n\ @end deftypefn")
 DEFUN (log10, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} log10 (@var{x})\n\ Compute the base-10 logarithm of each element of @var{x}.\n\ @seealso{log, log2, logspace, exp}\n\ @end deftypefn")
 DEFUN (log1p, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} log1p (@var{x})\n\ Compute\n\ @tex\n\ $\\ln{(1 + x)}$\n\ @end tex\n\ @ifnottex\n\ @code{log (1 + @var{x})}\n\ @end ifnottex\n\ accurately in the neighborhood of zero.\n\ @seealso{log, exp, expm1}\n\ @end deftypefn")
 DEFUN (real, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} real (@var{z})\n\ Return the real part of @var{z}.\n\ @seealso{imag, conj}\n\ @end deftypefn")
 DEFUN (round, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} round (@var{x})\n\ Return the integer nearest to @var{x}. If @var{x} is complex, return\n\ @code{round (real (@var{x})) + round (imag (@var{x})) * I}.\n\ @example\n\ @group\n\ round ([-2.7, 2.7])\n\ @result{} -3 3\n\ @end group\n\ @end example\n\ @seealso{ceil, floor, fix}\n\ @end deftypefn")
 DEFUN (roundb, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} roundb (@var{x})\n\ Return the integer nearest to @var{x}. If there are two nearest\n\ integers, return the even one (banker's rounding). If @var{x} is complex,\n\ return @code{roundb (real (@var{x})) + roundb (imag (@var{x})) * I}.\n\ @seealso{round}\n\ @end deftypefn")
 DEFUN (sign, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sign (@var{x})\n\ Compute the @dfn{signum} function, which is defined as\n\ @tex\n\ $$\n\ {\\rm sign} (@var{x}) = \\cases{1,&$x>0$;\\cr 0,&$x=0$;\\cr -1,&$x<0$.\\cr}\n\ $$\n\ @end tex\n\ @ifnottex\n\ \n\ @example\n\ @group\n\ -1, x < 0;\n\ sign (x) = 0, x = 0;\n\ 1, x > 0.\n\ @end group\n\ @end example\n\ @end ifnottex\n\ \n\ For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}.\n\ @end deftypefn")
 DEFUN (sin, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sin (@var{x})\n\ Compute the sine for each element of @var{x} in radians.\n\ @seealso{asin, sind, sinh}\n\ @end deftypefn")
 DEFUN (sinh, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sinh (@var{x})\n\ Compute the hyperbolic sine for each element of @var{x}.\n\ @seealso{asinh, cosh, tanh}\n\ @end deftypefn")
 DEFUN (sqrt, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sqrt (@var{x})\n\ Compute the square root of each element of @var{x}. If @var{x} is negative,\n\ a complex result is returned. To compute the matrix square root, see\n\ @ref{Linear Algebra}.\n\ @seealso{realsqrt}\n\ @end deftypefn")
 DEFUN (tan, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} tan (@var{z})\n\ Compute the tangent for each element of @var{x} in radians.\n\ @seealso{atan, tand, tanh}\n\ @end deftypefn")
 DEFUN (tanh, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} tanh (@var{x})\n\ Compute hyperbolic tangent for each element of @var{x}.\n\ @seealso{atanh, sinh, cosh}\n\ @end deftypefn")
 DEFUNX ("toascii", Ftoascii, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} toascii (@var{s})\n\ Return ASCII representation of @var{s} in a matrix. For example,\n\ \n\ @example\n\ @group\n\ toascii (\"ASCII\")\n\ @result{} [ 65, 83, 67, 73, 73 ]\n\ @end group\n\ \n\ @end example\n\ @seealso{char}\n\ @end deftypefn")
 DEFUNX ("tolower", Ftolower, args,,"-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} tolower (@var{s})\n\ @deftypefnx {Mapping Function} {} lower (@var{s})\n\ Return a copy of the string or cell string @var{s}, with each upper-case\n\ character replaced by the corresponding lower-case one; non-alphabetic\n\ characters are left unchanged. For example,\n\ \n\ @example\n\ @group\n\ tolower (\"MiXeD cAsE 123\")\n\ @result{} \"mixed case 123\"\n\ @end group\n\ @end example\n\ @seealso{toupper}\n\ @end deftypefn")
 DEFALIAS (lower, tolower)
 DEFUNX ("toupper", Ftoupper, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} toupper (@var{s})\n\ @deftypefnx {Built-in Function} {} upper (@var{s})\n\ Return a copy of the string or cell string @var{s}, with each lower-case\n\ character replaced by the corresponding upper-case one; non-alphabetic\n\ characters are left unchanged. For example,\n\ \n\ @example\n\ @group\n\ toupper (\"MiXeD cAsE 123\")\n\ @result{} \"MIXED CASE 123\"\n\ @end group\n\ @end example\n\ @seealso{tolower}\n\ @end deftypefn")
 DEFALIAS (upper, toupper)
 DEFALIAS (gammaln, lgamma)
 DEFALIAS (isfinite, finite)

Function Documentation

DEFALIAS ( isfinite  ,
finite   
)

DEFALIAS ( gammaln  ,
lgamma   
)

DEFALIAS ( upper  ,
toupper   
)

DEFALIAS ( lower  ,
tolower   
)

DEFUN ( tanh  ,
args   
)

DEFUN ( tan  ,
args   
)

DEFUN ( sqrt  ,
args   
)

DEFUN ( sinh  ,
args   
)

DEFUN ( sin  ,
args   
)

DEFUN ( sign  ,
args   
)

DEFUN ( roundb  ,
args   
)

DEFUN ( round  ,
args   
)

DEFUN ( real  ,
args   
)

DEFUN ( log1p  ,
args   
)

DEFUN ( log10  ,
args   
)

DEFUN ( log  ,
args   
)

DEFUN ( lgamma  ,
args   
)

DEFUN ( isnan  ,
args   
)

DEFUN ( isna  ,
args   
)

DEFUN ( isinf  ,
args   
)

DEFUN ( imag  ,
args   
)

DEFUN ( gamma  ,
args   
)

DEFUN ( floor  ,
args   
)

DEFUN ( fix  ,
args   
)

DEFUN ( finite  ,
args   
)

DEFUN ( expm1  ,
args   
)

DEFUN ( exp  ,
args   
)

DEFUN ( erfc  ,
args   
)

DEFUN ( erf  ,
args   
)

DEFUN ( cosh  ,
args   
)

DEFUN ( cos  ,
args   
)

DEFUN ( conj  ,
args   
)

DEFUN ( ceil  ,
args   
)

DEFUN ( atanh  ,
args   
)

DEFUN ( atan  ,
args   
)

DEFUN ( asinh  ,
args   
)

DEFUN ( asin  ,
args   
)

DEFUN ( arg  ,
args   
)

DEFUN ( angle  ,
args   
)

DEFUN ( acosh  ,
args   
)

DEFUN ( acos  ,
args   
)

DEFUN ( abs  ,
args   
)

DEFUNX ( "toupper"  ,
Ftoupper  ,
args   
)

DEFUNX ( "tolower"  ,
Ftolower  ,
args   
)

DEFUNX ( "toascii"  ,
Ftoascii  ,
args   
)

DEFUNX ( "isxdigit"  ,
Fisxdigit  ,
args   
)

DEFUNX ( "isupper"  ,
Fisupper  ,
args   
)

DEFUNX ( "isspace"  ,
Fisspace  ,
args   
)

DEFUNX ( "ispunct"  ,
Fispunct  ,
args   
)

DEFUNX ( "isprint"  ,
Fisprint  ,
args   
)

DEFUNX ( "islower"  ,
Fislower  ,
args   
)

DEFUNX ( "isgraph"  ,
Fisgraph  ,
args   
)

DEFUNX ( "isdigit"  ,
Fisdigit  ,
args   
)

DEFUNX ( "iscntrl"  ,
Fiscntrl  ,
args   
)

DEFUNX ( "isascii"  ,
Fisascii  ,
args   
)

DEFUNX ( "isalpha"  ,
Fisalpha  ,
args   
)

DEFUNX ( "isalnum"  ,
Fisalnum  ,
args   
)