octave-maintainers
[Top][All Lists]
Advanced

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

Re: About diagonal matrices


From: Jaroslav Hajek
Subject: Re: About diagonal matrices
Date: Sun, 22 Feb 2009 11:27:59 +0100

On Sun, Feb 22, 2009 at 11:16 AM, Søren Hauberg <address@hidden> wrote:
> søn, 22 02 2009 kl. 10:14 +0100, skrev Jaroslav Hajek:
>> > Yes, I understand that it is convenient for many uses for diagonal
>> > and sparse matrices to have the properties you want.  But I'm also
>> > don't like having things like
>> >
>> >  full_matrix == diag_matrix
>> >
>> > yet
>> >
>> >  diag_matrix * scalar != full_matrix * scalar
>> >
>> > for some values of scalar.
>> >
>> > jwe
>> >
>>
>> Why? This behaviour has been around for ages for sparse matrices, and
>> nobody complained.
>> It's just the distinction between an assumed zero and numerical zero.
>> It's *standard* in numerical software.
>> It is usually both numerically (or practically) superior and more
>> effective, you just need to be aware of it in
>> certain cases.
>
> When the diagonal matrix type was introduced I was under the impression
> that it would only be an optimization (i.e. my programs would run faster
> but produce the same results). The issue raised by John (I think) is
> that this change also changes the output of programs. While I think that
> the current behaviour in the development sources is actually better then
> the 3.0 behaviour, I do foresee problems because of this change. I
> realize that only terribly written programs depend on the behaviour of
> NaN, but I would claim that 99% of all software ever written is indeed
> terrible.

While that is true, I don't think this means that 99% of software will
necessarily be broken.
I bet that 99% users won't even realize there's a difference.

> So, I'm guessing that we'll hear from people complaining over
> this (and that we can't even provide the true Matlab experience).

I think that there's long been an agreement that we need not copy
every stupid choice in Matlab.
Btw, Matlab also ignores 0*NaN when doing a sparse * matrix
multiplication. The fact that Inf * sparse
fills up the matrix is, therefore, an inconsistency. No numerical
software I know of behaves in this way.
Maple, for instance, does what we currently do.


> That being said, I actually favour the current behaviour in the
> development sources. I just think we should be prepared for some very
> angry complaints from people because we broke their programs.
>

Unless we want to simply develop a free copy of Matlab, this is not
avoidable. There will always be such users.

> Søren
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
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]