function documentation
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 7 Oct 2021 21:11:23 +0000 (14:11 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 7 Oct 2021 21:11:23 +0000 (14:11 -0700)
doc/matrices.texi

index 1fce72b7dafa4a1102b02b523af1c787fab86afb..d0e3b7be55ae4b8d61d96e1fd5936ffa5e8eac14 100644 (file)
@@ -1125,58 +1125,76 @@ scalars are given names beginning with @var{s}, those that must be
 vectors are given names beginning with @var{v}, and general matrix
 arguments are given names beginning with @var{m}.
 
-@node Elementwise Matrix Functions
-@subsubsection Elementwise Matrix Functions
+@node Matrix Elementwise Functions
+@subsubsection Elementwise Functions
 
-@deftypefn {Matrix Function} {} ABS (@var{m})
-@end deftypefn
+These functions act on each element of their argument independently,
+like the elementwise operators (@pxref{Matrix Elementwise Binary
+Operators}).
 
-@deftypefn {Matrix Function} {} ALL (@var{m})
-@end deftypefn
+@deftypefn {Matrix Function} {} ABS (@var{m})
+Takes the absolute value of each element of @var{m}.
 
-@deftypefn {Matrix Function} {} ANY (@var{m})
+@t{ABS(@{-1, 2; -3, 0@}) @result{} @{1, 2; 3, 0@}}
 @end deftypefn
 
 @deftypefn {Matrix Function} {} ARSIN (@var{m})
-@end deftypefn
-
-@deftypefn {Matrix Function} {} ARTAN (@var{m})
+@deftypefnx {Matrix Function} {} ARTAN (@var{m})
+Computes the inverse sine or tangent, respectively, of each element in
+@var{m}.  The results are in radians, between @math{-\pi/2} and
+@math{+\pi/2}, inclusive.
 @end deftypefn
 
 @deftypefn {Matrix Function} {} COS (@var{m})
+@deftypefnx {Matrix Function} {} SIN (@var{m})
+Computes the cosine or sine, respectively, of each element in @var{m},
+which must be in radians.
 @end deftypefn
 
 @deftypefn {Matrix Function} {} EXP (@var{m})
+Computes @math{e^x} for each element @var{x} in @var{m}.
 @end deftypefn
 
 @deftypefn {Matrix Function} {} LG10 (@var{m})
-@end deftypefn
-
-
-@deftypefn {Matrix Function} {} LN (@var{m})
+@deftypefnx {Matrix Function} {} LN (@var{m})
+Takes the logarithm with base 10 or base @math{e}, respectively, of
+each element in @var{m}.
 @end deftypefn
 
 @deftypefn {Matrix Function} {} MOD (@var{m}, @var{s})
+Takes each element in @var{m} modulo nonzero scalar value @var{s},
+that is, the remainder of division by @var{s}.  The sign of the result
+is the same as the sign of the dividend.
 @end deftypefn
 
 @deftypefn {Matrix Function} {} RND (@var{m})
+@deftypefnx {Matrix Function} {} TRUNC (@var{m})
+Rounds each element of @var{m} to an integer.  @code{RND} rounds to
+the nearest integer, with halves rounded to even integers, and
+@code{TRUNC} rounds toward zero.
 @end deftypefn
 
-
-@deftypefn {Matrix Function} {} SIN (@var{m})
-@end deftypefn
-
-
 @deftypefn {Matrix Function} {} SQRT (@var{m})
+Takes the square root of each element of @var{m}, which must not be
+negative.
 @end deftypefn
 
 
-@deftypefn {Matrix Function} {} TRUNC (@var{m})
+@node Matrix Logical Functions
+@subsubsection Logical Functions
+
+@deftypefn {Matrix Function} {} ALL (@var{m})
+Returns a scalar with value 1 if all of the elements in @var{m} are
+nonzero, or 0 if at least one element is zero.
 @end deftypefn
 
+@deftypefn {Matrix Function} {} ANY (@var{m})
+Returns a scalar with value 1 if any of the elements in @var{m} is
+nonzero, or 0 if all of them are zero.
+@end deftypefn
 
 @node Matrix Construction Functions
-@subsection Matrix Construction Functions
+@subsubsection Matrix Construction Functions
 
 @deftypefn {Matrix Function} {} BLOCK (@var{m1}, @var{m2}, @dots{})
 @end deftypefn
@@ -1208,7 +1226,7 @@ arguments are given names beginning with @var{m}.
 @end deftypefn
 
 @node Matrix Minimum and Maximum and Sum Functions
-@subsection Minimum, Maximum, and Sum Functions
+@subsubsection Minimum, Maximum, and Sum Functions
 
 @deftypefn {Matrix Function} {} CMAX (@var{m})
 @end deftypefn
@@ -1256,7 +1274,7 @@ arguments are given names beginning with @var{m}.
 @end deftypefn
 
 @node Matrix Property Functions
-@subsection Matrix Property Functions
+@subsubsection Matrix Property Functions
 
 @deftypefn {Matrix Function} {} DIAG (@var{m})
 @end deftypefn
@@ -1268,7 +1286,7 @@ arguments are given names beginning with @var{m}.
 @end deftypefn
 
 @node Matrix Rank Ordering Functions
-@subsection Matrix Rank Ordering Functions
+@subsubsection Matrix Rank Ordering Functions
 
 @deftypefn {Matrix Function} {} GRADE (@var{m})
 @end deftypefn
@@ -1278,7 +1296,7 @@ arguments are given names beginning with @var{m}.
 
 
 @node Matrix Algebra Functions
-@subsection Matrix Algebra Functions
+@subsubsection Matrix Algebra Functions
 
 @deftypefn {Matrix Function} {} CHOL (@var{m})
 @end deftypefn
@@ -1332,7 +1350,7 @@ arguments are given names beginning with @var{m}.
 
 
 @node Matrix IO
-@subsection I/O
+@subsubsection I/O
 
 @deftypefn {Matrix Function} {} EOF (@var{file})
 @end deftypefn