changeset 15942:75cea615ade4

Check for sparse before diagonal class in kron (bug #38082) * kron.cc (Fkron): Move the check for sparseness to before for diagonal matrices.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 14 Jan 2013 13:35:09 -0500
parents 8135bce0812a
children 4803b8c138e3
files libinterp/corefcn/kron.cc
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/kron.cc	Sun Jan 13 21:57:02 2013 +0100
+++ b/libinterp/corefcn/kron.cc	Mon Jan 14 13:35:09 2013 -0500
@@ -177,6 +177,13 @@
   octave_value retval;
   if (a.is_perm_matrix () && b.is_perm_matrix ())
     retval = do_kron<PermMatrix, PermMatrix> (a, b);
+  else if (a.is_sparse_type () || b.is_sparse_type ())
+    {
+      if (a.is_complex_type () || b.is_complex_type ())
+        retval = do_kron<SparseComplexMatrix, SparseComplexMatrix> (a, b);
+      else
+        retval = do_kron<SparseMatrix, SparseMatrix> (a, b);
+    }
   else if (a.is_diag_matrix ())
     {
       if (b.is_diag_matrix () && a.rows () == a.columns ()
@@ -214,13 +221,6 @@
             retval = do_kron<DiagMatrix, Matrix> (a, b);
         }
     }
-  else if (a.is_sparse_type () || b.is_sparse_type ())
-    {
-      if (a.is_complex_type () || b.is_complex_type ())
-        retval = do_kron<SparseComplexMatrix, SparseComplexMatrix> (a, b);
-      else
-        retval = do_kron<SparseMatrix, SparseMatrix> (a, b);
-    }
   else if (a.is_single_type () || b.is_single_type ())
     {
       if (a.is_complex_type ())