Mercurial > octave
comparison liboctave/array/CMatrix.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 |
---|---|
1137 ComplexMatrix | 1137 ComplexMatrix |
1138 ComplexMatrix::pseudo_inverse (double tol) const | 1138 ComplexMatrix::pseudo_inverse (double tol) const |
1139 { | 1139 { |
1140 ComplexMatrix retval; | 1140 ComplexMatrix retval; |
1141 | 1141 |
1142 svd<ComplexMatrix> result (*this, svd<ComplexMatrix>::economy); | 1142 svd<ComplexMatrix> result (*this, svd<ComplexMatrix>::Type::economy); |
1143 | 1143 |
1144 DiagMatrix S = result.singular_values (); | 1144 DiagMatrix S = result.singular_values (); |
1145 ComplexMatrix U = result.left_singular_matrix (); | 1145 ComplexMatrix U = result.left_singular_matrix (); |
1146 ComplexMatrix V = result.right_singular_matrix (); | 1146 ComplexMatrix V = result.right_singular_matrix (); |
1147 | 1147 |