ampsci
High-precision calculations for one- and two-valence atomic systems
NumCalc_coeficients.hpp
1#pragma once
2#include <array>
3
4namespace NumCalc {
5//==============================================================================
6//! Quadrature integration coefficients for a given number of points N.
7//! `cq` holds the weights; the step contribution is multiplied by `dq_inv`.
8//! Specialisations are provided for N = 1, 3, 5, 7, 9, 11, 13.
9template <std::size_t N>
10struct QintCoefs {};
11
12template <>
13struct QintCoefs<13> {
14 static constexpr std::size_t N = 13;
15 static constexpr std::array<double, N> cq{
16 {1382741929621, 9535909891802, -5605325192308, 28323664941310,
17 -32865015189975, 53315213499588, -41078125154304, 39022895874876,
18 -13155015007785, 12465244770050, 3283609164916, 5551687979302,
19 5206230892907}};
20 static constexpr double dq_inv = 1.0 / 5230697472000;
21};
22template <>
23struct QintCoefs<11> {
24 static constexpr std::size_t N = 11;
25 static constexpr std::array<double, N> cq{
26 {262747265, 1637546484, -454944189, 3373884696, -2145575886, 3897945600,
27 -1065220914, 1942518504, 636547389, 1021256716, 952327935}};
28 static constexpr double dq_inv = 1.0 / 958003200;
29};
30template <>
31struct QintCoefs<9> {
32 static constexpr std::size_t N = 9;
33 static constexpr std::array<double, N> cq{{2082753, 11532470, 261166,
34 16263486, -1020160, 12489922,
35 5095890, 7783754, 7200319}};
36 static constexpr double dq_inv = 1.0 / 7257600;
37};
38template <>
39struct QintCoefs<7> {
40 static constexpr std::size_t N = 7;
41 static constexpr std::array<double, N> cq{
42 {36799, 176648, 54851, 177984, 89437, 130936, 119585}};
43 static constexpr double dq_inv = 1.0 / 120960;
44};
45template <>
46struct QintCoefs<5> {
47 static constexpr std::size_t N = 5;
48 static constexpr std::array<double, N> cq{{475, 1902, 1104, 1586, 1413}};
49 static constexpr double dq_inv = 1.0 / 1440;
50};
51template <>
52struct QintCoefs<3> {
53 static constexpr std::size_t N = 3;
54 static constexpr std::array<double, N> cq{{9, 28, 23}};
55 static constexpr double dq_inv = 1.0 / 24;
56};
57template <>
58struct QintCoefs<1> {
59 static constexpr std::size_t N = 1;
60 static constexpr std::array<double, N> cq{{1}};
61 static constexpr double dq_inv = 1.0; // technically, this is 'zero'
62};
63
64} // namespace NumCalc
Numerical integration and differentiation routines.
Definition NumCalc_coeficients.hpp:4
Quadrature integration coefficients for a given number of points N. cq holds the weights; the step co...
Definition NumCalc_coeficients.hpp:10