diff src/ov-cell.cc @ 8823:3efa512a0957

make issorted work for cells
author Jaroslav Hajek <highegg@gmail.com>
date Fri, 20 Feb 2009 07:44:48 +0100
parents af907aeedbf4
children 76ddf0ab985d
line wrap: on
line diff
--- a/src/ov-cell.cc	Fri Feb 20 07:33:40 2009 +0100
+++ b/src/ov-cell.cc	Fri Feb 20 07:44:48 2009 +0100
@@ -483,6 +483,24 @@
   return retval;
 }
 
+sortmode 
+octave_cell::is_sorted (sortmode mode) const
+{
+  sortmode retval = UNSORTED;
+
+  if (is_cellstr ())
+    {
+      Array<std::string> tmp = cellstr_value ();
+
+      retval = tmp.is_sorted (mode);
+    }
+  else
+    error ("issorted: not a cell array of strings");
+  
+  return retval;
+}
+
+
 Array<octave_idx_type>
 octave_cell::sort_rows_idx (sortmode mode) const
 {
@@ -500,6 +518,23 @@
   return retval;
 }
 
+sortmode 
+octave_cell::is_sorted_rows (sortmode mode) const
+{
+  sortmode retval = UNSORTED;
+
+  if (is_cellstr ())
+    {
+      Array<std::string> tmp = cellstr_value ();
+
+      retval = tmp.is_sorted_rows (mode);
+    }
+  else
+    error ("issorted: not a cell array of strings");
+  
+  return retval;
+}
+
 bool
 octave_cell::is_true (void) const
 {