changeset 12424:afb65a7bc065

update NEWS
author John W. Eaton <jwe@octave.org>
date Wed, 09 Feb 2011 16:26:35 -0500
parents bbd7b1d4b268
children 02669a1aa070
files ChangeLog NEWS liboctave/Sparse-perm-op-defs.h
diffstat 3 files changed, 35 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-09  John W. Eaton  <jwe@octave.org>
+
+	* NEWS: Update.
+
 2011-02-09  Ben Abbott  <bpabbott@mac.com>
 
 	* README.MacOS: Spelling corrections.
--- a/NEWS
+++ b/NEWS
@@ -378,6 +378,20 @@
     appended, and the anonymous function call does not occur on the
     call stack.
 
+ ** For compatibility with Matlab, mu2lin (x) is now equivalent to
+    mu2lin (x, 0).
+
+ ** The new function `history_control' may be used to control the way
+    command lines are added to the history list when Octave is using
+    readline for command-line editing.  For example
+
+      history_control ("ignoredups")
+
+    tells Octave to avoid adding duplicate lines to the history list.
+
+ ** Octave now uses the gnulib library for improved portability and to
+    avoid bugs in operating system functions.
+
  ** Deprecated functions.
 
     The following functions were deprecated in Octave 3.0 and have been
@@ -437,9 +451,6 @@
       autocov  dispatch  glpkmex    replot
       betai    fstat     is_global  saveimage
 
- ** For compatibility with Matlab, mu2lin (x) is now equivalent to
-    mu2lin (x, 0).
-
 Summary of important user-visible changes for version 3.2:
 ---------------------------------------------------------
 
--- a/liboctave/Sparse-perm-op-defs.h
+++ b/liboctave/Sparse-perm-op-defs.h
@@ -34,16 +34,26 @@
   const octave_idx_type nent = a.nnz ();
   SM r (nr, nc, nent);
 
-  for (octave_idx_type k = 0; k < nent; ++k)
-    {
-      octave_quit ();
-      r.xridx (k) = pcol[a.ridx (k)];
-      r.xdata (k) = a.data (k);
-    }
+  octave_sort<octave_idx_type> sort;
+
   for (octave_idx_type j = 0; j <= nc; ++j)
     r.xcidx (j) = a.cidx (j);
 
-  r.maybe_compress (false);
+  for (octave_idx_type j = 0; j < nc; j++)
+    {
+      octave_quit ();
+      
+      OCTAVE_LOCAL_BUFFER (octave_idx_type, sidx, r.xcidx(j+1) - r.xcidx(j));
+      for (octave_idx_type i = r.xcidx(j), ii = 0; i < r.xcidx(j+1); i++)
+        {
+          sidx[ii++]=i;
+          r.xridx (i) = pcol[a.ridx (i)];
+        }
+      sort.sort (r.xridx() + r.xcidx(j), sidx, r.xcidx(j+1) - r.xcidx(j)); 
+      for (octave_idx_type i = r.xcidx(j), ii = 0; i < r.xcidx(j+1); i++)
+        r.xdata(i) = a.data (sidx[ii++]);
+    }
+
   return r;
 }
 
@@ -105,7 +115,6 @@
     }
   assert (k_src == nent);
 
-  r.maybe_compress (false);
   return r;
 }
 
@@ -141,7 +150,6 @@
     }
   assert (k == nent);
 
-  r.maybe_compress (false);
   return r;
 }