changeset 10964:50273985ebca

remove subsref optimization in cellfun (better handled by cellindexmat)
author Jaroslav Hajek <highegg@gmail.com>
date Mon, 13 Sep 2010 08:25:21 +0200
parents 0d7624852beb
children 28ef5a31763d
files src/ChangeLog src/DLD-FUNCTIONS/cellfun.cc
diffstat 2 files changed, 4 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-13  Jaroslav Hajek  <highegg@gmail.com>
+
+	* DLD-FUNCTIONS/cellfun.cc (Fcellfun): Remove subsref optimization.
+
 2010-09-13  Jaroslav Hajek  <highegg@gmail.com>
 
 	* DLD-FUNCTIONS/cellfun.cc (Fcellindexmat): New DEFUN.
--- a/src/DLD-FUNCTIONS/cellfun.cc
+++ b/src/DLD-FUNCTIONS/cellfun.cc
@@ -318,35 +318,6 @@
           else
             error ("not enough arguments for `isclass'");
         }
-      else if (name == "subsref" && nargin == 5 && nargout == 1
-               && args(2).numel () == 1 && args(2).is_cell () 
-               && args(3).is_string ()
-               && 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 set to false.
-
-          const Cell tmpc = args(2).cell_value ();
-          octave_value subs = tmpc(0);
-
-          std::string type;
-          std::list<octave_value_list> idx;
-          decode_subscripts ("subsref", subs, type, idx);
-
-          if (! error_state)
-            {
-              Cell result (f_args.dims ());
-              for (octave_idx_type count = 0; count < k && ! error_state; count++)
-                {
-                  octave_value tmp = f_args.elem (count);
-                  result(count) = tmp.subsref (type, idx);
-                }
-
-              retval(0) = result;
-            }
-        }
       else
         {
           if (! valid_identifier (name))