Nevertheless, we intend to use Jest for large scale problems. To improve Jest's performance, we implement computationally intensive routines in C and link them with Jest objects. Java's native method mechanism easily facilitates the linking of C and Java routines. A Java program that invokes a C routine remains platform-independent if the method invocation is programmed to default to the Java version, when a native version is unavailable.
Typically, a Jest programmer prototypes and tests his program in an all-Java version. If the performance is insufficient, the programmer can profile the application and decide which part of the code to replace by a native method. We expect that straightforward numerical code, such as a convolution kernel, might need to be translated from Java to C, while algorithmically complex code, such as a solver, will not.
Alternatively, Jacob and Karrenbach report a performance comparable to Fortran when they combine Jest, a specialized compiler (JavaParty), and parallel computers in the optimization of a a large-scale geophysical inversion problem. Unfortunately, to yield that performance, their compiler required a non-standard class modifier regarding the distribution of parallelized objects.
Besides better performance,
I wish Java contained a primitive type for complex numbers
and the ability to overload the array index operator [].
For the same reasons that
Java offers float and double primitive types, it should
include a complex-number primitive type:
such a complex-number primitive is important in many applications,
a class implementation incurs unacceptable inefficiencies, and
only a primitive type offers the concise and intuitive arithmetic operators,
such as `+'.
Alternatively,
a complex number can be simply represented by two floats.
However, the lack of a single complex-number type and its associated methods
is error-prone, tedious, and not object-oriented.
Without a primitive type for complex numbers, we had to choose between an elegant complex-number class or an efficient representation by a pair of floats. We partially side stepped this difficulty by implementing a class for an array of complex numbers. Such an array justifies the class overhead, which was prohibitive for a single complex number, and simultaneously hides the representation of a complex number as a pair of floats. However, using individual complex numbers remains inefficient or tedious unless Java adds a complex-number primitive type.
I wish the [] indexing operator
could be overloaded in Java.
Again,
a multi-dimensional array is
a fundamental structure in science and engineering applications.
Internally the array might be stored as a Java array, a Java vector,
or a huge out-of-core data file.
Independent of the internal structure, applications need to index the
array elements with a general indexing operation.
Only the [] indexing operator offers the conciseness that
matches the operation's simplicity.
Since Java generally does not overload operators,
only classes with an internal Java array representation can offer
the desired [] indexing operator.
In our applications, we could not forego the conciseness of the array index expression and consequently had to pierce the encapsulation of our array-like vector classes to ensure access by index for operators. Therefore, the array-like Rsf vector and its operators are more closely linked than I wish. Additionally, our classes offer function calls to access individual array elements. However, I find such calls unintuitive, especially when the arguments include index and element values (f.setDatum(3,3.f)). I was not able to devise a general solution based on enumerations. In summary, I do not know how to write application classes with concise, but general, indexing operators for array-type data implemented by structures other than the original Java array.
I believe Java's future in science and engineering will be greatly enhanced if those two shortcomings - a primitive complex-number type and overloading the index operator - were redressed. Java designers should not underestimate the importance of science and engineering as sources of innovation and education.