# HG changeset patch # User Rik # Date 1509744254 25200 # Node ID 63fc7a75a3d71c94680df4037ad5394e46660862 # Parent 379efee40924167da938ce560e1b0169d4d3b32f 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. diff -r 379efee40924 -r 63fc7a75a3d7 libinterp/corefcn/inv.cc --- 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) diff -r 379efee40924 -r 63fc7a75a3d7 libinterp/corefcn/pinv.cc --- 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 ();