]> www.ginac.de Git - ginac.git/blobdiff - ginac/symmetry.cpp
canonicalize() failed to return zero for an antisymmetric combination of two
[ginac.git] / ginac / symmetry.cpp
index 8a766214aaa1024d93eaa1992039622a76115887..c953953a2e55eebf2ee081a84ab6904658cb7adb 100644 (file)
@@ -304,7 +304,7 @@ public:
 
 int canonicalize(exvector::iterator v, const symmetry &symm)
 {
-       // Less than two indices? Then do nothing
+       // Less than two elements? Then do nothing
        if (symm.indices.size() < 2)
                return INT_MAX;
 
@@ -334,6 +334,8 @@ int canonicalize(exvector::iterator v, const symmetry &symm)
                case symmetry::antisymmetric:
                        // Sort the children in ascending order, keeping track of the signum
                        sign *= permutation_sign(first, last, sy_is_less(v), sy_swap(v, something_changed));
+                       if (sign == 0)
+                               return 0;
                        break;
                case symmetry::cyclic:
                        // Permute the smallest child to the front