Jag (Java Applied to Geophysics) is our new library for numerical optimization of geophysical problems. It is a Java implementation of the earlier C++ libraries, CLOP and HCL.
Jag consists of an abstract interface level, Jam (Java Applied to Mathematics), and a set of concrete, implemented classes, Juice. Jam and Juice contain abstract algebraic and numerical objects, such as vectors, spaces, operators, and solvers. Both packages could be shared between researchers of almost any computational scientific field. On the other hand, the packages Rsf (Regularly Sampled Function) and Isf (Irregularly Sampled Function) comply with Jam's interfaces, but implement vectors, spaces, and operators that are particular to computational research in geophysics. Additionally, Jag includes a Book package that tests and illustrates Jag's capabilities on some small- to medium-sized research scenarios.
Jag takes full advantage of Java's object-oriented features, such as abstraction, inheritance, and encapsulation, to ensure the collaboration of its current and future classes. We found it much easier to implement our classes in Java than in C++. Specifically, Java's lack of pointers, its automatic garbage collection, and its interface approach to multiple inheritance solved many practical problems we encountered in earlier C++ versions. Most importantly, programming Java was fun.
Unfortunately, Java programs are slow in comparison to C or Fortran implementations. However, new compiler technologies, such as just-in-time compilers, are reducing the performance gap drastically.
Since Jag is implemented in Java, we hope that soon we will routinely publish reproducible research documents Schwab et al. (1996); Schwab and Schroeder (1995) on the Web. Reproducible Web documents could change the way researchers publish and collaborate since it makes computational research tools and results as accessible as a button click (Figure 1).