Hi all, I'm implementing the rigid body physics in C++ for learning purpose. Until now I used glm library to represent 3x3 and 4x4 matrices but now I need to represent arbitrary NxM matrices whose dimension is known at run time. So I wonder which is the best way to represent them.
I run into the following alternatives:
- std::vector<std::vector<float>>: simple to handle, but I'm afraid of the possible overehead of the data structure
- float**: a pointer to pointer, I think it's the more efficient solution but needs additional code to manage carefully the memory allocation/deallocation
- using c++ smart pointers: I think this solution needs less effort than the second one, but again I wonder how much is the overhead
Any thought ?
Thank you!