Sign in to follow this  
Numsgil

Fast Vector Class

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
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
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

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