From: Ben Pfaff Date: Sat, 9 Oct 2021 23:10:21 +0000 (-0700) Subject: documentation X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9368f08bd0297dbe60b505e806ba4be5428e0782;p=pspp documentation --- diff --git a/doc/matrices.texi b/doc/matrices.texi index 113875a1f7..03448eea30 100644 --- a/doc/matrices.texi +++ b/doc/matrices.texi @@ -1397,15 +1397,18 @@ Returns the @math{@var{k}@times{}@var{n}} matrix @var{A} that is the @deffn {Matrix Function} GSCH (@var{M}) +@var{M} must be a @math{@var{n}@times{}@var{m}} matrix, @math{@var{m} +@geq{} @var{n}}, with rank @var{n}. Returns an +@math{@var{n}@times{}@var{n}} orthonormal basis for @var{M}, obtained +using the Gram-Schmidt process. @end deffn - @deffn {Matrix Function} INV (@var{M}) Returns the @math{@var{n}@times{}@var{n}} matrix @var{A} that is the inverse of @math{@var{n}@times{}@var{n}} matrix @var{M}, defined such that @math{@var{M}@times{}@var{A} = @var{A}@times{}@var{M} = I}, where @var{I} is the identity matrix. @var{M} must not be singular, that -is, @math{\det(@var{M}) \ne 0}. +is, @math{\det(@var{M}) @ne{} 0}. @end deffn @deffn {Matrix Function} KRONEKER (@var{Ma}, @var{Mb}) @@ -1426,16 +1429,41 @@ equivalently, by its rows. @end deffn @deffn {Matrix Function} SOLVE (@var{Ma}, @var{Mb}) - +@var{Ma} must be an @math{@var{n}@times{}@var{n}} matrix, with +@math{\det(@var{Ma}) @ne{} 0}, and @var{Mb} an +@math{@var{n}@times{}@var{k}} matrix. Returns an +@math{@var{n}@times{}@var{k}} matrix @var{X} such that @math{@var{Ma} +@times{} @var{X} = @var{Mb}}. @end deffn @deffn {Matrix Function} SVAL (@var{M}) +Given @math{@var{n}@times{}@var{k}} matrix @var{M}, returns a +@math{\min(@var{n},@var{k})}-element column vector containing the +singular values of @var{M} in descending order. @end deffn +@deffn {Matrix Function} SWEEP (@var{M}, @var{nk}) +Given @math{@var{r}@times{}@var{c}} matrix @var{M} and integer scalar +@math{k = @var{nk}} such that @math{1 @leq{} k @leq{} +\min(@var{r},@var{c})}, returns the @math{@var{r}@times{}@var{c}} +sweep matrix @var{A}. -@deffn {Matrix Function} SWEEP (@var{M}, @var{n}) -@end deffn +If @math{@var{M}_{kk} @ne{} 0}, then: + +@display +@math{@var{A}_{kk} = 1/@var{M}_{kk}}, +@math{@var{A}_{ik} = -@var{M}_{ik}/@var{M}_{kk} @r{for} i @ne{} k}, +@math{@var{A}_{kj} = @var{M}_{kj}/@var{M}_{kk} @r{for} j @ne{} k, @r{and}} +@math{@var{A}_{ij} = @var{M}_{ij} - (@var{M}_{ik} * @var{M}_{kj}) / @var{M}_{kk} @r{for} i @ne{} k @r{and} j @ne{} k}. +@end display + +If @math{@var{M}_{kk} = 0}, then: +@display +@math{@var{A}_{ik} = @var{A}_{ki} = 0 @r{and}} +@math{@var{A}_{ij} = @var{M}_{ij}, @r{for} i @ne{} k @r{and} j @ne{} k}. +@end display +@end deffn @node Matrix IO @subsubsection I/O diff --git a/doc/pspp.texi b/doc/pspp.texi index 26550b763e..204feada58 100644 --- a/doc/pspp.texi +++ b/doc/pspp.texi @@ -94,6 +94,9 @@ graphic user interface @macro times{} × @end macro +@macro ne{} +≠ +@end macro @end ifnottex @c A macro to indicate variable names used in examples. diff --git a/src/language/stats/matrix.c b/src/language/stats/matrix.c index 558841a9e0..be635f9bad 100644 --- a/src/language/stats/matrix.c +++ b/src/language/stats/matrix.c @@ -904,7 +904,7 @@ matrix_eval_GSCH (gsl_matrix *v) if (v->size2 < v->size1) { msg (SE, _("GSCH requires its argument to have at least as many columns " - "as rows, but it has dimensions (%zu,%zu)."), + "as rows, but it has dimensions %zu×%zu."), v->size1, v->size2); return NULL; } @@ -1442,8 +1442,8 @@ matrix_eval_SOLVE (gsl_matrix *m1, gsl_matrix *m2) if (m1->size1 != m2->size1) { msg (SE, _("SOLVE requires its arguments to have the same number of " - "rows, but the first argument has dimensions (%zu,%zu) and " - "the second (%zu,%zu)."), + "rows, but the first argument has dimensions %zu×%zu and " + "the second %zu×%zu."), m1->size1, m1->size2, m2->size1, m2->size2); return NULL;