From d0b5112b67b4723c8fa400ab8e2aec2453824ce5 Mon Sep 17 00:00:00 2001 From: Fikret Ardal Date: Wed, 14 Oct 2026 16:15:40 -0400 Subject: [PATCH] explicilty use std:: to avoid ambigious error --- c++/cppdlr/utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c++/cppdlr/utils.cpp b/c++/cppdlr/utils.cpp index e68f9a6..1a99ddf 100644 --- a/c++/cppdlr/utils.cpp +++ b/c++/cppdlr/utils.cpp @@ -39,7 +39,7 @@ namespace cppdlr { auto [xgl, wgl] = gaussquad(n); // Get Gauss-Legendre nodes and weights for (int j = 0; j < n; j++) { x(j) = xgl(j); - w(j) = pow(-1, j) * sqrt((1 - pow(x(j), 2)) * wgl(j)); // Barycentric weights + w(j) = std::pow(-1, j) * std::sqrt((1 - std::pow(x(j), 2)) * wgl(j)); // Barycentric weights } } @@ -136,7 +136,7 @@ namespace cppdlr { xgl(n / 2) = 0; // If odd number of nodes, middle node is 0 for (int i = 0; i < n / 2; i++) { // Loop through nodes convcount = 0; - x = cos((2 * i + 1) * std::numbers::pi / (2 * n)); // Initial guess: Chebyshev node + x = std::cos((2 * i + 1) * std::numbers::pi / (2 * n)); // Initial guess: Chebyshev node while (true) { // Newton iteration auto [p, dp] = leg_eval(n, x); dx = -p / dp;