Beispiel #1
0
/// Returns true if the inverse of each element is in the group
bool Group::eachElementHasInverse() const {
  // Iterate through all operations, check that the inverse is in the group.
  for (auto op = m_allOperations.begin(); op != m_allOperations.end(); ++op) {
    if (!containsOperation((*op).inverse())) {
      return false;
    }
  }

  return true;
}
Beispiel #2
0
/// Returns true if the inverse of each element is in the group
bool Group::eachElementHasInverse() const {
  // Iterate through all operations, check that the inverse is in the group.
  for (const auto &operation : m_allOperations) {
    if (!containsOperation(operation.inverse())) {
      return false;
    }
  }

  return true;
}
Beispiel #3
0
/// Returns true if the group has the identity element.
bool Group::hasIdentity() const {
  // Since the identity element does not change, this is an easy check.
  return containsOperation(SymmetryOperation());
}