diff src/ov-perm.cc @ 13030:b646413c3d0e

Make operators do smarter sparse conversions on permutation matrices. * Sparse.cc (Sparse<T>::Sparse): New templated ctor, plus two instantiations. * Sparse.h (Sparse<T>): Declare new ctor. * MSparse.h (MSparse): Give this class a PermMatrix ctor. * boolSparse.h (BoolSparseMatrix): Ditto. * dSparse.cc: Refactor PermMatrix ctor, moved into common parent class. * dSparse.h (SparseMatrix): Ditto. * op-pm-sm.cc: Declare and install smarter permutation matrix operators. * ov-perm.cc (octave_perm_matrix): Declare new virtual function override. * ov-perm.cc (sparse_bool_matrix_value): Override this virtual function.
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Tue, 30 Aug 2011 18:36:06 -0500
parents 12df7854fa7c
children 72c96de7a403
line wrap: on
line diff
--- a/src/ov-perm.cc	Tue Aug 30 14:37:25 2011 -0400
+++ b/src/ov-perm.cc	Tue Aug 30 18:36:06 2011 -0500
@@ -217,6 +217,12 @@
   return SparseMatrix (matrix);
 }
 
+SparseBoolMatrix
+octave_perm_matrix::sparse_bool_matrix_value (bool) const
+{
+  return SparseBoolMatrix (matrix);
+}
+
 SparseComplexMatrix
 octave_perm_matrix::sparse_complex_matrix_value (bool) const
 {