Added homomorphism testing mechanism to matrix class c++