commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Sterijevski <gsterijev...@gmail.com>
Subject Re: (MATH-608) Remove methods from RealMatrix Interface
Date Fri, 01 Jul 2011 23:59:19 GMT
This may be a problem. Type erasure might necessitate some tricky use of
generics.

On the SVD, if that's a bug, then the method which yields a reference to the
data array in realmatrix is also a bug.

On Fri, Jul 1, 2011 at 6:53 PM, Ted Dunning <ted.dunning@gmail.com> wrote:

> 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