Update matmul.cpp

The assertion 'mat.size = size' is too strict, as it does not allow the dot product of rectangular matrices e.g. rows and column vectors.