diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 1e6a3ac..db9ac43 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -18,3 +18,6 @@ target_link_libraries(testkd2 ${tolink}) add_executable(testDelaunay testDelaunay.cpp) target_link_libraries(testDelaunay ${tolink}) + +add_executable(testNewton testNewton.cpp) +target_link_libraries(testNewton ${tolink}) \ No newline at end of file diff --git a/src/newton.hpp b/src/newton.hpp index ca39804..3e861f0 100644 --- a/src/newton.hpp +++ b/src/newton.hpp @@ -1,6 +1,8 @@ #ifndef _COSMOTOOL_NEWTON_HPP #define _COSMOTOOL_NEWTON_HPP +#include + namespace CosmoTool { template @@ -12,7 +14,7 @@ namespace CosmoTool x = xold - f_x/df_x; - while (abs(xold-x) > residual) + while (std::abs(xold-x) > residual) { xold = x; f_x = function.eval(x);