Mercurial > hg > octave-jordi
diff libinterp/corefcn/mappers.cc @ 20171:4f45eaf83908 stable
doc: Update more docstrings to have one sentence summary as first line.
Reviewed libinterp/corefcn directory.
* libinterp/corefcn/__ilu__.cc, libinterp/corefcn/balance.cc,
libinterp/corefcn/besselj.cc, libinterp/corefcn/betainc.cc,
libinterp/corefcn/bitfcns.cc, libinterp/corefcn/bsxfun.cc,
libinterp/corefcn/cellfun.cc, libinterp/corefcn/colloc.cc,
libinterp/corefcn/conv2.cc, libinterp/corefcn/data.cc,
libinterp/corefcn/debug.cc, libinterp/corefcn/defaults.cc,
libinterp/corefcn/det.cc, libinterp/corefcn/dirfns.cc,
libinterp/corefcn/dlmread.cc, libinterp/corefcn/dot.cc,
libinterp/corefcn/eig.cc, libinterp/corefcn/error.cc,
libinterp/corefcn/fft2.cc, libinterp/corefcn/fftn.cc,
libinterp/corefcn/file-io.cc, libinterp/corefcn/filter.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gammainc.cc,
libinterp/corefcn/gcd.cc, libinterp/corefcn/getgrent.cc,
libinterp/corefcn/getpwent.cc, libinterp/corefcn/getrusage.cc,
libinterp/corefcn/graphics.cc, libinterp/corefcn/help.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/inv.cc, libinterp/corefcn/kron.cc,
libinterp/corefcn/load-path.cc, libinterp/corefcn/load-save.cc,
libinterp/corefcn/lookup.cc, libinterp/corefcn/ls-oct-ascii.cc,
libinterp/corefcn/lsode.cc, libinterp/corefcn/lu.cc,
libinterp/corefcn/luinc.cc, libinterp/corefcn/mappers.cc,
libinterp/corefcn/matrix_type.cc, libinterp/corefcn/max.cc,
libinterp/corefcn/md5sum.cc, libinterp/corefcn/mgorth.cc,
libinterp/corefcn/nproc.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/ordschur.cc, libinterp/corefcn/pager.cc,
libinterp/corefcn/pinv.cc, libinterp/corefcn/pr-output.cc,
libinterp/corefcn/pt-jit.cc, libinterp/corefcn/quad.cc,
libinterp/corefcn/quadcc.cc, libinterp/corefcn/qz.cc,
libinterp/corefcn/rand.cc, libinterp/corefcn/rcond.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/schur.cc,
libinterp/corefcn/sighandlers.cc, libinterp/corefcn/sparse.cc,
libinterp/corefcn/spparms.cc, libinterp/corefcn/str2double.cc,
libinterp/corefcn/strfind.cc, libinterp/corefcn/strfns.cc,
libinterp/corefcn/sub2ind.cc, libinterp/corefcn/svd.cc,
libinterp/corefcn/symtab.cc, libinterp/corefcn/syscalls.cc,
libinterp/corefcn/sysdep.cc, libinterp/corefcn/time.cc,
libinterp/corefcn/toplev.cc, libinterp/corefcn/tril.cc,
libinterp/corefcn/tsearch.cc, libinterp/corefcn/typecast.cc,
libinterp/corefcn/urlwrite.cc, libinterp/corefcn/utils.cc,
libinterp/corefcn/variables.cc, scripts/polynomial/spline.m:
Update more docstrings to have one sentence summary as first line.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 09 May 2015 17:19:30 -0700 |
parents | 554aaaf99644 |
children | 4e7f12a763cd |
line wrap: on
line diff
--- a/libinterp/corefcn/mappers.cc +++ b/libinterp/corefcn/mappers.cc @@ -39,7 +39,9 @@ DEFUN (abs, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} abs (@var{z})\n\ -Compute the magnitude of @var{z}, defined as\n\ +Compute the magnitude of @var{z}.\n\ +\n\ +The magnitude is defined as\n\ @tex\n\ $|z| = \\sqrt{x^2 + y^2}$.\n\ @end tex\n\ @@ -55,6 +57,7 @@ @result{} 5\n\ @end group\n\ @end example\n\ +@seealso{arg}\n\ @end deftypefn") { octave_value retval; @@ -157,7 +160,6 @@ %!test %! re = 2.99822295029797; %! im = pi/2; -%! assert (acosh (10i), re + i*im); %! assert (acosh (-10i), re - i*im); %!test @@ -178,7 +180,8 @@ DEFUN (angle, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} angle (@var{z})\n\ -See arg.\n\ +See @code{arg}.\n\ +@seealso{arg}\n\ @end deftypefn") { octave_value retval; @@ -194,7 +197,9 @@ "-*- 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\ +Compute the argument, i.e., angle of @var{z}.\n\ +\n\ +This is defined as,\n\ @tex\n\ $\\theta = atan2 (y, x),$\n\ @end tex\n\ @@ -211,6 +216,7 @@ @result{} 0.92730\n\ @end group\n\ @end example\n\ +@seealso{abs}\n\ @end deftypefn") { octave_value retval; @@ -394,6 +400,7 @@ "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} cbrt (@var{x})\n\ Compute the real cube root of each element of @var{x}.\n\ +\n\ Unlike @code{@var{x}^(1/3)}, the result will be negative if @var{x} is\n\ negative.\n\ @seealso{nthroot}\n\ @@ -425,9 +432,12 @@ 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\ +Return the smallest integer not less than @var{x}.\n\ +\n\ +This is equivalent to rounding towards positive infinity.\n\ +\n\ +If @var{x} is complex, return\n\ +@code{ceil (real (@var{x})) + ceil (imag (@var{x})) * I}.\n\ \n\ @example\n\ @group\n\ @@ -467,7 +477,9 @@ DEFUN (conj, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} conj (@var{z})\n\ -Return the complex conjugate of @var{z}, defined as\n\ +Return the complex conjugate of @var{z}.\n\ +\n\ +The complex conjugate is defined as\n\ @tex\n\ $\\bar{z} = x - iy$.\n\ @end tex\n\ @@ -574,7 +586,9 @@ DEFUN (erf, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erf (@var{z})\n\ -Compute the error function,\n\ +Compute the error function.\n\ +\n\ +The error function is defined as\n\ @tex\n\ $$\n\ {\\rm erf} (z) = {2 \\over \\sqrt{\\pi}}\\int_0^z e^{-t^2} dt\n\ @@ -644,7 +658,9 @@ DEFUN (erfinv, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfinv (@var{x})\n\ -Compute the inverse error function, i.e., @var{y} such that\n\ +Compute the inverse error function.\n\ +\n\ +The inverse error function is defined such that\n\ \n\ @example\n\ erf (@var{y}) == @var{x}\n\ @@ -682,7 +698,9 @@ DEFUN (erfcinv, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfcinv (@var{x})\n\ -Compute the inverse complementary error function, i.e., @var{y} such that\n\ +Compute the inverse complementary error function.\n\ +\n\ +The inverse complementary error function is defined such that\n\ \n\ @example\n\ erfc (@var{y}) == @var{x}\n\ @@ -720,7 +738,9 @@ DEFUN (erfc, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfc (@var{z})\n\ -Compute the complementary error function,\n\ +Compute the complementary error function.\n\ +\n\ +The complementary error function is defined as\n\ @tex\n\ $1 - {\\rm erf} (z)$.\n\ @end tex\n\ @@ -751,7 +771,9 @@ DEFUN (erfcx, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfcx (@var{z})\n\ -Compute the scaled complementary error function,\n\ +Compute the scaled complementary error function.\n\ +\n\ +The scaled complementary error function is defined as\n\ @tex\n\ $$\n\ e^{z^2} {\\rm erfc} (z) \\equiv e^{z^2} (1 - {\\rm erf} (z))\n\ @@ -794,10 +816,12 @@ DEFUN (erfi, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} erfi (@var{z})\n\ -Compute the imaginary error function,\n\ +Compute the imaginary error function.\n\ +\n\ +The imaginary error function is defined as\n\ @tex\n\ $$\n\ - -i {\\rm erf} (iz) \n\ + -i {\\rm erf} (iz)\n\ $$\n\ @end tex\n\ @ifnottex\n\ @@ -832,7 +856,9 @@ DEFUN (dawson, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} dawson (@var{z})\n\ -Compute the Dawson (scaled imaginary error) function,\n\ +Compute the Dawson (scaled imaginary error) function.\n\ +\n\ +The Dawson function is defined as\n\ @tex\n\ $$\n\ {\\sqrt{\\pi} \\over 2} e^{-z^2} {\\rm erfi} (z) \\equiv -i {\\sqrt{\\pi} \\over 2} e^{-z^2} {\\rm erf} (iz)\n\ @@ -879,8 +905,9 @@ @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\ +for each element of @var{x}.\n\ +\n\ +To compute the matrix exponential, see @ref{Linear Algebra}.\n\ @seealso{log}\n\ @end deftypefn") { @@ -981,8 +1008,9 @@ 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\ +Truncate fractional portion of @var{x} and return the integer portion.\n\ +\n\ +This is equivalent to rounding towards zero. If @var{x} is complex, return\n\ @code{fix (real (@var{x})) + fix (imag (@var{x})) * I}.\n\ \n\ @example\n\ @@ -1016,8 +1044,9 @@ 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\ +Return the largest integer not greater than @var{x}.\n\ +\n\ +This is equivalent to rounding towards negative infinity. If @var{x} is\n\ complex, return @code{floor (real (@var{x})) + floor (imag (@var{x})) * I}.\n\ \n\ @example\n\ @@ -1051,7 +1080,9 @@ DEFUN (gamma, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} gamma (@var{z})\n\ -Compute the Gamma function,\n\ +Compute the Gamma function.\n\ +\n\ +The Gamma function is defined as\n\ @tex\n\ $$\n\ \\Gamma (z) = \\int_0^\\infty t^{z-1} e^{-t} dt.\n\ @@ -1153,8 +1184,9 @@ "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isalnum (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ -letters or digits and false where they are not. This is equivalent to\n\ -(@code{isalpha (@var{s}) | isdigit (@var{s})}).\n\ +letters or digits and false where they are not.\n\ +\n\ +This is equivalent to (@code{isalpha (@var{s}) | isdigit (@var{s})}).\n\ @seealso{isalpha, isdigit, ispunct, isspace, iscntrl}\n\ @end deftypefn") { @@ -1184,8 +1216,9 @@ "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} isalpha (@var{s})\n\ Return a logical array which is true where the elements of @var{s} are\n\ -letters and false where they are not. This is equivalent to\n\ -(@code{islower (@var{s}) | isupper (@var{s})}).\n\ +letters and false where they are not.\n\ +\n\ +This is equivalent to (@code{islower (@var{s}) | isupper (@var{s})}).\n\ @seealso{isdigit, ispunct, isspace, iscntrl, isalnum, islower, isupper}\n\ @end deftypefn") { @@ -1299,6 +1332,7 @@ @deftypefn {Mapping Function} {} isinf (@var{x})\n\ Return a logical array which is true where the elements of @var{x} are\n\ are infinite and false where they are not.\n\ +\n\ For example:\n\ \n\ @example\n\ @@ -1398,6 +1432,7 @@ @deftypefn {Mapping Function} {} isna (@var{x})\n\ Return a logical array which is true where the elements of @var{x} are\n\ NA (missing) values and false where they are not.\n\ +\n\ For example:\n\ \n\ @example\n\ @@ -1440,6 +1475,7 @@ @deftypefn {Mapping Function} {} isnan (@var{x})\n\ Return a logical array which is true where the elements of @var{x} are\n\ NaN values and false where they are not.\n\ +\n\ NA values are also considered NaN values. For example:\n\ \n\ @example\n\ @@ -1680,8 +1716,9 @@ @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\ +for each element of @var{x}.\n\ +\n\ +To compute the matrix logarithm, see @ref{Linear Algebra}.\n\ @seealso{exp, log1p, log2, log10, logspace}\n\ @end deftypefn") { @@ -1794,7 +1831,9 @@ 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\ +Return the integer nearest to @var{x}.\n\ +\n\ +If @var{x} is complex, return\n\ @code{round (real (@var{x})) + round (imag (@var{x})) * I}. If there\n\ are two nearest integers, return the one further away from zero.\n\ \n\ @@ -1841,7 +1880,9 @@ "-*- 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\ +integers, return the even one (banker's rounding).\n\ +\n\ +If @var{x} is complex,\n\ return @code{roundb (real (@var{x})) + roundb (imag (@var{x})) * I}.\n\ @seealso{round}\n\ @end deftypefn") @@ -1881,7 +1922,9 @@ DEFUN (sign, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} sign (@var{x})\n\ -Compute the @dfn{signum} function, which is defined as\n\ +Compute the @dfn{signum} function.\n\ +\n\ +This 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\ @@ -1901,8 +1944,7 @@ \n\ For complex arguments, @code{sign} returns @code{x ./ abs (@var{x})}.\n\ \n\ -Note that @code{sign (-0.0)} is 0.\n\ -Although IEEE 754 floating point\n\ +Note that @code{sign (-0.0)} is 0. Although IEEE 754 floating point\n\ allows zero to be signed, 0.0 and -0.0 compare equal. If you must test\n\ whether zero is signed, use the @code{signbit} function.\n\ @seealso{signbit}\n\ @@ -1935,10 +1977,12 @@ DEFUNX ("signbit", Fsignbit, args, , "-*- texinfo -*-\n\ @deftypefn {Mapping Function} {} signbit (@var{x})\n\ -Return logical true if the value of @var{x} has its sign bit set.\n\ -Otherwise return logical false. This behavior is consistent with the other\n\ -logical functions. See@ref{Logical Values}. The behavior differs from the\n\ -C language function which returns nonzero if the sign bit is set.\n\ +Return logical true if the value of @var{x} has its sign bit set and false\n\ +otherwise.\n\ +\n\ +This behavior is consistent with the other logical functions.\n\ +See @ref{Logical Values}. The behavior differs from the C language function\n\ +which returns nonzero if the sign bit is set.\n\ \n\ This is not the same as @code{x < 0.0}, because IEEE 754 floating point\n\ allows zero to be signed. The comparison @code{-0.0 < 0.0} is false,\n\ @@ -2042,9 +2086,11 @@ 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\ +Compute the square root of each element of @var{x}.\n\ +\n\ +If @var{x} is negative, a complex result is returned.\n\ +\n\ +To compute the matrix square root, see @ref{Linear Algebra}.\n\ @seealso{realsqrt, nthroot}\n\ @end deftypefn") { @@ -2141,7 +2187,9 @@ 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\ +Return ASCII representation of @var{s} in a matrix.\n\ +\n\ +For example:\n\ \n\ @example\n\ @group\n\ @@ -2180,7 +2228,9 @@ @deftypefnx {Mapping Function} {} lower (@var{s})\n\ Return a copy of the string or cell string @var{s}, with each uppercase\n\ character replaced by the corresponding lowercase one; non-alphabetic\n\ -characters are left unchanged. For example:\n\ +characters are left unchanged.\n\ +\n\ +For example:\n\ \n\ @example\n\ @group\n\ @@ -2240,7 +2290,9 @@ @deftypefnx {Mapping Function} {} upper (@var{s})\n\ Return a copy of the string or cell string @var{s}, with each lowercase\n\ character replaced by the corresponding uppercase one; non-alphabetic\n\ -characters are left unchanged. For example:\n\ +characters are left unchanged.\n\ +\n\ +For example:\n\ \n\ @example\n\ @group\n\