Is there any standard library of Matrix in c. Which I can implement across the platform. If not then kindly tell me OS dependent libraries of Matrix.
2 Answers
There are so many.
In particular, you might want to look at the GNU scientific library.
Alternatively, you can just implement your own matrix operations.
Re cross platform:
GSL is very cross platform. According to the site, it compiles on around 12 operating systems (Solaris, Linux, darwin, various *BSDs and something called a SR8000 Super Technical Server). I would guess it could be compiled on embedded systems as well. For windows, you can either use cygwin or Gsl for Windows.
Which platforms are you planning on using?

- 45,033
- 10
- 85
- 120
-
I actually want the standard library which I can implement across the platform. – Siddiqui Jan 04 '10 at 05:43
-
What do you mean by "which I can implement"? Don't you want a library that's *already* implemented so you can use it to do whatever you want with matrices? – Alok Singhal Jan 04 '10 at 06:05
-
@Arman - see updates above. GSL should run on just about anything. – Seth Jan 04 '10 at 06:16
-
No, don't implement your own. It is difficult to do this correctly. Using a wrapper for BLAS (eg. GSL, but also plain CBlas) *will* get you an order of magnitude better performance. – Alexandre C. Aug 08 '11 at 16:10
-
@Alexandre - It's probably difficult to implement an entire linear algebra library like BLAS. However, if all you just need adds or multiplies, that's almost trivial to implement. Your solution will likely be less general, possibly slower, but compare 15 minutes of dev time vs. *n* hours to download configure compile and integrate a linear algebra library. It depends on need, and on that point OP wasn't specific. – Seth Aug 08 '11 at 18:26
Meschach seems to be the only popular C-based matrix library. There are tons of C++ based matrix libraries however.
The main question however is for what purpose you need that library. If for mathematical linear algebra, you should rather find a linear algebra library, so you have all your operations in one place (BLAS based, for example spblas). If however you need matrix3 and matrix4 types for 3D calculations, you should try to find one that is optimized for 3x3 or 4x4 operations, like this one).

- 55,802
- 15
- 111
- 149