30namespace triqs::utility {
51 nda::vector<double> points(N);
52 const double pi = std::numbers::pi;
53 for (
long i = 0; i < N; ++i) {
55 points[N - 1 - i] = std::cos((2.0 *
static_cast<double>(i) + 1.0) * pi / (2.0 *
static_cast<double>(N)));
74 nda::vector<double> weights(N);
75 const double pi = std::numbers::pi;
76 for (
long i = 0; i < N; ++i) {
78 double sign = (i % 2 == 0) ? 1.0 : -1.0;
79 weights[N - 1 - i] = sign * std::sin((2.0 *
static_cast<double>(i) + 1.0) * pi / (2.0 *
static_cast<double>(N)));
92 inline double to_standard_interval(
double x,
double a,
double b) {
return 2.0 * (x - 0.5 * (b + a)) / (b - a); }
nda::vector< double > chebyshev_barycentric_weights(long N)
Compute barycentric weights for Chebyshev points of the first kind.
double to_standard_interval(double x, double a, double b)
Scale a value from interval to the standard interval .
nda::vector< double > chebyshev_points(long N)
Compute Chebyshev points of the first kind on the interval .
double from_standard_interval(double x, double a, double b)
Scale a value from the standard interval to interval .