comparison liboctave/array/fMatrix.cc @ 22204:469c817eb256

svd: reduce code duplication with more use of template and macro. * liboctave/numeric/svd.cc, liboctave/numeric/svd.h: remove unused constructor with reference for int (info). This allows to move all of the constructor into a single template, so remove init(). Two new methods, gesvd and gesdd, are fully specialized but the main hunck of code are the long list of arguments. Scope type and drive enums to the svd class for clarity, and rename member names. Add a new member for the drive used. * libinterp/corefcn/svd.cc: fix typenames for the svd enums which are now scoped. * CMatrix.cc, dMatrix.cc, fCMatrix.cc, fMatrix.cc: fix typenames for the svd enums which are now scoped.
author Carnë Draug <carandraug@octave.org>
date Thu, 04 Aug 2016 20:20:27 +0100
parents e43d83253e28
children 77c4d43e06d1
comparison
equal deleted inserted replaced
22203:2f301a30aeed 22204:469c817eb256
828 } 828 }
829 829
830 FloatMatrix 830 FloatMatrix
831 FloatMatrix::pseudo_inverse (float tol) const 831 FloatMatrix::pseudo_inverse (float tol) const
832 { 832 {
833 svd<FloatMatrix> result (*this, svd<FloatMatrix>::economy); 833 svd<FloatMatrix> result (*this, svd<FloatMatrix>::Type::economy);
834 834
835 FloatDiagMatrix S = result.singular_values (); 835 FloatDiagMatrix S = result.singular_values ();
836 FloatMatrix U = result.left_singular_matrix (); 836 FloatMatrix U = result.left_singular_matrix ();
837 FloatMatrix V = result.right_singular_matrix (); 837 FloatMatrix V = result.right_singular_matrix ();
838 838