Mantid
Loading...
Searching...
No Matches
CyclicGroup.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9#include <memory>
10
11namespace Mantid::Geometry {
12
15CyclicGroup::CyclicGroup(const std::string &symmetryOperationString)
16 : Group(generateAllOperations(SymmetryOperationFactory::Instance().createSymOp(symmetryOperationString))) {}
17
20 : Group(generateAllOperations(symmetryOperation)) {}
21
24std::vector<SymmetryOperation> CyclicGroup::generateAllOperations(const SymmetryOperation &operation) const {
25 std::vector<SymmetryOperation> symOps(1, operation);
26 symOps.reserve(operation.order());
27 for (size_t i = 1; i < operation.order(); ++i) {
28 symOps.emplace_back(operation * symOps.back());
29 }
30
31 return symOps;
32}
33
34} // namespace Mantid::Geometry
CyclicGroup(const std::string &symmetryOperationString)
Construct cyclic group from one symmetry operation by applying it to itself until identity is obtaine...
Definition: CyclicGroup.cpp:15
std::vector< SymmetryOperation > generateAllOperations(const SymmetryOperation &operation) const
Returns a vector with all symmetry operations that are part of the cyclic group defined by the genera...
Definition: CyclicGroup.cpp:24
The class Group represents a set of symmetry operations (or symmetry group).
Definition: Group.h:135
Crystallographic symmetry operations are composed of a rotational component, which is represented by ...
size_t order() const
Returns the order of the symmetry operation.
Manage the lifetime of a class intended to be a singleton.