JavaTools

JavaTools: Extending the Mathematica system with all Java features! Empowering the Mathematica user with the efficiency, speed, concurrency, platform-independence, and stability of the modern Java HotSpot platform for true power-programming!

All functions at a glance:

JavaCode Compilation Examples
American Options Examples
Network Flow Optimization Examples
Calculus and Linear Algebra Examples
JTableView and JTableViewEdit
Java Windows Examples
Java Utility Functions Examples


Data Structures/Collections included in JavaTools:

Deque Examples
Queue Examples
Stack Examples
Set Examples
BiMap Examples
Multimap Examples
MultiSet Examples
Collections Processing Examples


Browsers included in JavaTools:

Interactive Symbol Browser
Interactive Expression Browser


JavaTools lets you write static Java methods in a Mathematica string and compile directly from Mathematica and then load back into Mathematica and execute from Mathematica as a symbol! That means you get the compiled speed of Java (as the execution environment is the Java virtual machine and not the Mathematica kernel!), while at the same time constructing the string of Java code in Mathematica! This is similar to the new C Compile option in Mathematica version 8, but with Java (instead of C)! No need to program Java code in a separate IDE, no need to deploy separate .jar or .class files, do all the Java code directly from the Mathematica front-end (or the WorkBench).

JavaTools provides extremely fast and precise parallel American options valuations (along with Delta, Gamma, Theta) that, unlike the new FinancialDerivative function introduced in Mathematica version 8, can operate with discrete dividends. FinancialDerivative can handle only a dividend yield, which professional practitioners reject for short times to maturity due to poor precision. The American options functions in JavaTools use a thread pool from the concurrency framework in Java to execute parallel tasks simultaneously, which means your speed performance scales up as determined by Amdahl's Law. The execution is done with low-level Java/machine code, spawned over parallel threads, not with parallel kernels executing high-level Mathematica code!

JavaTools contains state-of-the-art network flow optimization / graph theory functions and other minimization functions that beat the speed of the (symbolic) Mathematica implementations by magnitudes. In fact, on several large-scale problems Mathematica is not even able to produce a result (even the latest version 8.0.1!), whereas JavaTools had no problem solving them fast (for more, see the Network Flow/Graph Theory page). These functions include Dijkstra, Floyd/Warshall, revised MooreBellmann, modified Kruskal, and two proprietary algorithms for the Travelling Salesman Problem, with a proprietary post-optimization function.

JavaTools also contains functions for Calculus and Linear Algebra, which beat the Mathematica implementations, and even correct errors the Mathematica functions produce.

With JavaTools the user has two functions similar to the (experimental and undocumented) Mathematica function TableView. Unlike with TableView, the data entered by the user can be stored in a symbol and is type-checked, to prevent clerical errors when entering data manually. The tables created with JavaTools' table view function can be customized, formatted with user-defined alternating line background colors, and displayed in the Mathematica front-end for better display.

JavaTools provides Mathematica symbols for the data structures Stack, Queue, Deque, Set, BiMap, Multimap, and MultiSet, using the collections framework for Java as well as the Google Collections (now part of Google Guava) internally. Querying and manipulating these data structures is easy and fast, again entirely through Mathematica symbols, but executing in the Java VM!

JavaTools contains the Interactive Symbol Browser, which is a very convenient tool to quickly find symbols with a certain name, or that contain a certain name. In the filter field the user can enter parts of the expression or regex for instant, interactive filtering of Mathematica symbols. With thousands of standard symbols, thousands of package symbols, and hundreds or thousands of user symbols, this is a very time-efficient way to "browse" and search the symbols live and instantly.

JavaTools also contains the Interactive Expression Browser, which provides an interactive expression viewer for any Mathematica expression to make it easier to understand deeply nested expression trees. Every node can be expanded or collapsed, allowing the user to interactively study only those parts of the expression tree that are of interest and ignore the branches the user is not interested in.

Absolutely no Java programming is required to use JavaTools, as all Java functions are conveniently accessed through Mathematica symbols! However, all Java objects are fully exposed through their object references, so the advanced JLink/Java programmer can easily manipulate these objects in a Java paradigm directly from Mathematica!

By "outsourcing" certain computations and data structures to the Java virtual machine, instead of keeping them in the Mathematica kernel, the user also gains additional memory-related advantages, beyond the speed advantages. Not only do "number crunching" numeric computations run much faster on the Java virtual machine, but the Java virtual machine also has much better memory management features than the Mathematica kernel, as is further explained in the memory examples on the Utilities Page. Simply stated, the Java virtual machine has automatic garbage collection, the Mathematica kernel does not, and the Java virtual machine releases unused memory back to the operating system, which the Mathematica kernel does not either.

Copyright (c) 2011 Andreas Lauschke Consulting. All Rights Reserved.