7

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?

sivabudh
  • 31,807
  • 63
  • 162
  • 228

6 Answers6

4

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.

Community
  • 1
  • 1
Jake Pearson
  • 27,069
  • 12
  • 75
  • 95
  • 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? – sivabudh Nov 04 '09 at 18:41
  • 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 Nov 04 '09 at 19:33
  • I'm quite surprised performance of C# is on par with C. That's great to hear! – sivabudh Nov 04 '09 at 21:41
  • 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 Nov 05 '09 at 02:04
  • 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 Nov 05 '09 at 07:37
4

For java:

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

Hope it helps.

2

Math.NET Numerics supports Mono

sivabudh
  • 31,807
  • 63
  • 162
  • 228
1

Lol..why didnt I think of this before?

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

See the following links:

sivabudh
  • 31,807
  • 63
  • 162
  • 228
  • 1
    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. – redcalx Nov 11 '09 at 21:55
  • 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. – sivabudh Nov 11 '09 at 22:29
  • @the-locster: Intel responded that Mono is not supported *yet*. So man..too bad. – sivabudh Nov 17 '09 at 02:55
1

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 Poda
  • 5,742
  • 3
  • 39
  • 52
0

SuanShu is a large collection of numerical algorithms. It is well supported. It has both a Java and a FREE C# versions.

Ryu
  • 1
  • 2