Fast math api (including vectors)

Im looking for a FREE and very fast math api for java that includes vectors and matrices. Can you recomend anything ? Something compatible with jogl or lwjgl would be preferable.

The LWJGL has some math classes, I haven’t verified their speed, but they seem ok to me! :slight_smile:

vecmath?

DP

You could use the parallel architechture of the GPU and use PBuffers (GL_FLOAT) and fragment-shaders on RGB components. It might not be what you had in mind, but a GPU is a very useful toy.

This may be of interest
http://hoschek.home.cern.ch/hoschek/colt/

Thanks i will give these apis a try.

Wow. That certainly looks interesting. But can it outperform a cpu ?

This bring me memories of when i had an Amiga and was loading chipset assembler code in the video memory to be executed by the Fat Agnus chip. Good times.

It will dwarf the fastest cpu available.

But possibly not if you try to transfer the results back to the CPU. The communication path between the CPU and GPU is often very asymmetric.

That’s why you want to send and receive the data one time. Do everything else in shaders.

Ofcourse this is only efficient if you are processing enormous amounts of data.

I’m building a benchmark now :slight_smile:

Transforming 3d vertices by 4x4 matrix: (on 32bit floats)

CPU P4, 2.4GHz: 80M tris/s
GPU 9700pro: 2840M tris/s (without data upload/readback)
GPU 9700pro: 2.4M tris/s (with data upload/readback)

So much for my previous statements :slight_smile:

If you have data that can remain on GPU (like particle-engines) you’ll have extreme performance.
But it’s not really usable for anything else, it seems.

maybe http://www.gpgpu.org/ is what you’re looking for.

If your looking for fast CPU based math, based on Shawn Kendall’s last tests, the built in math in the 1.4 and beyond VM is damn fast.

If your looking to offload to the gpu, yeah see gpgpu.