comparison libinterp/corefcn/pinv.cc @ 24198:11cdca79d316

maint: Periodic merge of stable to default.
author Rik <rik@octave.org>
date Fri, 03 Nov 2017 14:24:39 -0700
parents d3dc76efb38b 63fc7a75a3d7
children 558de6a42ff7
comparison
equal deleted inserted replaced
24196:2b769c242188 24198:11cdca79d316
37 37
38 DEFUN (pinv, args, , 38 DEFUN (pinv, args, ,
39 doc: /* -*- texinfo -*- 39 doc: /* -*- texinfo -*-
40 @deftypefn {} {} pinv (@var{x}) 40 @deftypefn {} {} pinv (@var{x})
41 @deftypefnx {} {} pinv (@var{x}, @var{tol}) 41 @deftypefnx {} {} pinv (@var{x}, @var{tol})
42 Return the pseudoinverse of @var{x}. 42 Return the Moore-Penrose pseudoinverse of @var{x}.
43 43
44 Singular values less than @var{tol} are ignored. 44 Singular values less than @var{tol} are ignored.
45 45
46 If the second argument is omitted, it is taken to be 46 If the second argument is omitted, it is taken to be
47 47
48 @example 48 @example
49 tol = max (size (@var{x})) * sigma_max (@var{x}) * eps, 49 tol = max ([rows(@var{x}), columns(@var{x})]) * norm (@var{x}) * eps
50 @end example 50 @end example
51 51
52 @noindent 52 @seealso(inv, ldivide)
53 where @code{sigma_max (@var{x})} is the maximal singular value of @var{x}.
54 @end deftypefn */) 53 @end deftypefn */)
55 { 54 {
56 int nargin = args.length (); 55 int nargin = args.length ();
57 56
58 if (nargin < 1 || nargin > 2) 57 if (nargin < 1 || nargin > 2)