diff --git a/CMakeLists.txt b/CMakeLists.txt index bd36bb1..0863be2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,9 @@ SET_TARGET_PROPERTIES(${PROJECT_NAME} VERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE} SOVERSION ${wignerSymbols_VERSION_MAJOR}.${wignerSymbols_VERSION_MINOR}.${wignerSymbols_VERSION_RELEASE}) -add_subdirectory(tests) +if(BUILD_TESTING) + add_subdirectory(tests) +endif() # Install directories install(TARGETS ${PROJECT_NAME} DESTINATION lib) diff --git a/src/wignerSymbols-cpp.cpp b/src/wignerSymbols-cpp.cpp index 3292cf2..f5dd18e 100644 --- a/src/wignerSymbols-cpp.cpp +++ b/src/wignerSymbols-cpp.cpp @@ -429,7 +429,7 @@ double wigner6j(double l1, double l2, double l3, bool select(true); // Triangle relations for the four tryads - select = ( + select &= ( std::fabs(l1-l2) <= l3 && l3 <= l1+l2 && std::fabs(l1-l5) <= l6 && l6 <= l1+l5 && std::fabs(l4-l2) <= l6 && l6 <= l4+l2 @@ -437,7 +437,7 @@ double wigner6j(double l1, double l2, double l3, ); // Sum rule of the tryads - select = ( + select &= ( std::floor(l1+l2+l3)==(l1+l2+l3) && std::floor(l1+l5+l6)==(l1+l5+l6) && std::floor(l4+l2+l6)==(l4+l2+l6)