11#include <boost/algorithm/string.hpp>
17 : m_order(1), m_transposedInverseMatrix(Kernel::
IntMatrix(3, 3, true)), m_reducedVector(), m_identifier(),
18 m_matrixVectorPair() {
174 for (
size_t i = 0; i < exponent; ++i) {
200 if (determinant == 1) {
215 }
else if (determinant == -1) {
232 throw std::runtime_error(
"There is something wrong with supplied matrix.");
238 for (
size_t i = 0; i <
order(); ++i) {
241 for (
size_t j = 0; j < i; ++j) {
245 translationMatrix += tempMatrix;
263 V3R wrappedVector(vector);
265 for (
size_t i = 0; i < 3; ++i) {
266 wrappedVector[i] -= (vector[i].numerator() / vector[i].denominator());
268 if (wrappedVector[i] < 0) {
269 wrappedVector[i] += 1;
273 return wrappedVector;
281 for (
size_t i = 0; i < 3; ++i) {
282 wrappedVector[i] = fmod(vector[i], 1.0);
284 if (wrappedVector[i] < 0) {
285 wrappedVector[i] += 1.0;
289 return wrappedVector;
301 std::string identifier;
302 std::getline(stream, identifier);
304 size_t i = identifier.find_first_of(
'[');
305 size_t j = identifier.find_last_of(
']');
307 if (i == std::string::npos || j == std::string::npos) {
308 throw std::runtime_error(
"Cannot construct SymmetryOperation from identifier: " + identifier);
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.
static std::string getNormalizedIdentifier(const MatrixVectorPair< int, V3R > &data)
Returns a Jones faithful representation of the symmetry operation characterized by the supplied matri...
static MatrixVectorPair< int, V3R > parseIdentifier(const std::string &identifier)
Tries to parse the given symbol.
Crystallographic symmetry operations are composed of a rotational component, which is represented by ...
SymmetryOperation inverse() const
Returns the inverse of the symmetry operation.
std::string identifier() const
Returns the string-identifier for this symmetry operation.
V3R getReducedVector(const Kernel::IntMatrix &matrix, const V3R &vector) const
size_t getOrderFromMatrix(const Kernel::IntMatrix &matrix) const
Returns the order of the symmetry operation based on the matrix.
void init(const MatrixVectorPair< int, V3R > &matrixVectorPair)
Initialize from matrix and vector.
bool operator==(const SymmetryOperation &other) const
Returns true if matrix and vector are equal.
bool isIdentity() const
Returns true if this is the identity operation.
const Kernel::IntMatrix & matrix() const
Returns a const reference to the internally stored matrix.
T operator*(const T &operand) const
Returns the transformed vector.
bool operator<(const SymmetryOperation &other) const
Returns true if SymmetryOperation is "smaller" than other, determined by using the identifier strings...
Kernel::V3D transformHKL(const Kernel::V3D &hkl) const
Transforms an index triplet hkl.
Kernel::IntMatrix m_transposedInverseMatrix
bool operator!=(const SymmetryOperation &other) const
Returns true if operatios are not equal.
SymmetryOperation operator^(size_t exponent) const
Returns the symmetry operation, applied to itself (exponent) times.
const V3R & reducedVector() const
SymmetryOperation::reducedVector.
bool hasTranslation() const
Returns true if the operation has a translational component.
SymmetryOperation()
Default constructor, results in identity.
MatrixVectorPair< int, V3R > m_matrixVectorPair
size_t order() const
Returns the order of the symmetry operation.
const V3R & vector() const
Returns a const reference to the internall stored vector.
T determinant() const
Calculate the determinant.
T Invert()
LU inversion routine.
T Trace() const
Trace of the matrix.
Matrix< T > & Transpose()
Transpose the matrix.
MANTID_GEOMETRY_DLL std::istream & operator>>(std::istream &stream, SymmetryOperation &operation)
Reads identifier from stream and tries to parse as a symbol.
boost::rational< int > RationalNumber
V3R :
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
MANTID_GEOMETRY_DLL V3R getWrappedVector(const V3R &vector)
Wraps a V3R to the interval (0, 1].
MANTID_GEOMETRY_DLL SymmetryOperation getUnitCellIntervalOperation(const SymmetryOperation &symOp)
Returns a SymmetryOperation with the vector wrapped to the interval (0, 1].
Mantid::Kernel::Matrix< int > IntMatrix