tesseract  5.0.0-alpha-619-ge9db
measure.h File Reference
#include <cmath>

Go to the source code of this file.

Classes

struct  MEASUREMENT
 

Macros

#define ADD_SAMPLE(m, s)
 
#define MEAN(m)   ((m).num_samples ? ((float)((m).sum_of_samples / (m).num_samples)) : 0)
 
#define new_measurement(m)   ((m).num_samples = 0, (m).sum_of_samples = 0, (m).sum_of_squares = 0)
 
#define number_of_samples(m)   ((m).num_samples)
 
#define standard_deviation(m)   ((float) sqrt (VARIANCE (m)))
 
#define VARIANCE(m)
 
#define print_summary(string, measure)
 

Macro Definition Documentation

◆ ADD_SAMPLE

#define ADD_SAMPLE (   m,
 
)
Value:
(m.sum_of_samples += (float)(s), \
m.sum_of_squares += (float)(s) * (float)(s), ++m.num_samples)

Definition at line 54 of file measure.h.

◆ MEAN

#define MEAN (   m)    ((m).num_samples ? ((float)((m).sum_of_samples / (m).num_samples)) : 0)

Definition at line 63 of file measure.h.

◆ new_measurement

#define new_measurement (   m)    ((m).num_samples = 0, (m).sum_of_samples = 0, (m).sum_of_squares = 0)

Definition at line 72 of file measure.h.

◆ number_of_samples

#define number_of_samples (   m)    ((m).num_samples)

Definition at line 80 of file measure.h.

◆ print_summary

#define print_summary (   string,
  measure 
)
Value:
cprintf("\t%-20s \tn = %d, \tm = %4.2f, \ts = %4.2f\n ", string, \
number_of_samples(measure), MEAN(measure), \

Definition at line 108 of file measure.h.

◆ standard_deviation

#define standard_deviation (   m)    ((float) sqrt (VARIANCE (m)))

Definition at line 88 of file measure.h.

◆ VARIANCE

#define VARIANCE (   m)
Value:
(((m).num_samples > 1) \
? ((float)(((m).num_samples * (m).sum_of_squares - \
(m).sum_of_samples * (m).sum_of_samples) / \
(((m).num_samples - 1) * (m).num_samples))) \
: 0)

Definition at line 96 of file measure.h.

standard_deviation
#define standard_deviation(m)
Definition: measure.h:88
number_of_samples
#define number_of_samples(m)
Definition: measure.h:80
cprintf
void cprintf(const char *format,...)
Definition: callcpp.cpp:32
MEAN
#define MEAN(m)
Definition: measure.h:63