C++ main module for emicrom Package  1.0
MATH_GaussLegendreIntegration.h
Go to the documentation of this file.
1 #ifndef MATH_GaussLegendreIntegration_H
2 #define MATH_GaussLegendreIntegration_H
3 
4 #include "MATH_Integration.h"
5 
6 #include "CORE_Array.h"
7 
53 
56 
57  // ATTRIBUTES
58 
59 public:
60 
61 
62 private:
63 
64 
65 private:
66 
67  //weights per dimension
69 
70  //points per dimension
72 
73 
74 
75 
76 
77 protected:
78  // METHODS
79 
80  // CONSTRUCTORS
81 
84 
85 
86 
87  // DESTRUCTORS
88 
89 
92  virtual ~MATH_GaussLegendreIntegration(void);
93 
94 
95 public:
96 
97  // NEW methods
98 
101  static SP::MATH_GaussLegendreIntegration New() {
102  SP::MATH_GaussLegendreIntegration p(new MATH_GaussLegendreIntegration(),
104  p->setThis(p);
105  return p;
106  };
107 
108 
109 
110  // COPY methods
111 
114  virtual void copy(const MATH_Integration& integral);
115 
116 
117 
118 
119 
120  // SET methods
121 
122 public:
123 
127  void setOrder(const tUIndex& n);
128 
137  void computeIntegrationData(const tUSInt& n,
138  const tReal& a,const tReal& b,
139  tReal* w,
140  tReal* x) const;
141 
142 protected:
145  virtual void setBoundsCalled() {
146  if (mPoints.getSize()>0) setOrder(mPoints.get(0)->getSize());
147  }
148 
149  // GET methods
150 public:
155  inline const CORE_RealArray& getPoints(const tUIndex& k) const {
156  return *mPoints.get(k);
157  }
162  inline CORE_RealArray& getPoints(const tUIndex& k) {
163  return *mPoints.get(k);
164  }
169  inline const CORE_RealArray& getWeights(const tUIndex& k) const {
170  return *mWeights.get(k);
171  }
176  inline CORE_RealArray& getWeights(const tUIndex& k) {
177  return *mWeights.get(k);
178  }
179 
180 
184  inline tUIndex getOrder() const {
185  if (mPoints.getSize()>0) return mPoints.get(0)->getSize();
186  return 0;
187  }
188 
189 public:
190 
191  // ------------------
192  // INTEGRATE function
193  // ------------------
194 
198  virtual tReal integrate();
199 
200 
201 
202 };
203 
204 
205 #endif
virtual void setBoundsCalled()
method called when intervals is modified
Definition: MATH_GaussLegendreIntegration.h:145
SP_OBJECT(MATH_GaussLegendreIntegration)
T & get(const tUIndex &i)
get the value of the array at index i
Definition: CORE_Array.h:555
#define tUSInt
Definition: types.h:28
void computeIntegrationData(const tUSInt &n, const tReal &a, const tReal &b, tReal *w, tReal *x) const
compute the integration points and weights at order n for interval [a,b]
Definition: MATH_GaussLegendreIntegration.cpp:145
virtual void copy(const MATH_Integration &integral)
copy the parameters of the optimization method
Definition: MATH_GaussLegendreIntegration.cpp:19
virtual ~MATH_GaussLegendreIntegration(void)
destroy an GaussLegendreIntegration Object.
Definition: MATH_GaussLegendreIntegration.cpp:15
static SP::MATH_GaussLegendreIntegration New()
create a copy of MATH_GaussLegendreIntegration
Definition: MATH_GaussLegendreIntegration.h:101
This class integrate function where a,b,t, in d=(1,2,3..).
Definition: MATH_GaussLegendreIntegration.h:54
CORE_Array< tReal > CORE_RealArray
Definition: CORE_Array.h:1075
virtual tReal integrate()
integrate the function in the interval
Definition: MATH_GaussLegendreIntegration.cpp:284
SV::CORE_RealArray mWeights
Definition: MATH_GaussLegendreIntegration.h:68
SV::CORE_RealArray mPoints
Definition: MATH_GaussLegendreIntegration.h:71
CORE_RealArray & getPoints(const tUIndex &k)
return the points of integration of the coordinate k
Definition: MATH_GaussLegendreIntegration.h:162
MATH_GaussLegendreIntegration(void)
create a GaussLegendreIntegration object
Definition: MATH_GaussLegendreIntegration.cpp:12
#define tUIndex
Definition: types.h:126
This class integrates integrand function MATH_IntegrandFunction where a,b,t,dt in d=(1...
Definition: MATH_Integration.h:19
void setOrder(const tUIndex &n)
set the order of integration
Definition: MATH_GaussLegendreIntegration.cpp:73
tUIndex getOrder() const
get the order of the integration
Definition: MATH_GaussLegendreIntegration.h:184
const CORE_RealArray & getPoints(const tUIndex &k) const
return the points of integration of the coordinate k
Definition: MATH_GaussLegendreIntegration.h:155
const CORE_RealArray & getWeights(const tUIndex &k) const
return the weights of integration of the coordinate k
Definition: MATH_GaussLegendreIntegration.h:169
CORE_RealArray & getWeights(const tUIndex &k)
return the points of integration of the coordinate k
Definition: MATH_GaussLegendreIntegration.h:176
DEFINE_SPTR(MATH_GaussLegendreIntegration)
#define tReal
Definition: types.h:118
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141