NO

Author Topic: Advice on math lib  (Read 3850 times)

triviany

  • Guest
Advice on math lib
« on: December 03, 2008, 04:58:42 PM »
Hi folks,

This is my first post here. First and foremost a big thank you to Pelle and everyone of you out there.

My apologies if this is the wrong place for this post. Point me in the right direction.

I'm in need of some advice on implementing a vector math library in C. Just to give you a brief background: I started programming in C about 6 years ago then moved to C++ before moving to C# (to pay the bills). I've had enough of .NET and the many abstractions and so decided to go back to C and ASM. My passion is gfx & games and I've started creating a vector math library in C for personal use.
The norm out there seems to be to use C++ (with templates blah blah). My C++ isn't that good and needs improving a lot.

So far my design thought process involves:
1. designing a data structure
2. designing & implemeting a function that manipulate the data structures in C first
3. Test it
4. then a vectorized one.
5. then test it.

Please share any advice you have ;D My ego is ready for a battering!

 



pgoh

  • Guest
Re: Advice on math lib
« Reply #1 on: December 08, 2008, 08:12:40 PM »
Don't reinvent the wheel, use an already existing vector library. Something like GSL for C or Boost for C++. With most mathematical algorithms, C++ is just loads better than C due to templates, STL, and operator overloading. If you're after a vectorized library, have a look at SIMDx86.

triviany

  • Guest
Re: Advice on math lib
« Reply #2 on: December 09, 2008, 12:34:23 PM »
I guess the advantage of reinveting the wheel is to learn ;D. I've already learnt a lot as a result of implementing a basic vector library in C/ASM with SIMD. I think I wouldn't be where I am now if I attempted it in C++. However I do agree with you in that it might be better with C++.

I love maths and so I'd rather create my own thing even if it isn't half as good as what is out there.

Anyway, thanks for the advice.

delper

  • Guest
Re: Advice on math lib
« Reply #3 on: December 10, 2008, 04:55:34 AM »
Triviany,

    Go for it boy!    There is always something good from more work on the same topic.   I cannot say whether you are going to be just a programmer or the next Pelles....   C compilers are out there too, right?     But somehow, Pelles did something unique.   So you can too!    As you post it everyone will help you improve it... You'll have to stay on top of it.

    Happy holidays,

triviany

  • Guest
Re: Advice on math lib
« Reply #4 on: December 10, 2008, 10:22:40 AM »
delper,

lol, thank you for your kind words of inspiration. I don't mind being just an average programmer ;D. Everyone has a limit or capacity to their abilities to learn and do stuff. Maybe this is beyond mine, but I'm willing to discover that for myself.

Watch this space.

Happy holidays to you too.
« Last Edit: December 10, 2008, 10:24:28 AM by triviany »