commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: (MATH-608) Remove methods from RealMatrix Interface
Date Fri, 01 Jul 2011 23:53:12 GMT
Actually, the compiler can't do the dispatch correctly.

For instance, given the following approximately real code:

     Matrix a = new SparseMatrix(...);
     Matrix b = new DiagonalMatrix(...);

This line will not dispatch to a special case method for either SparseMatrix
or DiagonalMatrix:

     MatrixOperator.times(a, b)

This is because a and b are just Matrix objects according to the compiler.

You have to invent a way to do runtime dispatching.

On Fri, Jul 1, 2011 at 4:45 PM, Greg Sterijevski <gsterijevski@gmail.com>wrote:

> There is no magic which will remove the elemental complexity of these
> things. However, the complexity would be concentrated in the operator
> classes, where it probably should be. Furthermore, the type matching would
> be handled by compiler. Finally, the multiplication routines would grow as
> a
> need for those operations arises.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message