Create matrix.cpp

The complete implementation of the matrix library