Calculates the exponentiation of a matrix.