Now that most of the code has been refactored to use C++ features (classes, STL containers, etc.), we should review the code at some point for any further optimizations. C++ removes most of the memory management, but things like copy constructors and assignment operators can be tricky to implement and can lead to memory overhead if they aren't correct. The main focus is matrix operations -- review places where temporary matrices are created, and make sure that matrix copies don't occur more often than necessary.
I tested memory usage by placing print statements in the copy constructors and move constructors to see when matrices were being copied / moved. Everything looks good so I'm closing this issue.
Now that most of the code has been refactored to use C++ features (classes, STL containers, etc.), we should review the code at some point for any further optimizations. C++ removes most of the memory management, but things like copy constructors and assignment operators can be tricky to implement and can lead to memory overhead if they aren't correct. The main focus is matrix operations -- review places where temporary matrices are created, and make sure that matrix copies don't occur more often than necessary.