Mercurial > octave
comparison liboctave/array/dMatrix.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 |
---|---|
821 } | 821 } |
822 | 822 |
823 Matrix | 823 Matrix |
824 Matrix::pseudo_inverse (double tol) const | 824 Matrix::pseudo_inverse (double tol) const |
825 { | 825 { |
826 svd<Matrix> result (*this, svd<Matrix>::economy); | 826 svd<Matrix> result (*this, svd<Matrix>::Type::economy); |
827 | 827 |
828 DiagMatrix S = result.singular_values (); | 828 DiagMatrix S = result.singular_values (); |
829 Matrix U = result.left_singular_matrix (); | 829 Matrix U = result.left_singular_matrix (); |
830 Matrix V = result.right_singular_matrix (); | 830 Matrix V = result.right_singular_matrix (); |
831 | 831 |