commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Neidhart <thomas.neidh...@gmail.com>
Subject Re: [math] Re: Sparse matrices not supported anymore?
Date Fri, 08 Nov 2013 17:38:42 GMT
On 10/13/2013 09:41 AM, Ted Dunning wrote:
> Commons math decided not to support sparse matrices due to the difficulty
> of getting them just right.
> 
> The problem is that 0 * Inf = NaN, not 0.  This means that for floating
> point math, 0 * x = x is not a true identity.
> 
> The problem really arises when the 0 in question could be either stored as
> a 0 or not.  Not storing zeros is, of course, the hallmark and calling card
> of sparse matrices because if you assume that the zero multiplication
> identity holds, you can avoid lots of arithmetic.
> 
> Unfortunately, if the other matrix or vector has Inf in it, multiplying by
> a sparse matrix where the corresponding element is missing gives a 0
> instead of NaN.  Moreover, the dot product gives a value instead of NaN.
> 
> This is very hard to fix and still retain the desirable speed properties of
> sparse matrices.  You could imagine that you have a bitmap of all of the
> Inf values in every matrix, but keeping that bitmap up to date can
> absolutely kill performance since you have the potential for a branch in
> critical inner loops.
> 
> Most sparse matrices just punt and say they are sorry in a very
> non-IEEE-754 sort of way.
> 
> Commons Math has decided instead to remove sparse matrices entirely.

is there still consensus that we are going to remove the sparse
implementations with 4.0?

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message