Diff of /inst/@dataframe/private/df_func.m [afaced] .. [591ef1] Maximize Restore

  Switch to unified view

a/inst/@dataframe/private/df_func.m b/inst/@dataframe/private/df_func.m
...
...
50
      else
50
      else
51
        if (whole(1) && ~whole(2))
51
        if (whole(1) && ~whole(2))
52
          for indi = (resu._cnt(2):-1:1)
52
          for indi = (resu._cnt(2):-1:1)
53
            switch resu._type{indi}
53
            switch resu._type{indi}
54
              case "char"
54
              case "char"
55
                resu._data{indi} = feval (func, A, \
55
                resu._data{indi} = feval (func, A, ...
56
                                          char (B._data{indi}(:, B._rep{indi})));
56
                                          char (B._data{indi}(:, B._rep{indi})));
57
              otherwise
57
              otherwise
58
                resu._data{indi} = feval (func, A, \
58
                resu._data{indi} = feval (func, A, ...
59
                                          B._data{indi}(:, B._rep{indi}));
59
                                          B._data{indi}(:, B._rep{indi}));
60
            endswitch
60
            endswitch
61
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
61
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
62
          endfor
62
          endfor
63
        elseif (itercol && ~whole(2)),
63
        elseif (itercol && ~whole(2)),
64
          for indi = (resu._cnt(2):-1:1)
64
          for indi = (resu._cnt(2):-1:1)
65
            switch resu._type{indi}
65
            switch resu._type{indi}
66
              case "char"
66
              case "char"
67
                resu._data{indi} = feval (func, squeeze (A(:, indi, :)), \
67
                resu._data{indi} = feval (func, squeeze (A(:, indi, :)), ...
68
                                          char (B._data{indi}(:, B._rep{indi})));
68
                                          char (B._data{indi}(:, B._rep{indi})));
69
              otherwise
69
              otherwise
70
                resu._data{indi} = feval (func, squeeze (A(:, indi, :)), \
70
                resu._data{indi} = feval (func, squeeze (A(:, indi, :)), ...
71
                                          B._data{indi}(:, B._rep{indi}));
71
                                          B._data{indi}(:, B._rep{indi}));
72
            endswitch
72
            endswitch
73
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
73
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
74
          endfor
74
          endfor
75
        elseif (~whole(2)),
75
        elseif (~whole(2)),
...
...
94
    else
94
    else
95
      if (itercol)
95
      if (itercol)
96
        for indi = (resu._cnt(2):-1:1)
96
        for indi = (resu._cnt(2):-1:1)
97
          switch resu._type{indi}
97
          switch resu._type{indi}
98
            case "char"
98
            case "char"
99
              resu._data{indi} = feval \
99
              resu._data{indi} = feval ...
100
                  (func, char (A._data{indi}(:, A._rep{indi})), \
100
                  (func, char (A._data{indi}(:, A._rep{indi})), ...
101
                   char (B._data{indi}(B._rep{indi})));
101
                   char (B._data{indi}(B._rep{indi})));
102
            otherwise
102
            otherwise
103
              resu._data{indi} = feval \
103
              resu._data{indi} = feval ...
104
                  (func, A._data{indi}(:, A._rep{indi}), \
104
                  (func, A._data{indi}(:, A._rep{indi}), ...
105
                   B._data{indi}(:, B._rep{indi}));
105
                   B._data{indi}(:, B._rep{indi}));
106
          endswitch
106
          endswitch
107
          resu._rep{indi} = 1:size (resu._data{indi}, 2);
107
          resu._rep{indi} = 1:size (resu._data{indi}, 2);
108
        endfor
108
        endfor
109
      else %# itercol is false
109
      else %# itercol is false
110
        dummy = df_whole(A);
110
        dummy = df_whole(A);
111
        if (whole(1))
111
        if (whole(1))
112
          for indi = (resu._cnt(2):-1:1)
112
          for indi = (resu._cnt(2):-1:1)
113
            switch resu._type{indi}
113
            switch resu._type{indi}
114
              case "char"
114
              case "char"
115
                resu._data{indi} = feval (func, dummy, \
115
                resu._data{indi} = feval (func, dummy, ...
116
                                          char (B._data{indi}(:, B._rep{indi})));
116
                                          char (B._data{indi}(:, B._rep{indi})));
117
              otherwise
117
              otherwise
118
                resu._data{indi} = feval (func, dummy, \
118
                resu._data{indi} = feval (func, dummy, ...
119
                                          B._data{indi}(:, B._rep{indi}));
119
                                          B._data{indi}(:, B._rep{indi}));
120
            endswitch
120
            endswitch
121
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
121
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
122
          endfor
122
          endfor
123
        elseif (~whole(2))
123
        elseif (~whole(2))
124
          for indi = (resu._cnt(2):-1:1)
124
          for indi = (resu._cnt(2):-1:1)
125
            switch resu._type{indi}
125
            switch resu._type{indi}
126
              case "char"
126
              case "char"
127
                resu._data{indi} = squeeze \
127
                resu._data{indi} = squeeze ...
128
                    (feval (func, dummy(indi, :, :),\
128
                    (feval (func, dummy(indi, :, :),...
129
                            char (B._data{indi}(:, B._rep{indi}))));
129
                            char (B._data{indi}(:, B._rep{indi}))));
130
              otherwise
130
              otherwise
131
                resu._data{indi} = squeeze \
131
                resu._data{indi} = squeeze ...
132
                    (feval (func, dummy(indi, :, :), \
132
                    (feval (func, dummy(indi, :, :), ...
133
                            B._data{indi}(:, B._rep{indi})));
133
                            B._data{indi}(:, B._rep{indi})));
134
            endswitch
134
            endswitch
135
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
135
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
136
          endfor
136
          endfor
137
        else
137
        else
...
...
174
              case "char"
174
              case "char"
175
                unfolded = char (A._data{indi}(:, A._rep{indi}));
175
                unfolded = char (A._data{indi}(:, A._rep{indi}));
176
              otherwise
176
              otherwise
177
                unfolded = A._data{indi}(:, A._rep{indi});
177
                unfolded = A._data{indi}(:, A._rep{indi});
178
            endswitch
178
            endswitch
179
            resu._data{indi} = feval (func, unfolded, \
179
            resu._data{indi} = feval (func, unfolded, ...
180
                                      squeeze (B(:, indi, :)));
180
                                      squeeze (B(:, indi, :)));
181
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
181
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
182
          endfor
182
          endfor
183
        endif 
183
        endif 
184
      else
184
      else
...
...
189
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
189
            resu._rep{indi} = 1:size (resu._data{indi}, 2);
190
          endfor
190
          endfor
191
        else
191
        else
192
          if (~whole(2))
192
          if (~whole(2))
193
            for indi = (resu._cnt(1):-1:1)
193
            for indi = (resu._cnt(1):-1:1)
194
              resu._data{indi} = squeeze (feval (func, dummy(indi, :, :), \
194
              resu._data{indi} = squeeze (feval (func, dummy(indi, :, :), ...
195
                                                 B(:, indi, :)));
195
                                                 B(:, indi, :)));
196
              resu._rep{indi} = 1:size (resu._data{indi}, 2);
196
              resu._rep{indi} = 1:size (resu._data{indi}, 2);
197
            endfor
197
            endfor
198
          else
198
          else
199
            for indi = (resu._cnt(1):-1:1) %# in place computation
199
            for indi = (resu._cnt(1):-1:1) %# in place computation