[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, 17 Aug 2011 10:06:06 -0500 |
2011/8/17 Levente Torok <address@hidden>:
> 2011/8/17 Jordi Gutiérrez Hermoso <address@hidden>
>>
>> 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.
>>
> However, at first sight it looks very attractive,I would stick to
> the original version. since I believe the syntax check that
> generates error in the current and past versions of octave by
> matching the matrix dimensions before doing computations prevented
> over too many of us from doing bull shit computations.
Really? Can you think of an actual example of when that happened? I
think bsxfun should be a fundamental and frequent vectorisation tool,
but instead it's seen as daunting because it's obscure. I think the
example I proposed for getting all pairwise differences of a vector
into a matrix is very natural and likely to be attempted by novices,
who should be pleasantly surprised it just works.
I still think numpy's example is worth following here. It's automatic
there, and numpy's users aren't clamouring over how dangerous it is.
- Jordi G. H.