58 numIterations_(numIterations),
59 weight_(numIterations + 1),
60 root_(numIterations + 1)
62 calculateWeightAndRoot();
95 double derivative{ 0. };
104 Result(
const double val,
const double deriv)
noexcept :
115 void calculateWeightAndRoot()
noexcept
118 for (
uint32 step = 0; step <= numIterations_; ++step)
122 Result
result = calculatePolynomialValueAndDerivative(
root);
129 result = calculatePolynomialValueAndDerivative(
root);
144 Result calculatePolynomialValueAndDerivative(
const double x)
noexcept
150 for (
uint32 step = 2; step <= numIterations_; ++step)
152 const auto stepDouble =
static_cast<double>(step);
165 const double EPSILON{ 1
e-15 };
167 const uint32 numIterations_{};
168 std::vector<double> weight_{};
169 std::vector<double> root_{};
190 const double width = 0.5 * (
high -
low);
194 for (
uint32 step = 1; step <=
n; ++step)
Definition gauss_legendre.hpp:49
LegendrePolynomial(const uint32 numIterations) noexcept
Definition gauss_legendre.hpp:57
const std::vector< double > & getRoot() const noexcept
Definition gauss_legendre.hpp:82
const std::vector< double > & getWeight() const noexcept
Definition gauss_legendre.hpp:71
constexpr double pi
Pi.
Definition Core/Constants.hpp:39
constexpr double e
eulers number
Definition Core/Constants.hpp:37
Definition gauss_legendre.hpp:43
double gauss_legendre(const double low, const double high, const uint32 n, const std::function< double(double)> &f)
Definition gauss_legendre.hpp:184
dtype f(GeneratorType &generator, dtype inDofN, dtype inDofD)
Definition f.hpp:56
constexpr dtype sqr(dtype inValue) noexcept
Definition sqr.hpp:42
NdArray< double > mean(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition mean.hpp:52
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
std::uint32_t uint32
Definition Types.hpp:40