]> www.ginac.de Git - ginac.git/commitdiff
Improved clifford_moebius_map() [V.Kisil]
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 1 Aug 2007 22:27:25 +0000 (22:27 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 1 Aug 2007 22:27:25 +0000 (22:27 +0000)
ginac/clifford.cpp

index a434a882b804207a4c67b058cf776932ea20bfeb..6e0d36c25fa5c0206a76d2041e3e707557f2959f 100644 (file)
@@ -1324,11 +1324,10 @@ ex clifford_moebius_map(const ex & a, const ex & b, const ex & c, const ex & d,
 
 ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl)
 {
 
 ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char rl)
 {
-       if (is_a<matrix>(M)) 
-               return clifford_moebius_map(ex_to<matrix>(M)(0,0), ex_to<matrix>(M)(0,1),
-                                           ex_to<matrix>(M)(1,0), ex_to<matrix>(M)(1,1), v, G, rl);
+       if (is_a<matrix>(M) && (ex_to<matrix>(M).rows() == 2) && (ex_to<matrix>(M).cols() == 2)) 
+               return clifford_moebius_map(M.op(0), M.op(1), M.op(2), M.op(3), v, G, rl);
        else
        else
-               throw(std::invalid_argument("clifford_moebius_map(): parameter M should be a matrix"));
+               throw(std::invalid_argument("clifford_moebius_map(): parameter M should be a 2x2 matrix"));
 }
 
 } // namespace GiNaC
 }
 
 } // namespace GiNaC