[
https://issues.apache.org/jira/browse/MATH-1639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17475805#comment-17475805
]
Gilles Sadowski commented on MATH-1639:
---------------------------------------
Along the years, many JIRA reports have been filed about the matrix
functionality.
But nobody tackled the major overhaul of package
[{{o.a.c.math4.legacy.linear}}|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=tree;f=commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/linear;h=ae909538cfe81b5f205c9178e56ae771b86a05e3;hb=HEAD].
It seems that the sparse matrix data-structure is not used within Commons Math.
So, maybe we should drop the feature (?). If not, it might be redesigned
based on state-of-the-art references.
> OpenMapRealMatrix can't have more than Integer.MAX_VALUE *possible* entries
> ---------------------------------------------------------------------------
>
> Key: MATH-1639
> URL: https://issues.apache.org/jira/browse/MATH-1639
> Project: Commons Math
> Issue Type: Improvement
> Reporter: Matteo Riondato
> Priority: Major
>
> If one tries to create an OpenMapRealMatrix with a {_}possible{_}, i.e.,
> {_}maximum{_}, number of entries greater than Integer.MAX_VALUE, the
> constructor throws a NumberIsTooLargeException.
> This behavior seems to be caused by the fact that the key of an entry in the
> matrix is represented as an int, because an OpenIntToDoubleHashMap is used to
> store the entries.
> Thus, for example, it is not possible to create a OpenMapRealMatrix with ...
> rows and columns and a single non-zero entry, which would be a perfectly fine
> sparse matrix.
> The choice of using int as the key type of the map to store the entries of
> the matrix seems to severely limit the use of Commons Math for sparse
> matrices. If one used a "standard" java.util.Map with a key type that could
> represent the pair (row, column), then OpenMapRealMatrix would be much more
> useful. Alternative, one wonders whether it would be possible to have an
> OpenPairOfIntsToDoubleHashMap class.
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)