Mercurial > octave
diff libinterp/corefcn/sqrtm.cc @ 21266:e69eaee28737
make better use of templates for Schur decomposition
* liboctave/numeric/schur.h, liboctave/numeric/schur.cc:
New files generated from SCHUR.h, SCHUR.cc, CmplxSCHUR.h,
CmplxSCHUR.cc, dbleSCHUR.h, dbleSCHUR.cc, fCmplxSCHUR.h,
fCmplxSCHUR.cc, floatSCHUR.h, and floatSCHUR.cc and making them
templates.
* liboctave/numeric/module.mk: Update.
* libinterp/corefcn/schur.cc, sqrtm.cc, CMatrix.cc, dMatrix.cc,
fCMatrix.cc, fMatrix.cc, mx-defs.h, mx-ext.h: Use new template classes
and header file.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 15 Feb 2016 20:06:12 -0500 |
parents | fcac5dbbf9ed |
children | 40de9f8f23a6 |
line wrap: on
line diff
--- a/libinterp/corefcn/sqrtm.cc Thu Jan 14 19:59:52 2016 +1100 +++ b/libinterp/corefcn/sqrtm.cc Mon Feb 15 20:06:12 2016 -0500 @@ -27,8 +27,7 @@ #include <float.h> -#include "CmplxSCHUR.h" -#include "fCmplxSCHUR.h" +#include "schur.h" #include "lo-ieee.h" #include "lo-mappers.h" #include "oct-norm.h" @@ -177,9 +176,9 @@ do { - ComplexSCHUR schur (x, "", true); - x = schur.schur_matrix (); - u = schur.unitary_matrix (); + ComplexSCHUR schur_fact (x, "", true); + x = schur_fact.schur_matrix (); + u = schur_fact.unitary_matrix (); } while (0); // schur no longer needed. @@ -236,10 +235,10 @@ // sqrtm of a diagonal matrix is just sqrt. retval(0) = arg.sqrt (); else if (arg.is_single_type ()) - retval(0) = do_sqrtm<FloatMatrix, FloatComplexMatrix, FloatComplexSCHUR> - (arg); + retval(0) = do_sqrtm<FloatMatrix, FloatComplexMatrix, + schur<FloatComplexMatrix> > (arg); else if (arg.is_numeric_type ()) - retval(0) = do_sqrtm<Matrix, ComplexMatrix, ComplexSCHUR> (arg); + retval(0) = do_sqrtm<Matrix, ComplexMatrix, schur<ComplexMatrix> > (arg); if (nargout > 1) {