Public Member Functions | Private Attributes | List of all members
gnsstk::MostCommonValue Class Reference

Detailed Description

Simple class to find the most common value, within a given tolerance, in a given set of values. Used to find, e.g. the time interval of a RINEX obs file. Given enough examples (provided to add(dt)), it should be clear what the nominal or most common value is. Use a tolerance to differentiate dt's, default 0.001.

Definition at line 59 of file MostCommonValue.hpp.

#include <MostCommonValue.hpp>

Public Member Functions

void add (double dt)
 add a measured timestep to the analysis More...
 
double bestDT ()
 return the best estimate of timestep More...
 
int bestN ()
 return count for best estimate More...
 
void dump (std::ostream &os, int prec=3)
 dump the table of values and counts More...
 
void getResults (std::vector< int > &out_counts, std::vector< double > &out_values)
 get the table of all the values and the number of times seen More...
 
double getTol ()
 access the tolerance used in comparing timesteps More...
 
 MostCommonValue (int i=DEFAULT_DIM)
 
void reset (int i=DEFAULT_DIM)
 reset More...
 
void setTol (double t)
 set the tolerance used in comparing timesteps More...
 

Private Attributes

std::vector< int > counts
 number of times this value has been seen More...
 
int N
 number of different values to be considered More...
 
double tol
 tolerance in comparing input to values[] More...
 
std::vector< double > values
 value being considered - parallel to counts More...
 

Constructor & Destructor Documentation

◆ MostCommonValue()

gnsstk::MostCommonValue::MostCommonValue ( int  i = DEFAULT_DIM)
inline

only ctor; argument is the maximum number of values to remember and count (9)

Definition at line 73 of file MostCommonValue.hpp.

Member Function Documentation

◆ add()

void gnsstk::MostCommonValue::add ( double  dt)
inline

add a measured timestep to the analysis

Definition at line 84 of file MostCommonValue.hpp.

◆ bestDT()

double gnsstk::MostCommonValue::bestDT ( )
inline

return the best estimate of timestep

Definition at line 122 of file MostCommonValue.hpp.

◆ bestN()

int gnsstk::MostCommonValue::bestN ( )
inline

return count for best estimate

Definition at line 138 of file MostCommonValue.hpp.

◆ dump()

void gnsstk::MostCommonValue::dump ( std::ostream &  os,
int  prec = 3 
)
inline

dump the table of values and counts

Definition at line 168 of file MostCommonValue.hpp.

◆ getResults()

void gnsstk::MostCommonValue::getResults ( std::vector< int > &  out_counts,
std::vector< double > &  out_values 
)
inline

get the table of all the values and the number of times seen

Definition at line 160 of file MostCommonValue.hpp.

◆ getTol()

double gnsstk::MostCommonValue::getTol ( )
inline

access the tolerance used in comparing timesteps

Definition at line 154 of file MostCommonValue.hpp.

◆ reset()

void gnsstk::MostCommonValue::reset ( int  i = DEFAULT_DIM)
inline

reset

Definition at line 76 of file MostCommonValue.hpp.

◆ setTol()

void gnsstk::MostCommonValue::setTol ( double  t)
inline

set the tolerance used in comparing timesteps

Definition at line 157 of file MostCommonValue.hpp.

Member Data Documentation

◆ counts

std::vector<int> gnsstk::MostCommonValue::counts
private

number of times this value has been seen

Definition at line 63 of file MostCommonValue.hpp.

◆ N

int gnsstk::MostCommonValue::N
private

number of different values to be considered

Definition at line 61 of file MostCommonValue.hpp.

◆ tol

double gnsstk::MostCommonValue::tol
private

tolerance in comparing input to values[]

Definition at line 62 of file MostCommonValue.hpp.

◆ values

std::vector<double> gnsstk::MostCommonValue::values
private

value being considered - parallel to counts

Definition at line 64 of file MostCommonValue.hpp.


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


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:45