OGS
WeightedSum.h
Go to the documentation of this file.
1
11#pragma once
12
13namespace MathLib
14{
15
16namespace detail {
17
18template <unsigned I, typename Method>
19struct SUM
20{
21 template <typename F>
22 static
23 double
24 add(F const& f)
25 {
26 return f(Method::X[I - 1]) * Method::W[I - 1] + SUM<I - 1, Method>::add(f);
27 }
28};
29
32template <typename Method>
33struct SUM<0, Method>
34{
35 template <typename F>
36 static double add(F const& /*unused*/)
37 {
38 return 0;
39 }
40};
41
42} // namespace detail
43
50template <typename Method>
52{
54 template <typename Func>
55 static
56 double
57 add(Func const& f)
58 {
60 }
61};
62
63} // namespace MathLib
static double add(Func const &f)
Definition WeightedSum.h:57
static double add(F const &)
Definition WeightedSum.h:36
static double add(F const &f)
Definition WeightedSum.h:24