]> www.ginac.de Git - ginac.git/blobdiff - ginac/symmetry.cpp
Limiting the costly symmetrization tests inside simplify_indexed() to
[ginac.git] / ginac / symmetry.cpp
index d93e34cb963093952473e7720955befb851a7c2a..a44cfcc5df87d0a8b02d9518d965972883c66620 100644 (file)
@@ -270,6 +270,18 @@ void symmetry::do_print_tree(const print_tree & c, unsigned level) const
 // non-virtual functions in this class
 //////////
 
+bool symmetry::has_nonsymmetric() const
+{
+       if (type == antisymmetric || type == cyclic)
+               return true;
+
+       for (exvector::const_iterator i=children.begin(); i!=children.end(); ++i)
+               if (ex_to<symmetry>(*i).has_nonsymmetric())
+                       return true;
+
+       return false;
+}
+
 bool symmetry::has_cyclic() const
 {
        if (type == cyclic)