OPAL (Object Oriented Parallel Accelerator Library)  2024.1
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 {
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 public:
31 
32  explicit LOMB_class(int); // constructor
33  virtual ~LOMB_class(void); //destructor
34 
35  int period(std::vector<LOMB_TYPE> *indata, std::vector<LOMB_TYPE> *outdata,
36  double ofac, double hifac, int *nout, int *jmax, double *prob,
37  int amp);
38 
39  int avevar(std::vector<LOMB_TYPE> *data, double *ave, double *var);
40  double signi(double *peak, int *nout, double *ofac);
41 
42  int moment(std::vector<LOMB_TYPE> *indata, double *ave, double *adev,
43  double *sdev, double *var, double *skew, double *curt);
44 
45 
46 };
47 
48 #endif
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:45
LOMB_class(int)
Definition: lomb.cpp:14
Definition: lomb.h:20
std::vector< LOMB_TYPE >::const_iterator CI_lt
Definition: lomb.h:17
Lomb_eq(const double &a)
Definition: lomb.h:23
int avevar(std::vector< LOMB_TYPE > *data, double *ave, double *var)
Definition: lomb.cpp:175
double y
Definition: lomb.h:14
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:248
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
bool operator()(const LOMB_TYPE &c) const
Definition: lomb.h:24
double signi(double *peak, int *nout, double *ofac)
Definition: lomb.cpp:221
std::vector< double >::const_iterator CI_vd
Definition: lomb.h:18
virtual ~LOMB_class(void)
Definition: lomb.cpp:23
Definition: lomb.h:13