commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sujit Pal (JIRA)" <>
Subject [jira] Created: (MATH-231) User-extendable Abstract RealMatrix implementation
Date Wed, 03 Dec 2008 21:19:44 GMT
User-extendable Abstract RealMatrix implementation

                 Key: MATH-231
             Project: Commons Math
          Issue Type: New Feature
    Affects Versions: 2.1
         Environment: Any
            Reporter: Sujit Pal
            Priority: Minor

Many algorithms are described using Matrices. In some situations, the Matrices for applications
are too large to fit into memory, so it makes sense to use custom implementations that are
backed by a sparse map or list, or backed by Lucene indexes or database tables, etc. This
allows the algorithm implementations (in the application) to be clean and mimic the algorithm
itself, making it easy to understand and debug. 

However, the only way to make a custom implementation currently is to implement RealMatrix,
and to implement all its methods, or to extend and override methods in RealMatrixImpl. The
former involves a knowledge of matrix operations, which is not guaranteed for people who are
business programmers (which may be the reason they are using commons-math in the first place).
The latter involves looking at the existing code and making the overrides where needed, again
something that is not expected from a commons-math user. A simpler way would be to have something
generic mostly built, except the getEntry() and setEntry() methods which would be declared
abstract and hence meant to be overriden, and all the other methods to be pre-built based
on getEntry() and setEntry().

This would make the creation of custom matrices very flexible, and would also remove the burden
of providing "common matrix impls" from the commons-math project, since clients can very simply
create custom versions of their own.

I suggest the following:

<<>> <-- RealMatrixImpl
                                        <-- (AbstractRealMatrixImpl)

The SparseRealMatrixImpl I contributed in MATH-230 could be a user-defined custom subclass
of AbstractRealMatrixImpl and not have to belong to the commons-math project at all. Or it
could be included as an example if there is enough need.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message