HOPS
HOPS class reference
MHO_ApMeanIntegrator.hh
Go to the documentation of this file.
1 #ifndef MHO_ApMeanIntegrator_HH__
2 #define MHO_ApMeanIntegrator_HH__
3 
4 #include <vector>
5 
6 namespace hops
7 {
8 
22 {
23  public:
26 
36  int Initialize(int n, const double* coords, const double* val1, const double* val2);
37 
55  int Integrate(double start, double stop, int* nstart, double* result1, double* result2);
56 
57  private:
58  // 1-based tabular arrays with guard points at index 0 and n+1.
59  std::vector< double > x_;
60  std::vector< double > y1_;
61  std::vector< double > y2_;
62  int nxy_; // effective number of entries (n + 2)
63  double begin_; // half-open begin of valid range
64  double end_; // half-open end of valid range
65 };
66 
67 } // namespace hops
68 
69 #endif
Trapezoidal integrator over tabular data with linear interpolation.
Definition: MHO_ApMeanIntegrator.hh:22
int Integrate(double start, double stop, int *nstart, double *result1, double *result2)
Compute the average of val1 and val2 over [start, stop].
Definition: MHO_ApMeanIntegrator.cc:65
int Initialize(int n, const double *coords, const double *val1, const double *val2)
Load tabular data. Must be called before Integrate().
Definition: MHO_ApMeanIntegrator.cc:14
MHO_ApMeanIntegrator()
Definition: MHO_ApMeanIntegrator.cc:8
~MHO_ApMeanIntegrator()
Definition: MHO_ApMeanIntegrator.cc:11
Definition: MHO_AdhocFlagging.hh:18