Mercurial > octave-nkf
comparison liboctave/array/fCDiagMatrix.h @ 18467:c5a101de2d88
Allow pinv to work on Diagonal Matrices with a tolerance (bug #41546).
* pinv.cc (Fpinv): Validate tolerance argument and pass it through to
pseudo_inverse().
CDiagMatrix.h, dDiagMatrix.h, fCDiagMatrix.h, fDiagMatrix.h: Redefine
prototype for pseudo_inverse to accept a single argument for tolerance.
* CDiagMatrix.cc (pseudo_inverse), dDiagMatrix.cc(pseudo_inverse),
fCDiagMatrix.cc(pseudo_inverse), fDiagMatrix.cc(pseudo_inverse):
Use std::abs(elem) to get magnitude of element and only invert if
value is greater than tolerance.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 15 Feb 2014 14:42:07 -0800 |
parents | ebb3ef964372 |
children | 4197fc428c7d |
comparison
equal
deleted
inserted
replaced
18466:a3611f3e80eb | 18467:c5a101de2d88 |
---|---|
120 FloatComplexColumnVector column (octave_idx_type i) const; | 120 FloatComplexColumnVector column (octave_idx_type i) const; |
121 FloatComplexColumnVector column (char *s) const; | 121 FloatComplexColumnVector column (char *s) const; |
122 | 122 |
123 FloatComplexDiagMatrix inverse (octave_idx_type& info) const; | 123 FloatComplexDiagMatrix inverse (octave_idx_type& info) const; |
124 FloatComplexDiagMatrix inverse (void) const; | 124 FloatComplexDiagMatrix inverse (void) const; |
125 FloatComplexDiagMatrix pseudo_inverse (void) const; | 125 FloatComplexDiagMatrix pseudo_inverse (float tol = 0.0f) const; |
126 | 126 |
127 bool all_elements_are_real (void) const; | 127 bool all_elements_are_real (void) const; |
128 | 128 |
129 // diagonal matrix by diagonal matrix -> diagonal matrix operations | 129 // diagonal matrix by diagonal matrix -> diagonal matrix operations |
130 | 130 |