tesseract  4.0.0-1-g2a2b
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 63 of file measure.h.

◆ MEAN

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

Definition at line 73 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 83 of file measure.h.

◆ number_of_samples

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

Definition at line 92 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), \
void cprintf(const char *format,...)
Definition: callcpp.cpp:33
#define number_of_samples(m)
Definition: measure.h:92
#define MEAN(m)
Definition: measure.h:73
#define standard_deviation(m)
Definition: measure.h:101

Definition at line 123 of file measure.h.

◆ standard_deviation

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

Definition at line 101 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 110 of file measure.h.