High-performance Math library for .NET /C# and Java [closed]
Asked Answered
P

6

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?

Pilpul answered 4/11, 2009 at 18:27 Comment(3)
have you thought about just writing a wrapper for the C++ library for C# and Java?Bop
Java has java.util.concurrent and subpackages. I'm not too familiar with TBB, but this is Sun's way of doing threading.Paquette
@Aaron: yeah..i've thought about that too. thanks about the comment though.Pilpul
P
1

Lol..why didnt I think of this before?

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

See the following links:

Pilpul answered 4/11, 2009 at 18:27 Comment(3)
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.Kazmirci
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.Pilpul
@the-locster: Intel responded that Mono is not supported yet. So man..too bad.Pilpul
G
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.

Genic answered 4/11, 2009 at 18:38 Comment(5)
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?Pilpul
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.Genic
I'm quite surprised performance of C# is on par with C. That's great to hear!Pilpul
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.Genic
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.Crosshatch
A
4

For java:

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

Hope it helps.

Assoil answered 4/11, 2009 at 18:50 Comment(1)
It seems like that project has not been updated in a long time (since 2004?)Pilpul
P
2

Math.NET Numerics supports Mono

Pilpul answered 4/11, 2009 at 18:27 Comment(0)
G
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

Gallinule answered 4/11, 2009 at 18:27 Comment(0)
P
1

Lol..why didnt I think of this before?

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

See the following links:

Pilpul answered 4/11, 2009 at 18:27 Comment(3)
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.Kazmirci
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.Pilpul
@the-locster: Intel responded that Mono is not supported yet. So man..too bad.Pilpul
P
0

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

Pillar answered 4/11, 2009 at 18:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.