Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::analytics::SampleMapping Class Reference

Helper class for transforming samples between the time domain and the (unitless) normalized domain used for discrepancy calculation. More...

#include "discrepancy.h"

Public Member Functions

 SampleMapping (double time_begin, double time_end, size_t num_samples)
 
double NormalizedFromTime (double time_sample) const
 Maps a sample from time domain to normalized (unitless) domain. More...
 
double TimeFromNormalized (double normalized_sample) const
 Maps a sample back from normalized (unitless) domain to time domain. More...
 
double DurationFromLength (double length) const
 Maps a duration back from normalized (unitless) domain to time domain. More...
 

Detailed Description

Helper class for transforming samples between the time domain and the (unitless) normalized domain used for discrepancy calculation.

For N input values the first output value becomes 0.5/N and the last value becomes (N-0.5)/N. E.g. for four uniformly distributed input numbers, the output will be (* marks the location of an output sample): 0 1/8 1/4 3/8 1/2 5/8 3/4 7/8 1 | * | * | * | * |

Background: The discrepancy of the sequence i/(N-1); i=0, ..., N-1 is 2/N, twice the discrepancy of the sequence (i+1/2)/N; i=0, ..., N-1. In our case we don't want to distinguish between these two cases, as our original domain is not bounded (it is for Monte Carlo integration, where discrepancy was originally used).

Definition at line 68 of file discrepancy.h.

Constructor & Destructor Documentation

ion::analytics::SampleMapping::SampleMapping ( double  time_begin,
double  time_end,
size_t  num_samples 
)
inline

Definition at line 70 of file discrepancy.h.

References CHECK_GT, and CHECK_LT.

Member Function Documentation

double ion::analytics::SampleMapping::DurationFromLength ( double  length) const
inline

Maps a duration back from normalized (unitless) domain to time domain.

Definition at line 92 of file discrepancy.h.

Referenced by ion::analytics::AbsoluteTimestampDiscrepancy().

double ion::analytics::SampleMapping::NormalizedFromTime ( double  time_sample) const
inline

Maps a sample from time domain to normalized (unitless) domain.

Definition at line 82 of file discrepancy.h.

Referenced by ion::analytics::NormalizeSamples().

double ion::analytics::SampleMapping::TimeFromNormalized ( double  normalized_sample) const
inline

Maps a sample back from normalized (unitless) domain to time domain.

Definition at line 87 of file discrepancy.h.

Referenced by ion::analytics::AbsoluteTimestampDiscrepancy().


The documentation for this class was generated from the following file: