Mantid
Loading...
Searching...
No Matches
GroupTransformation.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 +
10
11#include <functional>
12
13namespace Mantid::Geometry {
14
15using namespace Kernel;
16
19 : m_matrixVectorPair(operation) {
21}
22
24GroupTransformation::GroupTransformation(const std::string &operationString)
25 : GroupTransformation(parseMatrixVectorPair<double>(operationString)) {}
26
29 std::vector<SymmetryOperation> groupOperations = other.getSymmetryOperations();
30
31 std::vector<SymmetryOperation> transformedOperations;
32 transformedOperations.reserve(groupOperations.size());
33
34 using std::placeholders::_1;
35
36 std::transform(groupOperations.cbegin(), groupOperations.cend(), std::back_inserter(transformedOperations),
37 std::bind(&GroupTransformation::transformOperation, this, _1));
38
39 return Group(transformedOperations);
40}
41
44 return GroupTransformation(m_matrixVectorPair.getInverse());
45}
46
62 m_inversePair * MatrixVectorPair<double, V3R>(convertMatrix<double>(operation.matrix()), operation.vector()) *
64
66}
67
69
70} // namespace Mantid::Geometry
SymmetryOperation transformOperation(const SymmetryOperation &operation) const
Transforms the operation using the internally stored SymmetryOperation.
GroupTransformation(const MatrixVectorPair< double, V3R > &operation)
Constructor using MatrixVectorPair.
Group operator()(const Group &other) const
Transforms the supplied group and returns the result.
GroupTransformation getInverse() const
Returns the inverse transformation.
MatrixVectorPair< double, V3R > m_inversePair
MatrixVectorPair< double, V3R > m_matrixVectorPair
The class Group represents a set of symmetry operations (or symmetry group).
Definition: Group.h:135
const VectorType & getVector() const
Returns a const reference to the stored vector.
const Kernel::Matrix< MatrixNumericType > & getMatrix() const
Returns a const reference to the internally stored matrix.
Crystallographic symmetry operations are composed of a rotational component, which is represented by ...
const Kernel::IntMatrix & matrix() const
Returns a const reference to the internally stored matrix.
const V3R & vector() const
Returns a const reference to the internall stored vector.
MANTID_GEOMETRY_DLL V3R getWrappedVector(const V3R &vector)
Wraps a V3R to the interval (0, 1].
MatrixVectorPair< T, V3R > parseMatrixVectorPair(const std::string &matrixVectorString)
Tries to parse the given string.