changeset 10043:7fbdeaa9b0e0

fix common_size optimization
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 30 Dec 2009 06:01:51 +0100
parents b7915ebe8acf
children 2d7a8c227713
files scripts/ChangeLog scripts/general/common_size.m src/ChangeLog src/DLD-FUNCTIONS/cellfun.cc
diffstat 4 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Dec 30 05:30:54 2009 +0100
+++ b/scripts/ChangeLog	Wed Dec 30 06:01:51 2009 +0100
@@ -1,3 +1,7 @@
+2009-12-30  Jaroslav Hajek  <highegg@gmail.com>
+
+	* general/common_size.m: Use named function rather than a handle.
+
 2009-12-29  Jaroslav Hajek  <highegg@gmail.com>
 
 	* set/complement.m: Deprecate.
--- a/scripts/general/common_size.m	Wed Dec 30 05:30:54 2009 +0100
+++ b/scripts/general/common_size.m	Wed Dec 30 06:01:51 2009 +0100
@@ -77,7 +77,7 @@
           uo = "uniformoutput";
           dims = size (varargin{find (nscal, 1)});
           subs = substruct ("()", arrayfun (@ones, 1, dims, uo, false));
-          varargout(scal) = cellfun (@subsref, varargin(scal), {subs}, uo, false);
+          varargout(scal) = cellfun ("subsref", varargin(scal), {subs}, uo, false);
         endif
       endif
     endif
--- a/src/ChangeLog	Wed Dec 30 05:30:54 2009 +0100
+++ b/src/ChangeLog	Wed Dec 30 06:01:51 2009 +0100
@@ -1,3 +1,7 @@
+2009-12-30  Jaroslav Hajek  <highegg@gmail.com>
+
+	* DLD-FUNCTIONS/cellfun.cc (Fcellfun): Fix tests.
+
 2009-12-28  Thomas Treichl  <Thomas.Treichl@gmx.net>
 
 	* DLD-FUNCTIONS/md5sum.cc, DLD-FUNCTIONS/lookup.cc: Include
--- a/src/DLD-FUNCTIONS/cellfun.cc	Wed Dec 30 05:30:54 2009 +0100
+++ b/src/DLD-FUNCTIONS/cellfun.cc	Wed Dec 30 06:01:51 2009 +0100
@@ -383,12 +383,12 @@
       else if (name == "subsref" && nargin == 5 && nargout == 1
                && args(2).numel () == 1 && args(2).is_cell () 
                && args(3).is_string ()
-               && args(3).xtoupper ().string_value () == "uniformoutput"
-               && args(4).bool_value () && ! error_state)
+               && args(3).xtolower ().string_value () == "uniformoutput"
+               && ! args(4).bool_value () && ! error_state)
         {
           // This optimizes the case of applying the same index expression to
           // multiple values. We decode the subscript just once. uniformoutput must
-          // be requested as well.
+          // be set to false.
 
           const Cell tmpc = args(2).cell_value ();
           octave_value subs = tmpc(0);