Standard matrix operations in C++