Arithmetic operations for matrices (C++).