java for math application

Discussion in 'Java' started by Jeremy Watts, Oct 15, 2004.

  1. Jeremy Watts

    Jeremy Watts Guest

    hi,

    i have been writing some mathematics programs in php to do mainly matrix
    algebra, but find that they can be pretty slow for higher order matrices.

    i've tried to improve the algorithms but still for some examples its taking
    a good few seconds in some cases to return the result.

    would you think that a move to java would improve the speed, as java is a
    compilable language?

    thanks
     
    Jeremy Watts, Oct 15, 2004
    #1
    1. Advertising

  2. Jeremy Watts

    John Guest

    Jeremy Watts wrote:

    > hi,
    >
    > i have been writing some mathematics programs in php to do mainly matrix
    > algebra, but find that they can be pretty slow for higher order matrices.
    >
    > i've tried to improve the algorithms but still for some examples its taking
    > a good few seconds in some cases to return the result.
    >
    > would you think that a move to java would improve the speed, as java is a
    > compilable language?
    >
    > thanks
    >
    >


    It might do. If you are doing intensive array manipulation stuff in PHP,
    java could give you a performance improvement. The most important factor
    is not the language though, it's the algorithm.

    If (for example) you are inverting big matrices with a recursive
    approach like you do manually, you will find that performance is crap
    regardless of the language.

    I would use java for this purely because i would find it easier to
    program and debug, and because of the supporting classes provided. I
    would also be prepared to bet a pound to a pinch of rocking-horse shit
    that someone has coded a nice matrix manipulation package already, which
    you could get hold of.

    John
     
    John, Oct 15, 2004
    #2
    1. Advertising

  3. Jeremy Watts wrote:

    > hi,
    >
    > i have been writing some mathematics programs in php to do mainly matrix
    > algebra, but find that they can be pretty slow for higher order matrices.
    >
    > i've tried to improve the algorithms but still for some examples its taking
    > a good few seconds in some cases to return the result.
    >
    > would you think that a move to java would improve the speed, as java is a
    > compilable language?
    >
    > thanks
    >
    >

    might, plus there is some stuff already developed that you can run to
    gauge the speed.


    http://jakarta.apache.org/commons/math
    http://jakarta.apache.org/commons/math/userguide/linear.html
     
    The Abrasive Sponge, Oct 15, 2004
    #3
  4. John wrote:

    <snip>
    > I would also be prepared to bet a pound to a pinch of rocking-horse shit
    > that someone has coded a nice matrix manipulation package already, which
    > you could get hold of.


    Yes, indeed. For example
    http://math.nist.gov/javanumerics/jama/


    --
    Thomas<dot>Fritsch<squiggle>ops<dot>de
     
    Thomas Fritsch, Oct 15, 2004
    #4
  5. John wrote:
    >
    > I would use java for this purely because i would find it easier to
    > program and debug, and because of the supporting classes provided. I
    > would also be prepared to bet a pound to a pinch of rocking-horse shit
    > that someone has coded a nice matrix manipulation package already, which
    > you could get hold of.
    >


    http://dsd.lbl.gov/~hoschek/colt/

    Free and fast.

    Mark Thornton
     
    Mark Thornton, Oct 15, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chirs
    Replies:
    18
    Views:
    787
    Chris Uppal
    Mar 2, 2004
  2. AciD_X
    Replies:
    4
    Views:
    8,129
    Jonathan Turkanis
    Apr 1, 2004
  3. Mark Healey
    Replies:
    7
    Views:
    1,518
    Tim Prince
    May 22, 2006
  4. Philipp
    Replies:
    9
    Views:
    1,148
    Mark Space
    Jul 23, 2008
  5. VK
    Replies:
    15
    Views:
    1,211
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page