[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: POC for automatic bsxfun
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: POC for automatic bsxfun |
Date: |
Wed, 24 Aug 2011 10:58:58 -0500 |
2011/8/23 John W. Eaton <address@hidden>:
> On 17-Aug-2011, Jordi Gutiérrez Hermoso wrote:
>
> | The attached patch makes bsxfun automatic for most binary operators.
> | The power operator seems to be the only one that is treated
> | differently, so it's not covered by this patch.
> I'm OK with adding this as an experimental feature as long as we agree
> to remove it if there turn out to be unexpected problems or if it
> somehow causes a lot of confusion. I think the documentation should
> be clear that the feature is experimental.
Encouraged by this, I started looking at the power operators. What a
mess. Can we replace OCTAVE_MS_POW_OPS in src/OPERATORS/op-int.h:534
with actual templates?
There's a cute trick for easily templating classes like the NDarray
classes (btw, why aren't these already templated, hysterical
raisins?):
http://codepad.org/FvLWfoSs
but I don't know if this template trick is too hard to understand. It
would be a pretty cheap way to template the NDArray classes and avoid
a lot of code duplication and macros here and elsewhere. What do you
think?
- Jordi G. H.