Skip to content

Commit

Permalink
fix: add compatibility for older Eigen and Boost
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Sep 22, 2023
1 parent b2b7e2f commit dd43f22
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion c++/triqs_Nevanlinna/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING

# ========= Library Dependencies ==========

find_package(Eigen3 REQUIRED)
find_package(Eigen3 REQUIRED CONFIG)
target_link_libraries(${PROJECT_NAME}_c PUBLIC Eigen3::Eigen)
target_compile_definitions(${PROJECT_NAME}_c PUBLIC EIGEN_HAS_STD_RESULT_OF=0)

find_package(Boost REQUIRED)
target_link_libraries(${PROJECT_NAME}_c PUBLIC Boost::boost)
target_compile_definitions(${PROJECT_NAME}_c PUBLIC _HAS_AUTO_PTR_ETC=0)

find_package(OpenMP REQUIRED COMPONENTS CXX)
target_link_libraries(${PROJECT_NAME}_c PUBLIC OpenMP::OpenMP_CXX)
Expand Down
2 changes: 1 addition & 1 deletion c++/triqs_Nevanlinna/Caratheodory_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace triqs_Nevanlinna {
}
auto eigenvalues = Pick.eigenvalues();
auto pick_eigenvalues = nda::vector<double>(nw * N);
std::transform(eigenvalues.begin(), eigenvalues.end(), pick_eigenvalues.begin(), [](const std::complex<double> &r) { return r.real(); });
std::transform(eigenvalues.data(), eigenvalues.data() + eigenvalues.size(), pick_eigenvalues.begin(), [](const std::complex<double> &r) { return r.real(); });
return pick_eigenvalues;
}

Expand Down
2 changes: 1 addition & 1 deletion c++/triqs_Nevanlinna/Nevanlinna_factorization.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace triqs_Nevanlinna {
}
auto evals = Pick.eigenvalues();
auto Pick_eigenvalues = nda::vector<double>(M);
std::transform(evals.begin(), evals.end(), Pick_eigenvalues.begin(), [](const std::complex<double> &r) { return r.real(); });
std::transform(evals.data(), evals.data() + evals.size(), Pick_eigenvalues.begin(), [](const std::complex<double> &r) { return r.real(); });
return Pick_eigenvalues;
}

Expand Down
1 change: 0 additions & 1 deletion test/c++/complex_math_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <nda/gtest_tools.hpp>
#include <triqs_Nevanlinna/types.hpp>
#include <boost/multiprecision/cpp_complex.hpp>
#include <Eigen/Dense>

using namespace triqs_Nevanlinna;
Expand Down

0 comments on commit dd43f22

Please sign in to comment.