Skip to content

Commit

Permalink
Few fixes (#9)
Browse files Browse the repository at this point in the history
* Fix selection error.
* Add subdirectory tests if BUILD_TESTING is ON
  • Loading branch information
ruthenium96 committed Apr 26, 2024
1 parent 9c39f56 commit 5fade56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/wignerSymbols-cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,15 @@ 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
&& std::fabs(l4-l5) <= l3 && l3 <= l4+l5
);

// 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)
Expand Down

0 comments on commit 5fade56

Please sign in to comment.