Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
SimpleRules.h
Go to the documentation of this file.
1 #pragma once
2 
9 #include "AQ_Util.h"
10 
11 namespace UA_CoMP {
12 namespace Num {
13 
21 {
22 public:
31  template <class Ftor>
32  static typename Ftor::result_type sum(typename Ftor::argument_type l, typename Ftor::argument_type d, Ftor f)
33  {
36 
37  const Arg h{static_cast<Arg>(0.5) * d};
38  const Arg r{l + d};
39  return static_cast<Res>(0.333333333333333) * h * (f(l) + static_cast<Res>(4.0) * f(l + h) + f(r));
40  }
41 };
42 
43 } // namespace Num
44 } // namespace UA_CoMP
Utilities for the implementation of the Adaptive Quadrature.
typename std::remove_cv< typename std::remove_reference< T >::type >::type type
Definition: AQ_Util.h:18
static Ftor::result_type sum(typename Ftor::argument_type l, typename Ftor::argument_type d, Ftor f)
Execute the rule on the cell.
Definition: SimpleRules.h:32
The Simpson rule.
Definition: SimpleRules.h:20