From a24e86e3e941804ca6b9a70cff5c6ae5f02e6daf Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 6 Oct 2021 22:43:41 -0700 Subject: [PATCH] work on docs --- doc/matrices.texi | 281 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 268 insertions(+), 13 deletions(-) diff --git a/doc/matrices.texi b/doc/matrices.texi index af3d508dfa..1fce72b7da 100644 --- a/doc/matrices.texi +++ b/doc/matrices.texi @@ -739,33 +739,46 @@ The matrix language does not support missing values. Many matrix commands use expressions. A matrix expression may use the following operators, listed in descending order of operator -precedence: +precedence. Within a single level, operators associate from left to +right. @itemize @bullet -@item @t{(@dots{})} @t{@{@dots{}@}} +@item +Function call @t{()} and matrix construction @t{@{@}} -@item @t{(}@i{index}[@t{,} @i{index}]@t{)} +@item +Indexing @t{()} -@item @t{+ -} +@item +Unary @t{+} and @t{-} -@item @t{:} +@item +Integer sequence @t{:} -@item @t{** &**} +@item +Exponentiation @t{**} and @t{&**} -@item @t{* / &* &/} +@item +Multiplication @t{*} and @t{&*}, and division @t{/} and @t{&/} -@item @t{+ -} +@item +Addition @t{+} and subtraction @t{-} -@item @t{< <= = >= > <>} +@item +Relational @t{< <= = >= > <>} -@item @t{NOT} +@item +Logical @t{NOT} -@item @t{AND} +@item +Logical @t{AND} -@item @t{OR XOR} +@item +Logical @t{OR} and @t{XOR} @end itemize -Each of these operators is described in more detail below. +@xref{Matrix Functions}, for the available matrix functions. The +remaining operators are described in more detail below. @node Matrix Construction Operator @subsubsection Matrix Construction Operator @t{@{@}} @@ -1037,6 +1050,18 @@ True if exactly one operand is true. @end table @end itemize +Examples: + +@multitable @columnfractions .4 .05 .4 +@item @t{1 + 2} @tab @result{} @tab @t{3} +@item @t{1 + @{3; 4@}} @tab @result{} @tab @t{@{4; 5@}} +@item @t{@{66, 77; 88, 99@} + 5} @tab @result{} @tab @t{@{71, 82; 93, 104@}} +@item @t{@{4, 8; 3, 7@} + @{1, 0; 5, 2@}} @tab @result{} @tab @t{@{5, 8; 8, 9@}} +@item @t{@{1, 2; 3, 4@} < @{4, 3; 2, 1@}} @tab @result{} @tab @t{@{1, 1; 0, 0@}} +@item @t{@{1, 3; 2, 4@} >= 3} @tab @result{} @tab @t{@{0, 1; 0, 1@}} +@item @t{@{0, 0; 1, 1@} AND @{0, 1; 0, 1@}} @tab @result{} @tab @t{@{0, 0; 0, 1@}} +@end multitable + @node Matrix Multiplication Operator @subsubsection Matrix Multiplication Operator @samp{*} @@ -1081,3 +1106,233 @@ For @code{B = 0}, @code{A**B} is the identity matrix. @noindent @pspp{} reports an error if @code{A} is not square or @code{B} is not an integer. + +Examples: + +@multitable @columnfractions .4 .05 .4 +@item @t{@{2, 5; 1, 4@}**3} @tab @result{} @tab @t{@{48, 165; 33, 114@}} +@item @t{@{2, 5; 1, 4@}**0} @tab @result{} @tab @t{@{1, 0; 0, 1@}} +@item @t{10*@{4, 7; 2, 6@}**-1} @tab @result{} @tab @t{@{6, -7; -2, 4@}} +@end multitable + +@node Matrix Functions +@subsection Matrix Functions + +The matrix language support numerous functions in multiple categories. +The following subsections document each of the currently supported +functions. In the descriptions, function arguments that must be +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 + +@deftypefn {Matrix Function} {} ABS (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} ALL (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} ANY (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} ARSIN (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} ARTAN (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} COS (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} EXP (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} LG10 (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} LN (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} MOD (@var{m}, @var{s}) +@end deftypefn + +@deftypefn {Matrix Function} {} RND (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} SIN (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} SQRT (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} TRUNC (@var{m}) +@end deftypefn + + +@node Matrix Construction Functions +@subsection Matrix Construction Functions + +@deftypefn {Matrix Function} {} BLOCK (@var{m1}, @var{m2}, @dots{}) +@end deftypefn + +@deftypefn {Matrix Function} {} IDENT (@var{s}) +@deftypefnx {Matrix Function} {} IDENT (@var{sr}, @var{sc}) +@end deftypefn + + +@deftypefn {Matrix Function} {} MAGIC (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} MAKE (@var{sr}, @var{sc}, @var{sv}) +@end deftypefn + + +@deftypefn {Matrix Function} {} MDIAG (@var{v}) +@end deftypefn + +@deftypefn {Matrix Function} {} RESHAPE (@var{m}, @var{sr}, @var{sc}) +@end deftypefn + +@deftypefn {Matrix Function} {} TRANSPOS (@var{m}) +@deftypefnx {Matrix Function} {} T (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} UNIFORM (@var{sr}, @var{sc}) +@end deftypefn + +@node Matrix Minimum and Maximum and Sum Functions +@subsection Minimum, Maximum, and Sum Functions + +@deftypefn {Matrix Function} {} CMAX (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} CMIN (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} CSSQ (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} CSUM (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} MMAX (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} MMIN (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} MSSQ (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} MSUM (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} RMAX (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} RMIN (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} RSSQ (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} RSUM (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} SSCP (@var{m}) +@end deftypefn + +@node Matrix Property Functions +@subsection Matrix Property Functions + +@deftypefn {Matrix Function} {} DIAG (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} NCOL (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} NROW (@var{m}) +@end deftypefn + +@node Matrix Rank Ordering Functions +@subsection Matrix Rank Ordering Functions + +@deftypefn {Matrix Function} {} GRADE (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} RNKORDER (@var{m}) +@end deftypefn + + +@node Matrix Algebra Functions +@subsection Matrix Algebra Functions + +@deftypefn {Matrix Function} {} CHOL (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} DESIGN (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} DET (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} EVAL (@var{m}) +@end deftypefn + +@deftypefn {Matrix Function} {} GINV (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} GSCH (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} INV (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} KRONEKER (@var{m1}, @var{m2}) +@end deftypefn + + + +@deftypefn {Matrix Function} {} RANK (@var{m}) +@end deftypefn + + + + +@deftypefn {Matrix Function} {} SOLVE (@var{ma}, @var{mb}) +@end deftypefn + + +@deftypefn {Matrix Function} {} SVAL (@var{m}) +@end deftypefn + + +@deftypefn {Matrix Function} {} SWEEP (@var{m}, @var{s}) +@end deftypefn + + +@deftypefn {Matrix Function} {} TRACE (@var{m}) +@end deftypefn + + +@node Matrix IO +@subsection I/O + +@deftypefn {Matrix Function} {} EOF (@var{file}) +@end deftypefn -- 2.30.2