Skip to content

Commit

Permalink
Refs #10305. Applying clang-format to SymmetryOperation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed Jan 24, 2015
1 parent d8f8eb9 commit ef86c95
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class MANTID_GEOMETRY_DLL SymmetryOperation {
SymmetryOperation operator*(const SymmetryOperation &operand) const;
SymmetryOperation inverse() const;

SymmetryOperation operator ^(size_t exponent) const;
SymmetryOperation operator^(size_t exponent) const;

bool operator!=(const SymmetryOperation &other) const;
bool operator==(const SymmetryOperation &other) const;
Expand Down
29 changes: 14 additions & 15 deletions Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,24 @@ SymmetryOperation SymmetryOperation::inverse() const {
}

/// Returns the symmetry operation, applied to itself (exponent) times.
SymmetryOperation SymmetryOperation::operator ^(size_t exponent) const
{
// If the exponent is 1, no calculations are necessary.
if(exponent == 1) {
return SymmetryOperation(*this);
}
SymmetryOperation SymmetryOperation::operator^(size_t exponent) const {
// If the exponent is 1, no calculations are necessary.
if (exponent == 1) {
return SymmetryOperation(*this);
}

SymmetryOperation op;
SymmetryOperation op;

// The same for 0, which means identity in every case.
if(exponent == 0) {
return op;
}
// The same for 0, which means identity in every case.
if (exponent == 0) {
return op;
}

for(size_t i = 0; i < exponent; ++i) {
op = (*this) * op;
}
for (size_t i = 0; i < exponent; ++i) {
op = (*this) * op;
}

return op;
return op;
}

/// Returns true if matrix and vector are equal
Expand Down

0 comments on commit ef86c95

Please sign in to comment.