Esempio n. 1
0
void SymmetryGroup::computeClosure(Permutation const &v) //does this work??
{
  ElementContainer newOnes;

  newOnes.insert(v);

  while(!newOnes.empty())
    {
      Permutation v=*newOnes.begin();
      for(ElementContainer::const_iterator i=elements.begin();i!=elements.end();i++)
        {
          {
            Permutation n=i->apply(v);
            if(0==elements.count(n))
              newOnes.insert(n);
          }
          {
            Permutation n=v.apply(v);
            if(0==elements.count(n))
              newOnes.insert(n);
          }
        }
      newOnes.erase(v);
      elements.insert(v);
    }
}