octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unary mapper system redesigned + a few questions


From: Jaroslav Hajek
Subject: Re: unary mapper system redesigned + a few questions
Date: Wed, 18 Nov 2009 17:53:09 +0100



On Wed, Nov 18, 2009 at 5:35 PM, Judd Storrs <address@hidden> wrote:
On Wed, Nov 18, 2009 at 2:59 AM, Jaroslav Hajek <address@hidden> wrote:
> The automatic narrowing is a feature of Matlab. Dropping the narrowing
> entirely is something that IMHO wants a separate discussion. All that I'm
> saying is that if the automatic narrowing is done, constraining it to
> positive zeros makes little sense.

Hmm. I didn't realize this was the case, but in Matlab it isn't really
that objectionable because the real and imaginary components are
stored separately. e.g. tossing or adding an imaginary component
doesn't require copying. In octave they are interleaved thus copies
are mandatory?


Yes, if a complex array is to be narrowed, a copy is required.The Matlab storage is more suitable for this particular stuff (maybe it was designed for it). However, Octave's storage is more suitable for many other applications, in particular for matrix division.

Automatic narrowing is also plausible as a counterpart to the automatic widening done by some mappers:
for instance, sqrt ([1, -1]) gives [1+0i, 0+1i] instead of [1, NaN], so it's nice that [1+0i, 0+1i].^2 gives [1, -1] back. It all depends on the problem at hand, but in general I found the autoconversions useful when one gets used to them a little.

--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]