diff --git a/math/cmath/include/algebra/math/algorithms/matrix/decomposition/partial_pivot_lud.hpp b/math/cmath/include/algebra/math/algorithms/matrix/decomposition/partial_pivot_lud.hpp index 92e186cf..b7e7bda5 100644 --- a/math/cmath/include/algebra/math/algorithms/matrix/decomposition/partial_pivot_lud.hpp +++ b/math/cmath/include/algebra/math/algorithms/matrix/decomposition/partial_pivot_lud.hpp @@ -1,6 +1,6 @@ /** Algebra plugins library, part of the ACTS project * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -8,6 +8,7 @@ #pragma once // Project include(s). +#include "algebra/math/common.hpp" #include "algebra/qualifiers.hpp" // System include(s). @@ -74,7 +75,7 @@ struct partial_pivot_lud { max_idx = i; for (size_type k = i; k < N; k++) { - abs_val = std::abs(element_getter()(lu, k, i)); + abs_val = math::fabs(element_getter()(lu, k, i)); if (abs_val > max_val) { diff --git a/math/common/include/algebra/math/common.hpp b/math/common/include/algebra/math/common.hpp index cfdffa4a..aa1635ed 100644 --- a/math/common/include/algebra/math/common.hpp +++ b/math/common/include/algebra/math/common.hpp @@ -1,6 +1,6 @@ /** Algebra plugins library, part of the ACTS project * - * (c) 2022 CERN for the benefit of the ACTS project + * (c) 2022-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -27,6 +27,12 @@ namespace math_ns = cl::sycl; namespace math_ns = std; #endif // SYCL +/// Absolute value of arg +template +ALGEBRA_HOST_DEVICE inline scalar_t fabs(scalar_t arg) { + return math_ns::fabs(arg); +} + /// Arc tangent of y/x template ALGEBRA_HOST_DEVICE inline scalar_t atan2(scalar_t y, scalar_t x) {