• Advertisement
Sign in to follow this  

Fast Vector Class

This topic is 4505 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

I took the time to write my own vector class. After making a small demo that used it, the demo ran like someone had shot it in the foot. After profiling the code, I find that it's my vector class that's limping along. I found a few classes in teh articles section, now I'm wondering if anyone has their own vector classes they'd be willing to share that they know are fast.

Share this post


Link to post
Share on other sites
Advertisement
I have never had the need to implement my own vector class, but perhaps if you post some more details about your own implementation and profiling results, I can help you optimize it.

First I guess, what operations are giving you trouble, and how do you use the vector? That is, are you seeing something like deletion taking up most of the clock cycles, or resizing, or (insert operation here)?

Second, how are you implementing your vector? Is it backed by a plain array? How do you handle resizing, deleting, and the other non-trivial operations?

Share this post


Link to post
Share on other sites
I'm talking about 3D vector, I guess I should have made that clear at the start...

Share this post


Link to post
Share on other sites
The MTL that stylin posted sounds pretty interesting. You can use a matrix to control the implementation of vectors. The vector class I wrote up is currently being used in the SDL.NET project. The vector class itself can be found here in C#. Enjoy!

Share this post


Link to post
Share on other sites
Quote:
Original post by Rob Loach
The MTL that stylin posted sounds pretty interesting. You can use a matrix to control the implementation of vectors.

They also have an Iterative Template Library that handles solving linear systems. What's interesting is their claim of equal or surpassing performance levels with that of some Fortran implementations.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement