ANIMA  4.0
animaGaussLaguerreQuadrature.h
Go to the documentation of this file.
1 #pragma once
2 #include "AnimaSpecialFunctionsExport.h"
3 #include <vector>
4 
5 #include <boost/math/quadrature/gauss.hpp>
6 
7 namespace anima
8 {
9 
15 class ANIMASPECIALFUNCTIONS_EXPORT GaussLaguerreQuadrature
16 {
17 public:
20 
22  void SetInterestZone(double minVal, double maxVal);
23 
24  template <class FunctionType>
25  double GetIntegralValue(FunctionType integrand)
26  {
27  double deltaPart = 0.0;
28  if (m_DeltaValue > 0.0)
29  deltaPart = boost::math::quadrature::gauss <double, 15>::integrate(integrand, 0.0, m_DeltaValue);
30 
31  double laguerrePart = 0.0;
32  for (unsigned int i = 0;i < m_Abcissas.size();++i)
33  laguerrePart += m_ValueWeights[i] * integrand(m_ScaleValue * m_Abcissas[i] + m_DeltaValue) * m_ScaleValue;
34 
35  return deltaPart + laguerrePart;
36 
37  }
38 
39 private:
41  double m_DeltaValue;
42 
43  double m_ScaleValue;
44 
46  const std::vector <double> m_ValueWeights =
47  {
48  2.25030314864247252e-1,
49  5.25836052762342454e-1,
50  8.31961391687087088e-1,
51  1.14609924096375170,
52  1.47175131696680859,
53  1.81313408738134816,
54  2.17551751969460745,
55  2.56576275016502921,
56  2.99321508637137516,
57  3.47123448310209029,
58  4.02004408644466886,
59  4.67251660773285420,
60  5.48742065798615247,
61  6.58536123328921366,
62  8.27635798436423448,
63  1.18242775516584348e1
64  };
65 
67  const std::vector <double> m_Abcissas =
68  {
69  8.76494104789278403e-2,
70  4.62696328915080832e-1,
71  1.14105777483122686,
72  2.12928364509838062,
73  3.43708663389320665,
74  5.07801861454976791,
75  7.07033853504823413,
76  9.43831433639193878,
77  1.22142233688661587e1,
78  1.54415273687816171e1,
79  1.91801568567531349e1,
80  2.35159056939919085e1,
81  2.85787297428821404e1,
82  3.45833987022866258e1,
83  4.19404526476883326e1,
84  5.17011603395433184e1
85  };
86 };
87 
88 } // end of namespace anima
double GetIntegralValue(FunctionType integrand)
Computes the Gauss Laguerre quadrature of a function defined from R^+ into R. Recenters the function ...