Sign in to follow this  

Maths!

This topic is 4490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

There are tons of libraries out there. Assuming you are on DX, use the DX provided library. Otherwise, the Intel Small Matrix Library (free, somewhere in the Intel site) is good, optimized for both SSE and SSE2.

frob.

Share this post


Link to post
Share on other sites
Thx for all the suggestions...

but for some reasons im not surprised there is no tangible vector, matrices and quaternion package in there!

there is no well known ressource?

thx

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by golgoth
there is no well known ressource?


I don't think so. There are a few issues:
1) There's no one size fits all. Different implementations and interfaces depending on your needs.
2) All of these implementations and interfaces are easy to write.
3) Because there hasn't been a main contender, everyone has their own "in house" version that they're not likely to switch from.
All of these together mean there isn't a definitive implementation.

Share this post


Link to post
Share on other sites
Don't worry about things that brag about being "SIMD/SSEx optimized". It's total crap. (I've written many thousands of lines of 'real' optimized SSE, so I know.) Just get a nice math lib that does what you need (Ogre3d.org's was pretty thorough).

Some routines that are math-heavy will benefit impressively from SIMD but they need to be written specifically for it, and that is not trivial. Don't think that some 'optimized' math lib will magically do that part for you.

Share this post


Link to post
Share on other sites
Quote:
Original post by golgoth
Thx for all the suggestions...

but for some reasons im not surprised there is no tangible vector, matrices and quaternion package in there!

there is no well known ressource?

thx
What, "Tangible"?!?! you wanted one that you could physically touch?[lol]

I don't understand how the link I posted couldn't be exactly what you were looking for. Maybe you need to better explain what you're after.

Share this post


Link to post
Share on other sites
Quote:
Original post by ajas95
Don't worry about things that brag about being "SIMD/SSEx optimized". It's total crap. Just get a nice math lib that does what you need.
Some routines that are math-heavy will benefit impressively from SIMD but they need to be written specifically for it, and that is not trivial. Don't think that some 'optimized' math lib will magically do that part for you.

I agree about it generally being crap since SIMD programming is not a trivial task. Let the optimizing compiler handle that for you and spend your time on low-hanging fruit.

In reference to the intel SML libraries specifically, if you use them as your only storage for vector and matrix storage, they have a small performance benefit. Obviously this means non-DX rendering, and perhaps a slowdown when interfacing with your physics engine unless they have an interface for MMX/XXM data transfers, as a few commercial engines do.

The intel Small Matrix Library is from the chip manufacturer who designed SSE. The code has been extensively reviewed by various communities. They have the normal 3x1, 1x3, 3x3, 3x4, 4x4, etc. matrix items, which are not difficult to find and aren't that much of a performance gain in practice. The bigger benefit in my mind is their arbitrary-sized matrix routines optimized for SSE, and generation of specifically-sized matrix routines that can be further optimized by the compiler. This is useful when maniuplating Voroni/Delaunay calculations or other matrix-heavy calculations. I'm not aware of a faster, more efficient general purpose matrix library for the PC.

If somebody is looking for a good, fast matrix library for a non-DX application, the intel SML is a great solution.

frob.

Share this post


Link to post
Share on other sites
u mean this?

http://www.intel.com/design/pentiumiii/sml/

The demo is already precompiled as a dll... im still looking for the source!

thx again

[Edited by - golgoth on September 1, 2005 11:13:09 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by golgoth

The demo is already precompiled as a dll... im still looking for the source!

thx again


https://vecmath.dev.java.net/

There is a readable source. IIRC with something like quaternions as well.

Share this post


Link to post
Share on other sites
Quote:
Original post by golgoth
The demo is already precompiled as a dll... im still looking for the source!

That is a fairly old link. The source is available at the wayback machine for that URL. That old version only supports basic things like matrix identity loading, multiply, cross products, and the like. Those are a dime a dozen, and probably what the other posters were referring to.

You asked about 'a reliable math resource' for matrix and vector math, not just a trivial matrix multiply tool. As I said in my last post, if that's all you're looking for, don't bother with any particular matrix library. The real benefit is for actually important matrix operations. Trivial matrix operations don't benefit very much from this type of library, and may actually be slower from switching the FPU/MMX/XMM state so often.

The current version of the SML has many USEFUL and FAST matrix functions, such as finding the trace, determinent, norms, and various decomposition functions including LU, Cholesky, and QR decomposition. It also has some linear equation solvers, but there are faster (less stable) algorithms that are normally used in games at runtime. (Of course, importing maps and offline/development processing can benefit from these.)

These operations are VERY useful if you decide to manipulate connectivity graphs, write an AI that's smarter than a simple state machine or can intellegently handle user-provided maps, or implement many other 'serious' algorithms.

The SML is currently part of the Integrated Performance Primatives library. (cheap $, free for noncommercial).

We use the IPP for a few things, and the dlls provided are nicely optimized with runtime CPU selection, 64-bit support, HT support, multi-core support, and similar niceties for a wide range of algorithms. The entire IPP package is about 150 MB.

frob.

Share this post


Link to post
Share on other sites
I think this will be the best bet so far for realtime 3d:

http://www.intel.com/design/pca/applicationsprocessors/swsup/gppv40_linux.htm

I ll look into it!

THX for the reliable ressource!

Share this post


Link to post
Share on other sites
Quote:
Original post by random_thinker
Has anyone used the Intel math library on non-intel processors? And do you need an Intel compiler to use it?

The IPP libraries work just fine on AMD chips. It unfortunately doesn't use AMD-specific instructions, but it does pick the fastest set of routines in it's library for the chipset, including dual-CPU using OpenMP (mostly of interest in the image processing libraries of the IPP).

frob.

Share this post


Link to post
Share on other sites

This topic is 4490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this