commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <>
Subject Re: (MATH-608) Remove methods from RealMatrix Interface
Date Sat, 02 Jul 2011 00:31:42 GMT
On Fri, Jul 1, 2011 at 4:59 PM, Greg Sterijevski <>wrote:

> This may be a problem. Type erasure might necessitate some tricky use of
> generics.

That won't help.  Good coding practice is to declare a variable with as weak
a type as possible so that libraries have maximum freedom to act.  That
means that the generics framework has nothing to work with in terms of type

Also, if I am writing a library function, I want to specify my input as very
weak types to maximize the generality of my code.  By I want those matrices
that I am passed to still dispatch to the most efficient implementation for
matrix operations.  For instance, if I am normalizing a matrix, I want to
say divide by the norm and have the matrix know how to compute the norm
quickly and not go scaling all the sparse zeros that may not exist in the
matrix.  I desperately DON'T want to put restrictive types in my application
code that is normalizing.

> 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.

Pretty much.

But I gave up on worrying about API bugs in frozen projects like Math.

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