]> www.ginac.de Git - ginac.git/blobdiff - ginac/symmetry.cpp
Extend copyright to 2011.
[ginac.git] / ginac / symmetry.cpp
index 9e00a8c843633fdfece0c0ab9715343a9ddd7e02..7d1ff9785298484b97d0fc0dacbaee9b71e8cf7d 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's symmetry definitions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2011 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
@@ -160,7 +160,7 @@ int symmetry::compare_same_type(const basic & other) const
                return 1;
        if (this_size < that_size)
                return -1;
-       typedef std::set<unsigned>::iterator set_it;
+       typedef std::set<unsigned>::const_iterator set_it;
        set_it end = indices.end();
        for (set_it i=indices.begin(),j=othersymm.indices.begin(); i!=end; ++i,++j) {
                if(*i < *j)
@@ -190,7 +190,8 @@ unsigned symmetry::calchash() const
 
        if (type == none) {
                v = rotate_left(v);
-               v ^= *(indices.begin());
+               if (!indices.empty())
+                       v ^= *(indices.begin());
        } else {
                for (exvector::const_iterator i=children.begin(); i!=children.end(); ++i)
                {