OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
lomb.h
Go to the documentation of this file.
1 #ifndef __LOMB__
2 #define __LOMB__
3 /*****************************************************************************/
4 /* */
5 /* Class for Lomb Periodograms & Co. */
6 /* ================================= */
7 /* */
8 /*****************************************************************************/
9 #include <vector>
10 #include <cmath>
11 #include <functional>
12 
13 typedef struct {
14  double x, y;
15 } LOMB_TYPE;
16 
17 typedef std::vector<LOMB_TYPE>::const_iterator CI_lt;
18 typedef std::vector<double>::const_iterator CI_vd;
19 
20 class Lomb_eq : public std::unary_function<LOMB_TYPE, bool> {
21  double b;
22 public:
23  explicit Lomb_eq(const double &a) : b(a) {}
24  bool operator()(const LOMB_TYPE &c) const {return c.y == b;}
25 };
26 
27 class LOMB_class {
28 private:
29 
30  double TWOPID;
31 
32 public:
33 
34  explicit LOMB_class(int); // constructor
35  virtual ~LOMB_class(void); //destructor
36 
37  int period(std::vector<LOMB_TYPE> *indata, std::vector<LOMB_TYPE> *outdata,
38  double ofac, double hifac, int *nout, int *jmax, double *prob,
39  int amp);
40 
41  int avevar(std::vector<LOMB_TYPE> *data, double *ave, double *var);
42  double signi(double *peak, int *nout, double *ofac);
43 
44  int moment(std::vector<LOMB_TYPE> *indata, double *ave, double *adev,
45  double *sdev, double *var, double *skew, double *curt);
46 
47 
48 };
49 
50 #endif
Definition: lomb.h:13
int avevar(std::vector< LOMB_TYPE > *data, double *ave, double *var)
Definition: lomb.cpp:177
double b
Definition: lomb.h:21
int moment(std::vector< LOMB_TYPE > *indata, double *ave, double *adev, double *sdev, double *var, double *skew, double *curt)
Definition: lomb.cpp:250
double TWOPID
Definition: lomb.h:30
int period(std::vector< LOMB_TYPE > *indata, std::vector< LOMB_TYPE > *outdata, double ofac, double hifac, int *nout, int *jmax, double *prob, int amp)
Definition: lomb.cpp:34
double signi(double *peak, int *nout, double *ofac)
Definition: lomb.cpp:223
Lomb_eq(const double &a)
Definition: lomb.h:23
Definition: lomb.h:20
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:52
double y
Definition: lomb.h:14
virtual ~LOMB_class(void)
Definition: lomb.cpp:23
std::vector< LOMB_TYPE >::const_iterator CI_lt
Definition: lomb.h:17
bool operator()(const LOMB_TYPE &c) const
Definition: lomb.h:24
std::vector< double >::const_iterator CI_vd
Definition: lomb.h:18
LOMB_class(int)
Definition: lomb.cpp:11