diff liboctave/idx-vector.h @ 8384:a99b9113c58c

optimize sparse bool indexing
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 08 Dec 2008 15:33:28 +0100
parents 445d27d79f4e
children a2bcd96b9344
line wrap: on
line diff
--- a/liboctave/idx-vector.h	Mon Dec 08 14:56:29 2008 +0100
+++ b/liboctave/idx-vector.h	Mon Dec 08 15:33:28 2008 +0100
@@ -33,6 +33,7 @@
 #include "oct-inttypes.h"
 
 template<class T> class Array;
+template<class T> class Sparse;
 class Range;
 
 // Design rationale:
@@ -270,6 +271,8 @@
 
     idx_vector_rep (const Array<bool>&);
 
+    idx_vector_rep (const Sparse<bool>&);
+
     ~idx_vector_rep (void);
 
     octave_idx_type xelem (octave_idx_type i) const
@@ -397,6 +400,9 @@
     : rep (new idx_range_rep (r))
     { chkerr (); }
 
+  idx_vector (const Sparse<bool>& nda) : rep (new idx_vector_rep (nda))
+    { chkerr (); }
+
   idx_vector (const idx_vector& a) : rep (a.rep) { rep->count++; }
 
   ~idx_vector (void)