Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / math / matrix.h
index 9fcec3f3886f9dbd3df934a45e9deb635921e945..c4b428c9ea2b94919db0dc86fee4ad40cdbcb731 100644 (file)
@@ -55,24 +55,24 @@ namespace gmx
 /*! \brief Three-by-three matrix of ElementType.
  * \tparam ElementType type of element to be stored in matrix
  */
-template <class ElementType>
-using BasicMatrix3x3 = MultiDimArray<std::array<ElementType, 3*3>, extents <3, 3> >;
+template<class ElementType>
+using BasicMatrix3x3 = MultiDimArray<std::array<ElementType, 3 * 3>, extents<3, 3>>;
 
 /*! \brief Three-by-three real number matrix.
  * \note will replace the C-style real[3][3] "matrix"
  */
-using Matrix3x3          = BasicMatrix3x3<real>;
+using Matrix3x3 = BasicMatrix3x3<real>;
 //! Convenience alias for a matrix view
-using Matrix3x3Span      = Matrix3x3::view_type;
+using Matrix3x3Span = Matrix3x3::view_type;
 //! Convenience alias for a const matrix view
 using Matrix3x3ConstSpan = Matrix3x3::const_view_type;
 
 //! Determinant of a 3x3 matrix
 constexpr real determinant(Matrix3x3ConstSpan matrix)
 {
-    return (  matrix(0, 0)*(matrix(1, 1)*matrix(2, 2)-matrix(2, 1)*matrix(1, 2))
-              -matrix(1, 0)*(matrix(0, 1)*matrix(2, 2)-matrix(2, 1)*matrix(0, 2))
-              +matrix(2, 0)*(matrix(0, 1)*matrix(1, 2)-matrix(1, 1)*matrix(0, 2)));
+    return (matrix(0, 0) * (matrix(1, 1) * matrix(2, 2) - matrix(2, 1) * matrix(1, 2))
+            - matrix(1, 0) * (matrix(0, 1) * matrix(2, 2) - matrix(2, 1) * matrix(0, 2))
+            + matrix(2, 0) * (matrix(0, 1) * matrix(1, 2) - matrix(1, 1) * matrix(0, 2)));
 }
 
 //! Calculates the trace of a 3x3 matrix view
@@ -85,9 +85,9 @@ constexpr real trace(Matrix3x3ConstSpan matrixView)
 static Matrix3x3 transpose(Matrix3x3ConstSpan matrixView)
 {
 
-    return Matrix3x3({matrixView(0, 0), matrixView(1, 0), matrixView(2, 0),
-                      matrixView(0, 1), matrixView(1, 1), matrixView(2, 1),
-                      matrixView(0, 2), matrixView(1, 2), matrixView(2, 2)});
+    return Matrix3x3({ matrixView(0, 0), matrixView(1, 0), matrixView(2, 0), matrixView(0, 1),
+                       matrixView(1, 1), matrixView(2, 1), matrixView(0, 2), matrixView(1, 2),
+                       matrixView(2, 2) });
 }
 
 //! Create new matrix type from legacy type.