In an existing project, I see a class Vector_3d, templated, with the usual operations for vectors (in the sense of algebra). After profiling, I noticed that a large amount of the time is spent in this class.
I was wondering if there was a well-known implementation of such a basic concept as a 3d vector in C++. Indeed, it might be easier to use a good implementation of the vector instead of trying to optimize this one.
Edit:
This is in a context of a geometrical representation of some objects. But it is independent from any visualization. I will see if there is a way of avoiding to call the various methods too often. And I will have a look at the proposed packages.
There is no much room for improvement in a 3d vector class (basically, dot / cross products are fairly easy, matrix multiplication as well).
If so much time is spent in that class, maybe your code using it is flawed. Have you checked against
I know that there is QVector3D in Qt, that might help you (by the way, they got Vector 2D and 4D as well for common 3D geometry operations)