changeset 21153:9c61ab1f7588

eliminate unnecessary qrsolve functions * SparseCmplxQR.cc, SparseCmplxQR.h, SparseQR.cc, SparseQR.h (qrsolve): Eliminate versions that accept Matrix and ComplexMatrix arguments in favor of MArray<double> and MArray<Complex>.
author John W. Eaton <jwe@octave.org>
date Fri, 29 Jan 2016 16:27:54 -0500
parents 8ad3907b8fad
children 36b27fac6bc9
files liboctave/numeric/SparseCmplxQR.cc liboctave/numeric/SparseCmplxQR.h liboctave/numeric/SparseQR.cc liboctave/numeric/SparseQR.h
diffstat 4 files changed, 11 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/numeric/SparseCmplxQR.cc	Fri Jan 29 14:55:20 2016 -0500
+++ b/liboctave/numeric/SparseCmplxQR.cc	Fri Jan 29 16:27:54 2016 -0500
@@ -253,7 +253,8 @@
 }
 
 ComplexMatrix
-qrsolve (const SparseComplexMatrix&a, const Matrix &b, octave_idx_type &info)
+qrsolve (const SparseComplexMatrix& a, const MArray<double>& b,
+         octave_idx_type& info)
 {
   info = -1;
 #ifdef HAVE_CXSPARSE
@@ -496,8 +497,8 @@
 }
 
 ComplexMatrix
-qrsolve (const SparseComplexMatrix&a, const ComplexMatrix &b,
-         octave_idx_type &info)
+qrsolve (const SparseComplexMatrix& a, const MArray<Complex>& b,
+         octave_idx_type& info)
 {
   info = -1;
 #ifdef HAVE_CXSPARSE
@@ -733,17 +734,3 @@
   return SparseComplexMatrix ();
 #endif
 }
-
-ComplexMatrix
-qrsolve (const SparseComplexMatrix &a, const MArray<double> &b,
-         octave_idx_type &info)
-{
-  return qrsolve (a, Matrix (b), info);
-}
-
-ComplexMatrix
-qrsolve (const SparseComplexMatrix &a, const MArray<Complex> &b,
-         octave_idx_type &info)
-{
-  return qrsolve (a, ComplexMatrix (b), info);
-}
--- a/liboctave/numeric/SparseCmplxQR.h	Fri Jan 29 14:55:20 2016 -0500
+++ b/liboctave/numeric/SparseCmplxQR.h	Fri Jan 29 16:27:54 2016 -0500
@@ -128,7 +128,8 @@
 
   ComplexMatrix Q (void) const { return rep->Q (); }
 
-  friend ComplexMatrix qrsolve (const SparseComplexMatrix &a, const Matrix &b,
+  friend ComplexMatrix qrsolve (const SparseComplexMatrix &a,
+                                const MArray<double> &b,
                                 octave_idx_type &info);
 
   friend SparseComplexMatrix qrsolve (const SparseComplexMatrix &a,
@@ -136,7 +137,7 @@
                                       octave_idx_type &info);
 
   friend ComplexMatrix qrsolve (const SparseComplexMatrix &a,
-                                const ComplexMatrix &b,
+                                const MArray<Complex> &b,
                                 octave_idx_type &info);
 
   friend SparseComplexMatrix qrsolve (const SparseComplexMatrix &a,
@@ -154,9 +155,6 @@
 
 // Publish externally used friend functions.
 
-extern ComplexMatrix qrsolve (const SparseComplexMatrix &a, const Matrix &b,
-                              octave_idx_type &info);
-
 extern ComplexMatrix qrsolve (const SparseComplexMatrix &a,
                               const MArray<double> &b,
                               octave_idx_type &info);
@@ -166,10 +164,6 @@
                                     octave_idx_type &info);
 
 extern ComplexMatrix qrsolve (const SparseComplexMatrix &a,
-                              const ComplexMatrix &b,
-                              octave_idx_type &info);
-
-extern ComplexMatrix qrsolve (const SparseComplexMatrix &a,
                               const MArray<Complex> &b,
                               octave_idx_type &info);
 
--- a/liboctave/numeric/SparseQR.cc	Fri Jan 29 14:55:20 2016 -0500
+++ b/liboctave/numeric/SparseQR.cc	Fri Jan 29 16:27:54 2016 -0500
@@ -255,7 +255,7 @@
 }
 
 Matrix
-qrsolve (const SparseMatrix&a, const Matrix &b, octave_idx_type& info)
+qrsolve (const SparseMatrix& a, const MArray<double>& b, octave_idx_type& info)
 {
   info = -1;
 #ifdef HAVE_CXSPARSE
@@ -480,7 +480,7 @@
 }
 
 ComplexMatrix
-qrsolve (const SparseMatrix&a, const ComplexMatrix &b, octave_idx_type &info)
+qrsolve (const SparseMatrix& a, const MArray<Complex>& b, octave_idx_type& info)
 {
   info = -1;
 #ifdef HAVE_CXSPARSE
@@ -793,17 +793,3 @@
   return SparseComplexMatrix ();
 #endif
 }
-
-Matrix
-qrsolve (const SparseMatrix &a, const MArray<double> &b,
-         octave_idx_type &info)
-{
-  return qrsolve (a, Matrix (b), info);
-}
-
-ComplexMatrix
-qrsolve (const SparseMatrix &a, const MArray<Complex> &b,
-         octave_idx_type &info)
-{
-  return qrsolve (a, ComplexMatrix (b), info);
-}
--- a/liboctave/numeric/SparseQR.h	Fri Jan 29 14:55:20 2016 -0500
+++ b/liboctave/numeric/SparseQR.h	Fri Jan 29 16:27:54 2016 -0500
@@ -129,13 +129,13 @@
 
   Matrix Q (void) const { return rep->Q (); }
 
-  friend Matrix qrsolve (const SparseMatrix &a, const Matrix &b,
+  friend Matrix qrsolve (const SparseMatrix &a, const MArray<double> &b,
                          octave_idx_type &info);
 
   friend SparseMatrix qrsolve (const SparseMatrix &a, const SparseMatrix &b,
                                octave_idx_type &info);
 
-  friend ComplexMatrix qrsolve (const SparseMatrix &a, const ComplexMatrix &b,
+  friend ComplexMatrix qrsolve (const SparseMatrix &a, const MArray<Complex> &b,
                                 octave_idx_type &info);
 
   friend SparseComplexMatrix qrsolve (const SparseMatrix &a,
@@ -153,18 +153,12 @@
 
 // Publish externally used friend functions.
 
-extern Matrix qrsolve (const SparseMatrix &a, const Matrix &b,
-                       octave_idx_type &info);
-
 extern Matrix qrsolve (const SparseMatrix &a, const MArray<double> &b,
                        octave_idx_type &info);
 
 extern SparseMatrix qrsolve (const SparseMatrix &a, const SparseMatrix &b,
                              octave_idx_type &info);
 
-extern ComplexMatrix qrsolve (const SparseMatrix &a, const ComplexMatrix &b,
-                              octave_idx_type &info);
-
 extern ComplexMatrix qrsolve (const SparseMatrix &a, const MArray<Complex> &b,
                               octave_idx_type &info);