From 0596cce6804bb33f28c4169965517231194b16e9 Mon Sep 17 00:00:00 2001 From: SatoshiTerasaki Date: Thu, 12 Dec 2024 21:18:51 +0900 Subject: [PATCH] use legval in _specfuncs.hpp --- include/sparseir/poly.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/sparseir/poly.hpp b/include/sparseir/poly.hpp index 0b4a316..387cbef 100644 --- a/include/sparseir/poly.hpp +++ b/include/sparseir/poly.hpp @@ -146,7 +146,9 @@ class PiecewiseLegendrePoly { double x_tilde; std::tie(i, x_tilde) = split(x); Eigen::VectorXd coeffs = data.col(i); - double value = legval(x_tilde, coeffs) * norms[i]; + // convert coeffs to std::vector + std::vector coeffs_vec(coeffs.data(), coeffs.data() + coeffs.size()); + double value = legval(x_tilde, coeffs_vec) * norms[i]; return value; } @@ -305,6 +307,7 @@ class PiecewiseLegendrePoly { int get_polyorder() const { return polyorder; } private: + /* // Helper function to compute legval static double legval(double x, const Eigen::VectorXd &coeffs) { @@ -324,6 +327,7 @@ class PiecewiseLegendrePoly { } return result; } + */ // Helper function to split x into segment index i and x_tilde std::pair split(double x) const