/// Determines the Hermann-Mauguin symbol of the rotation-, rotoinversion- or
/// screw-axis.
std::string SymmetryElementRotationGenerator::determineSymbol(
    const SymmetryOperation &operation) const {
  const Kernel::IntMatrix &matrix = operation.matrix();

  int trace = matrix.Trace();
  int determinant = matrix.determinant();

  if (trace == 0 && determinant == -1) {
    return "-3";
  }

  std::string symbol;

  if (determinant < 0) {
    symbol += "-";
  }

  symbol += boost::lexical_cast<std::string>(operation.order());

  int translation =
      static_cast<int>(static_cast<double>(operation.order()) *
                       Kernel::V3D(determineTranslation(operation)).norm());

  if (translation != 0) {
    symbol += boost::lexical_cast<std::string>(translation);
  }

  return symbol;
}
Example #2
0
/// Returns a vector with all symmetry operations that are part of the cyclic
/// group defined by the generating operation.
std::vector<SymmetryOperation>
CyclicGroup::generateAllOperations(const SymmetryOperation &operation) const {
  std::vector<SymmetryOperation> symOps(1, operation);
  symOps.reserve(operation.order());
  for (size_t i = 1; i < operation.order(); ++i) {
    symOps.push_back(operation * symOps.back());
  }

  return symOps;
}