commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dusan Ku (Commented) (JIRA)" <>
Subject [jira] [Commented] (MATH-717) A varied class of Array2DRowRealMatrix is needed to contain float type instead of double.
Date Wed, 14 Dec 2011 03:14:33 GMT


Dusan Ku commented on MATH-717:

Hi S├ębastien,

I also agree with you on the downside of float - ugly precision and its workaround. 
Just like your case, my huge matrices can be generated procedurally, which means no need to
store the matrix. I just felt the diversity (or flexibility) of the choice between the matrix
dimension and the type size might benefit us (the developers who are using the library). In
this way, for some small problems, small enough to test against the full matrices with float
type but not possible with double type, we can test the fully generated matrices with float
type. "double" type sometimes does not allow me to test these matrices because the maximum
java heap size I could specify under 32-bit OS is somewhere between 1.3G and 1.4G and any
attempt over this memory limit throws an OutOfMemory exception. When that happens, my current
solution is to make the same classes with float type as the basis.

What conclusions can we draw on this issue? Well, for now, let's just assume that there were
some opinions like mine regarding the fact that the basic type is fixed to "double" type.

> A varied class of Array2DRowRealMatrix is needed to contain float type instead of double.
> -----------------------------------------------------------------------------------------
>                 Key: MATH-717
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 2.2
>         Environment: All
>            Reporter: Dusan Ku
>              Labels: features
> The current implementation of Array2DRowRealMatrix takes only double type as its base
element value in the matrix.
> However, the memory size of double is bigger than float, the downside of which makes
the matrix dimension quite limited, compared to float type as its base element type. For small
sized problem, this does not make such a big difference, but for large problems, this limits
the usability of this library quite severely. In my case, I easily hit an error even after
I increase the memory option to 1G. This could have been much more enhanced just by using
'float[][]' instead of the current Array2DRowRealMatrix.
> Therefore, the solution I may suggest is to add another class similar to Array2DRowRealMatrix
containing float type for its matrix variable instead of double. Of course, a better way is
welcome as long as the needs can be fulfilled.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message