diff --git a/.gitignore b/.gitignore index 0b80dc72d35bbe0bd8edeab1b31668149507ffe7..cf19ff1ea827a7f726d7a4ba23da88c6723c7409 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ config.log config.status configure .deps/ +build/* src/aevol_create src/aevol_modify src/aevol_propagate @@ -18,6 +19,8 @@ src/aevol_run src/libaevol/SFMT-src-1.4/jump/.dirstamp *.a src/post_treatments/aevol_misc_ancstats +src/post_treatments/aevol_misc_ancestor_robustness +src/post_treatments/aevol_misc_ancestor_stats src/post_treatments/aevol_misc_compute_pop_stats src/post_treatments/aevol_misc_create_eps src/post_treatments/aevol_misc_extract @@ -28,6 +31,7 @@ src/post_treatments/aevol_misc_robustness src/post_treatments/aevol_misc_mutagenesis src/post_treatments/aevol_misc_template src/post_treatments/aevol_misc_view_generation +src/post_treatments/aevol_misc_view *.o diff --git a/CMakeLists.txt b/CMakeLists.txt index e19d512d67e86fe9f0682932bbe38084f9eab7a4..d3196f305afd3e7c5dbbcd3df397d345149f40a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,7 +60,8 @@ if(APPLE) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") set(OpenMP_CXX "${CMAKE_CXX_COMPILER}") - set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -Wno-unused-command-line-argument") + set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -Wno-unused-command-line-argument -I /usr/local/opt/libomp/include") + message("\nFLAGS: ${OpenMP_CXX_FLAGS}") set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5") set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES}) set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES}) diff --git a/src/libaevol/Fuzzy.cpp b/src/libaevol/Fuzzy.cpp index fc605b0ecfed3f7a43062c46fe7cc1985a935eeb..c745be09b60b1bb499a12821d15f75559749cab2 100644 --- a/src/libaevol/Fuzzy.cpp +++ b/src/libaevol/Fuzzy.cpp @@ -470,18 +470,34 @@ void Fuzzy::reset() { // assert(invariant()); } +/// Reset the fuzzy set to its original state, two points at +/// (X_MIN, 0.0) and (X_MAX, 0.0). void Fuzzy::clear() { - points_.clear(); + points_ = {Point(X_MIN, 0.0), Point(X_MAX, 0.0)}; } void Fuzzy::add_point(ProteinConcentration x, ProteinConcentration y) { + // points_ must always contain at least two elements, at X_MIN and X_MAX. + assert(points_.size() >= 2); + assert(points_.begin()->x == X_MIN); + assert(points_.rbegin()->x == X_MAX); + + // We don't want to add a new point if there's already a point at the same x. + // To find out if there is such a point, we find the first point with + // larger x and then look at its predecessor. list<Point>::iterator p = #ifndef __OPENMP_GPU find_if(points_.begin(), points_.end(), [x](Point& q){return q.x > x;}); #else algorithm_cuda::find_if_point_5(points_.begin(), points_.end(), x); #endif + + // Since there is always a point at x = X_MAX, we always find such a point, + // and since there is always a point at x = X_MIN (which does not + // match the condition), that point always has a predecessor. + // p should therefore never be points_.begin(). + assert(p != points_.begin()); if (prev(p)->x == x) { prev(p)->y += y; } else { diff --git a/src/libaevol/SFMT-src-1.4/CMakeLists.txt b/src/libaevol/SFMT-src-1.4/CMakeLists.txt index 571837794cbffafcce83a3b48aa6c1fdcb9f2ca1..e4224712917c18632d05a14d75e645f32e6e5799 100644 --- a/src/libaevol/SFMT-src-1.4/CMakeLists.txt +++ b/src/libaevol/SFMT-src-1.4/CMakeLists.txt @@ -51,4 +51,3 @@ target_compile_definitions(sfmt # ============================================================================ # Use C++11 # ============================================================================ -target_compile_options(sfmt PRIVATE "-std=c++14")