views:

554

answers:

5

We currently have a high-performance scientific application written in C++ that makes use of Intel Math Kernel Library.

We are considering writing a benchmark application written in Java and .NET/C# to compare the performance difference. To do that, we also need a good (commercial is preferred) math library for both. Does anyone know of any math equivalent library for Java/C#?

As a sidenote: C++ has Intel TBB library to help with multithreading. Does .NET/C# and Java have something equivalent?

+3  A: 

I can help with C#:

Here is another SO question that discusses various C# math libraries

And you can take a look at PLINQ for C# multithreading help.

Jake Pearson
hey..thanks for that link. Btw..are you in a scientific community? If so, do you use C# at work? do you have any experience with any C# (high-performance) math lib?
ShaChris23
I write a discrete event simulation application called Micro Saint Sharp. We switched from C to C# 7 years ago. The performance is great. I don't use any external math libraries. The only special math class we use is for calculating various random distributions, performance of it has never been a simulation bottleneck.
Jake Pearson
I'm quite surprised performance of C# is on par with C. That's great to hear!
ShaChris23
Our previous engine was written in C, but the simulation scripting engine was interpreted. Now the simulation is compiled C#, so the performance is about 1000x over the old system. I suspect carefully tuned C would beat C# for a lot of very heavy math operations.
Jake Pearson
Yeah, I found that the differential between C# and hand-tuned SIMDified microoptimzed C for linear algebra was about 10x. But that's a special case.
Crashworks
+2  A: 

For java:

http://acs.lbl.gov/~hoschek/colt/

Hope it helps.

Hanuman
It seems like that project has not been updated in a long time (since 2004?)
ShaChris23
+1  A: 

Lol..why didnt I think of this before?

Just use Intel MKL Math library in Java and .NET!

See the following links:

ShaChris23
The main argument is that the resulting C# code is no longer portable to e.g. mono/linux because it is reliant on an API/DLL running outside of the CLR.
locster
thanks for the good thoughts. I posted a question on the Intel MKL forum to see if the MKL linux version will work with the Mono implementation or not. If not, what is their plan. Thanks again.
ShaChris23
@the-locster: Intel responded that Mono is not supported *yet*. So man..too bad.
ShaChris23
A: 

Math.NET Numerics supports Mono

ShaChris23
+1  A: 

ALGLIB is a cross-platform numerical analysis and data processing library. And it is free - ALGLIB is distributed under a GPL license (version 2 or later). It contains:

Differential equations

Linear equations

Matrix and vector operations, Eigenvalues and eigenvectors

Numerical integration, Interpolation and fitting, Optimization

FFT, convolution, correlation

Statistics: general algorithms, Hypothesis testing

Data analysis: classification, regression, other tasks

Special functions

Mikhail