* Implementation of GiNaC's symmetry definitions. */
/*
- * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
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;
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