summaryrefslogtreecommitdiff
path: root/lib/measurement.h
blob: 4ced4dc90c510018501bb62afcec50841c143148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#include <math.h>
#include <stdlib.h>

#include "types.h"
#include "stack.h"

typedef struct {
  uint64_t n;
  double x;
  double dx;
  double x2;
  double m2;
  double m4;
  double c;
  double dc;
} meas_t;

typedef struct {
  uint64_t n;
  uint64_t W;
  double *OO;
  dll_t *Op;
  double O;
  double O2;
} autocorr_t;

void update_meas(meas_t *m, double x);

void update_autocorr(autocorr_t *OO, double O);

double rho(autocorr_t *o, uint64_t i);