From: Bill B. <wb...@gm...> - 2006-09-22 14:41:37
|
On 9/22/06, Alan G Isaac <ai...@am...> wrote: > On Fri, 22 Sep 2006, Bill Baxter apparently wrote: > > Ok, here's my best shot at a generalized repmat: > > Sorry to always repeat this suggestion when > it comes to repmat, but I think the whole approach > is wrong. A repmat should be a separate object type, > which behaves like the described matrix but has only one > copy of the repetitive data. That may be true for some cases. But I usually start modifying the data I create right after a repmat. It wouldn't help in that case. So unless you're really making a lot of large repmats of arrays that never change, or for use as temp variables, I can't see a separate class being that much of a win, compared with the complexity of implementing and maintaining it (think "fancy indexing"). YMMV. However, repmat seems to be far less commonly needed in numpy than in Matlab. I think that's mostly thanks to the broadcasting rules, which already create a sort of implicit repmat of the input in many common cases. --bb |