MSR F# Interactive, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.4.17, compiling for .NET Framework Version v2.0.50727
>#r “c:\\program files\\vni\\imsl\\imslcs500\\bin\\imslcs.dll”;;
--> Referenced ‘c:\program files\vni\imsl\imslcs500\bin\imslcs.dll’
> open Imsl.Math;;
> let g = Sfun.Gamma(0.5);;
val g : float
Binding session to ‘c:\program files\vni\imsl\imslcs500\bin\imslcs.dll’...
> g;;
val it : float = 1.772453851
>
Figure 1. A sample interactive F# session calling a .NET library.
Java Math Libraries
Java is another platform option along the lines of the .NET Framework. Java is more focused on cross-
platform application development, while .NET is more focused on effective development within the
Windows environment. Java applications and tools will generally work well in heterogeneous Windows
and Unix/Linux environments, for example. Calling C or C++ libraries from Java is an option for some
developers, but when cross-platform solutions are required a pure Java library becomes a requirement.
Java has a very large open source community and some numerical libraries are available in this form.
The Java Matrix Package (JAMA) covers the basics of linear algebra, while the Colt Project expands on
the theme to cover a broader range of algorithms for scientific and technical computing in Java. The
project seeing the most active development with a very ambitious set of future goals is Commons-Math
under the Apache Commons hierarchy of open source projects. The commercial offerings of Java
numerical libraries are not as wide as the other platforms. While there are some industry-specific
commercial tools (especially for financial services and biotech), the only broad commercial math library
for Java is the Visual Numerics JMSL Numerical Library.
SMP Parallelization
With multi-core and many-core hardware becoming commonplace, shared memory parallelization is
becoming more popular. The most common interface for SMP parallelization in the mathematical and
scientific programming communities is OpenMP. By adding OpenMP directives into applications,
supported compilers will take care of a lot of the details of parallelizing the code. Many mathematical
algorithms involve repeated looping over data and very good performance gains can be realized by
parallelizing large outer loops in these algorithms. Since Visual Studio 2005, the Microsoft Visual C++
compiler has supported OpenMP.
In addition to OpenMP and with a focus on the .NET platform, Parallel Extension to .NET Framework 3.5
is currently available as a Community Technology Preview (see
http://www.microsoft.com/downloads/details.aspx). While this is an early release for testing purposes
only, the implementation holds a lot of promise for developers who want to multi-thread their .NET
applications without managing all the details of the thread pool themselves. This release of the Parallel
Extensions is essentially an updated System.Threading library with additional constructs like
“Parallel.For” and “Parallel.ForEach”. This syntax is intuitive for anyone familiar with OpenMP, and thus
adding SMP threading to .NET code with this library is expected to be straightforward. The extension also
includes a System.Threading.Tasks namespace providing support for imperative task parallelism. This
namespace includes the expected Task objects as well as a TaskManager class representing the