diff --git a/cmake/modules/ALL.cmake b/cmake/modules/ALL.cmake index 8372706a45..5e77c94335 100644 --- a/cmake/modules/ALL.cmake +++ b/cmake/modules/ALL.cmake @@ -2,7 +2,7 @@ option(ENABLE_GPROF "Use the GNU profiler (gprof)" OFF) if(ENABLE_GPROF) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") endif() option(ENABLE_ALLLBL "Enable ALL load balancing library" OFF) diff --git a/src/molecules/Quaternion.cpp b/src/molecules/Quaternion.cpp index 9a9605b059..eaa5796e6d 100644 --- a/src/molecules/Quaternion.cpp +++ b/src/molecules/Quaternion.cpp @@ -1,8 +1,6 @@ #include "Quaternion.h" #include -#define VECTOR3_ZERO ((std::array){ 0, 0, 0 }) - Quaternion::Quaternion(const double& alpha_rad, const std::array& n) { // normalize rotation axis vector n @@ -43,8 +41,8 @@ void Quaternion::multiply_left(const Quaternion& q) { } std::array Quaternion::rotate(const std::array& d) const { - std::array drot VECTOR3_ZERO; - if(VECTOR3_ZERO != d) { + std::array drot{}; + if(std::array{} != d) { double ww = m_qw*m_qw; double xx = m_qx*m_qx; double yy = m_qy*m_qy; @@ -66,8 +64,8 @@ std::array Quaternion::rotate(const std::array& d) const { } std::array Quaternion::rotateinv(const std::array& d) const { - std::array drot VECTOR3_ZERO; - if (VECTOR3_ZERO != d) { + std::array drot{}; + if (std::array{} != d) { double ww = m_qw*m_qw; double xx = m_qx*m_qx; double yy = m_qy*m_qy; @@ -98,11 +96,6 @@ std::array Quaternion::rotateinv(const std::array& d) cons */ void Quaternion::differentiate(const std::array& w, Quaternion& dqdt) const { - if(VECTOR3_ZERO == w) { - dqdt.m_qw = 0; dqdt.m_qx = 0; dqdt.m_qy = 0; dqdt.m_qz = 0; - return; - } - dqdt.m_qw = .5 * ( -m_qx*w[0] - m_qy*w[1] - m_qz*w[2] ); dqdt.m_qx = .5 * ( m_qw*w[0] - m_qz*w[1] + m_qy*w[2] ); dqdt.m_qy = .5 * ( m_qz*w[0] + m_qw*w[1] - m_qx*w[2] );