Fwd: Re: JAMA Improvement: Double JAMA's Speed


Sender: Mark Diggory <mdiggory@MIT.EDU>
Subject: Re: JAMA Improvement: Double JAMA's Speed


You may find implementing such a solution with the Linear Algebra  
Utilities in the Apache Jakarta Commons Math package a bit easier.  I  
haven't worked on these for awhile, but the intention when Apache  
founded this library was to allow alternative solutions to underlying  
array storage in hopes that if a primitive data-structure for  
Matrices did arise, there'd be a short path to implementing and/or  
converting existing libraries to it.

See:
http://commons.apache.org/math

and

http://commons.apache.org/math/userguide/linear.html

Cheers,
Mark Diggory

On Nov 11, 2007, at 5:27 PM, boisvert@nist.gov wrote:

>
>
> ----- Forwarded message from "Castro, Giovanny A"  
> <> -----
>     Date: Fri, 9 Nov 2007 20:26:04 -0500
>     From: "Castro, Giovanny A" <>
>  Subject: JAMA Improvement: Double JAMA's Speed
>       To: boisvert@nist.gov
>
>
> JAMA Authors,
>
>
> I have a somewhat strange but valid proposal to improve the JAMA
> library:
>
> There should be a Matrix subclass for Matrix sizes under 15.
> Why? To take advantage of dramatic performance increases when using
> one dimensional arrays at these sizes.
>
> For a 4x4 matrix a one dimensional array implementation is TWICE as  
> fast
> as the JAMA implementation.
>
> Why are 4x4 and 3x3 matrices important? They are critical to computer
> graphics and engineering applications. It would be my guess that a  
> large
> percentage of people interested in a matrix library are interested in
> using it in a computer graphics application - or in other engineering
> applications requiring scaling, translation and rotation.
>
> As it stands, JAMA is completely unacceptable for these applications.
>
> Especially in computer graphics applications, Java developers are
> already at a disadvantage compared to C/C++ (even Flash) developers.
>
> If they could DOUBLE their Matrix and Vector multiplication (rotation)
> performance why would they choose JAMA?
>
> Unfortunately, implementing this proposal would require a  
> redesigning of
> the JAMA library which is why I know this is a strange proposal.
>
> Developers cant subclass the Matrix class to do this themselves  
> because
> it contains the double A[][] variable. Matrix might have to be an
> abstract class with subclasses defining the data storage. There might
> have to be a factory method by which to create matrices because
> it would have to return a one-dimensionally or two-dimensionally  
> backed
> matrix depending on the dimensions...
>
> Obviously, I haven't considered the specifics of what would have to be
> done to JAMA to achieve this but I hope ive piqued someone curiosity
> on this subject.
>
> This thread is extremely chaotic but by the end the disparity between
> one-dimensional and two-dimensional arrays is shown:
>
> http://forum.java.sun.com/thread.jspa?threadID=5234721&tstart=0
>
> These are the results of JAMA vs a one-dimensional implementation  
> doing
> 2 million matrix multiplication operations on 4x4 matrices (in
> milliseconds):
>
> One Dim Time: 3626
> JAMA Time: 7625
>
> One Dim Time: 3438
> JAMA Time: 7610
>
> One Dim Time: 3235
> JAMA Time: 7516
>
> One Dim Time: 3235
> JAMA Time: 7532
>
> One Dim Time: 3250
> JAMA Time: 7610
>
>
> Giovanny Castro
>
>
> ----- End forwarded message -----
>
>
> <unnamed>



----- End forwarded message -----





Date Index | Thread Index | Problems or questions? Contact list-master@nist.gov