octave-maintainers
[Top][All Lists]
Advanced

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

RE: Re: Sparse matrix problem


From: michael . goffioul
Subject: RE: Re: Sparse matrix problem
Date: Tue, 19 Dec 2006 12:17:47 +0100

> I believe the (1+1i)/0 issue is the fault of my c++ complex class implementation
> and not in octave at all. However, the sparse issue is different. The problem here
> is there is no sparse scalar class (it doesn't make sense), and so the standard
> matrix "/" operator is used. So I'm get the answer back from CXSparse's QR
> solver. To get this right will need care to be taken in the "" and "/" operator that
> the size of the sparse matrix passed isn't in fact a scalar, and if it is to convert to
> scalar before the operators. However if we do that, then something like
> "speye(5)*sparse(2)" should also be valid and in fact is in matlab. This is a bit of
> a mess and easier would be to have "sparse(2)" return a scalar rather than a
> sparse matrix, though that will break other things.I'll make a possible patch for
> consideration, but there are lots of files to touch to get this right.
 
Note that I talked about element-wise division "./" and not "/", so it does not
involves QR. On my system:
 
(1+i)/0 => Inf + Infi
 
So, my complex class (or whatever else) seems OK. However, this does not
work in the context of sparse matrix, while it works OK for full matrices. For
instance:
 
[1+i, 0] ./ [0, 0] => [Inf + Infi,   NaN - NaNi]
 
sparse([1+i, 0]) ./ sparse([0, 0]) => [NaN + NaNi,   NaN + NaNi]
 
Then when looking in liboctave/Sparse-op-defs.h (around line 669), I
noticed the FIXME.
 
Michael.
 

reply via email to

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