[CSC 335] Complex Math/Linear Algebra using Java
Andrew Pounds
pounds at sandbox.mercer.edu
Sat Nov 25 15:57:12 EST 2017
So I took some time today to look back over the state of Java for
numerical programming. The "old reliables" of JAMA, JLAPACK and COLT
can still be downloaded (see the class webpage for references).
Recognize -- some of these are OLD and were just abandoned because other
languages VASTLY outperformed pure Java implementations. Some of the
web pages haven't been updated in 15 years. One site showed a 3000x3000
matrix multiply taking around 4 seconds in C/Fortran and 50 seconds in
Java. Java libraries built with Fortran/C back ends were closer to the
pure C/Fortran values.
Newer implementations include the Apache Commons math classes as well as
the JavaNumerics site from NIST. It is clear that people REALLY want a
good Java numerical toolkit as you will even find many webpages
dedicated to it -- there is even a students attempt to wrap the Gnu
Scientific Libraries with java code. The rationale you will find for
the continued development of these Java numerical libraries falls into
two camps...
1. Java is the premier language for introducing CS (which was true 10
years ago, but not so much now) and therefore we should abandon the
older C and Fortran libraries for it because those languages are too
limited.
2. It may be slow, but eventually computers will be so fast nobody will
know the difference.
I contend that Java is a great language -- but it has its place. In my
opinion Java wasn't designed for HPC. As far as the second point goes,
machines will get faster, but by definition the other programming
languages will too. I have heard the same rationale used to defend
Python -- which I love -- but in which I would never write a "production
level" HPC system that had to be really fast.
I will be curious to see how Julia (a newer HPC language) does in this
mix as it is built from C/Fortran and designed to take advantage of the
aspects of those languages that make them ideal for HPC applications.
For those that are curious Mathematica and Matlab were written in C/C++
and Java (you can guess which parts are in C). Octave (which is
available on cobra and is similar to Matlab) was written in C/C++ and
Fortran.
With all that said, if anyone needs an example of how to do complex math
and linear algebra with Java let me know and I'll see what I can cobble
together.
--
Andrew J. Pounds, Ph.D.
Professor of Chemistry and Computer Science
Mercer University, Macon, GA 31207 (478) 301-5627
http://faculty.mercer.edu/pounds_aj
More information about the csc335
mailing list