Skip to content

Commit

Permalink
some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLapous committed Sep 28, 2023
1 parent 60b7325 commit 1fa3aa9
Show file tree
Hide file tree
Showing 3 changed files with 704 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ class Finitely_critical_multi_filtration : public std::vector<T> {
return result;
}

// template<class array_like>
friend bool operator==(Finitely_critical_multi_filtration<T> &self, const Finitely_critical_multi_filtration<T> &to_compare){
if (self.size() != to_compare.size()) return false;
auto it = to_compare.begin();
for (auto i = 0u; i<self.size(); i++){
if (self.at(i) != *(it++)) return false;
}
return true;
}

static std::vector<std::vector<T>> to_python(const std::vector<Finitely_critical_multi_filtration<T>>& to_convert){
return std::vector<std::vector<T>>(to_convert.begin(), to_convert.end());
}
Expand Down Expand Up @@ -131,7 +141,8 @@ class Finitely_critical_multi_filtration : public std::vector<T> {

// easy debug
friend std::ostream& operator<<(std::ostream& stream, const Finitely_critical_multi_filtration<T>& truc){
stream << "[";
if (truc.empty()) {stream << "[]"; return stream;}
stream << "[";
for(unsigned int i = 0; i < truc.size()-1; i++){
stream << truc[i] << ", ";
}
Expand Down
6 changes: 6 additions & 0 deletions src/Simplex_tree/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ if(TARGET TBB::tbb)
endif()
gudhi_add_boost_test(Simplex_tree_test_unit)

add_executable ( Simplex_tree_multi_test_unit simplex_tree_multi_unit_test.cpp )
if(TARGET TBB::tbb)
target_link_libraries(Simplex_tree_multi_test_unit TBB::tbb)
endif()
gudhi_add_boost_test(Simplex_tree_multi_test_unit)

add_executable ( Simplex_tree_remove_test_unit simplex_tree_remove_unit_test.cpp )
if(TARGET TBB::tbb)
target_link_libraries(Simplex_tree_remove_test_unit TBB::tbb)
Expand Down
Loading

0 comments on commit 1fa3aa9

Please sign in to comment.