OGS
WeightedSum.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6namespace MathLib
7{
8
9namespace detail {
10
11template <unsigned I, typename Method>
12struct SUM
13{
14 template <typename F>
15 static
16 double
17 add(F const& f)
18 {
19 return f(Method::X[I - 1]) * Method::W[I - 1] + SUM<I - 1, Method>::add(f);
20 }
21};
22
25template <typename Method>
26struct SUM<0, Method>
27{
28 template <typename F>
29 static double add(F const& /*unused*/)
30 {
31 return 0;
32 }
33};
34
35} // namespace detail
36
43template <typename Method>
45{
47 template <typename Func>
48 static
49 double
50 add(Func const& f)
51 {
53 }
54};
55
56} // namespace MathLib
static double add(Func const &f)
Definition WeightedSum.h:50
static double add(F const &)
Definition WeightedSum.h:29
static double add(F const &f)
Definition WeightedSum.h:17