Mercurial > octave
changeset 24197:63fc7a75a3d7 stable
doc: Update docstring for pinv and inv.
* inv.cc (Finv): Add seealso reference to pinv.
* pinv.cc (Fpinv): Specify that Moore-Penrose pseudoinverse is calculated.
Clarify calculation of default tolerance. Add seealso links to inv, ldivide.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 03 Nov 2017 14:24:14 -0700 |
parents | 379efee40924 |
children | 11cdca79d316 140f1403d603 |
files | libinterp/corefcn/inv.cc libinterp/corefcn/pinv.cc |
diffstat | 2 files changed, 4 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/inv.cc Sat Oct 28 18:03:18 2017 -0700 +++ b/libinterp/corefcn/inv.cc Fri Nov 03 14:24:14 2017 -0700 @@ -54,7 +54,7 @@ If called with a sparse matrix, then in general @var{x} will be a full matrix requiring significantly more storage. Avoid forming the inverse of a sparse matrix if possible. -@seealso{ldivide, rdivide} +@seealso{ldivide, rdivide, pinv} @end deftypefn */) { if (args.length () != 1)
--- a/libinterp/corefcn/pinv.cc Sat Oct 28 18:03:18 2017 -0700 +++ b/libinterp/corefcn/pinv.cc Fri Nov 03 14:24:14 2017 -0700 @@ -39,18 +39,17 @@ doc: /* -*- texinfo -*- @deftypefn {} {} pinv (@var{x}) @deftypefnx {} {} pinv (@var{x}, @var{tol}) -Return the pseudoinverse of @var{x}. +Return the Moore-Penrose pseudoinverse of @var{x}. Singular values less than @var{tol} are ignored. If the second argument is omitted, it is taken to be @example -tol = max (size (@var{x})) * sigma_max (@var{x}) * eps, +tol = max ([rows(@var{x}), columns(@var{x})]) * norm (@var{x}) * eps @end example -@noindent -where @code{sigma_max (@var{x})} is the maximal singular value of @var{x}. +@seealso(inv, ldivide) @end deftypefn */) { int nargin = args.length ();