HOPS
HOPS class reference
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
hops::MHO_UniformGridPointsCalculator Class Reference

Class MHO_UniformGridPointsCalculator. More...

#include <MHO_UniformGridPointsCalculator.hh>

Public Member Functions

 MHO_UniformGridPointsCalculator ()
 
 ~MHO_UniformGridPointsCalculator ()
 
void Calculate ()
 Calculates uniform grid points and adjusts point count until spacing error is resolved. More...
 
double GetGridAverage () const
 Getter for grid average. More...
 
std::map< std::size_t, std::size_t > GetGridIndexMap ()
 Getter for grid index map maps the indexes of the original points to their new locations in the uniform grid array. More...
 
void GetGridPoints (std::vector< double > *grid_pts)
 Getter for grid points. More...
 
double GetGridSpacing () const
 Getter for grid spacing - the distance between points on the uniform grid. More...
 
double GetGridStart () const
 Getter for grid start. More...
 
std::size_t GetNGridPoints () const
 Getter for the number of points in the uniform grid. More...
 
bool GetSpacingErrorStatus () const
 Getter for spacing error status. More...
 
double GetSpread () const
 Getter for spread - the grid spread about the average. More...
 
void GetUniquePoints (const std::vector< double > &in_pts, double eps, std::vector< double > &out_pts, std::map< std::size_t, std::size_t > &index_map) const
 pre-processing step – makes sure the points are unique given some epsilon and if not, then provides a std::map<int, int> to map the input vector indices to the output vector More...
 
void SetDefaultGridPoints (std::size_t n)
 Setter for default grid points. More...
 
void SetEpsilon (double eps)
 Setter for epsilon. More...
 
void SetPoints (const double *pts, std::size_t npts)
 Setter for points - expects points to be given in increasing order. More...
 
void SetPoints (const std::vector< double > &pts)
 Setter for points - expects points to be given in increasing order. More...
 

Protected Member Functions

void Calculate_v1 (int max_pts=8192)
 Calculates uniform grid points for frequency data up to a maximum number of points. based on original implementation (freq_spacing.c), default max number of points is 8192. More...
 
void Calculate_v2 ()
 Calculates uniform grid points without enforcing power-of-2 size - untested, not used. More...
 
void FindStartAndMinMaxSpacing ()
 Finds start point and minimum/maximum spacing between points in a list. More...
 

Protected Attributes

double fAbsEps
 
double fAverageLocation
 
int fDefaultGridPoints
 
double fEpsilon
 
std::map< std::size_t, std::size_t > fIndexMap
 
double fMaxSpacing
 
double fMinSpacing
 
double fNGridPoints
 
std::vector< double > fPoints
 
double fSpacing
 
bool fSpacingError
 
double fSpread
 
double fStart
 

Detailed Description

Class MHO_UniformGridPointsCalculator.

Constructor & Destructor Documentation

◆ MHO_UniformGridPointsCalculator()

hops::MHO_UniformGridPointsCalculator::MHO_UniformGridPointsCalculator ( )

◆ ~MHO_UniformGridPointsCalculator()

hops::MHO_UniformGridPointsCalculator::~MHO_UniformGridPointsCalculator ( )

Member Function Documentation

◆ Calculate()

void hops::MHO_UniformGridPointsCalculator::Calculate ( )

Calculates uniform grid points and adjusts point count until spacing error is resolved.

◆ Calculate_v1()

void hops::MHO_UniformGridPointsCalculator::Calculate_v1 ( int  max_pts = 8192)
protected

Calculates uniform grid points for frequency data up to a maximum number of points. based on original implementation (freq_spacing.c), default max number of points is 8192.

Parameters
max_ptsMaximum number of frequency points to consider.

◆ Calculate_v2()

void hops::MHO_UniformGridPointsCalculator::Calculate_v2 ( )
protected

Calculates uniform grid points without enforcing power-of-2 size - untested, not used.

◆ FindStartAndMinMaxSpacing()

void hops::MHO_UniformGridPointsCalculator::FindStartAndMinMaxSpacing ( )
protected

Finds start point and minimum/maximum spacing between points in a list.

◆ GetGridAverage()

double hops::MHO_UniformGridPointsCalculator::GetGridAverage ( ) const
inline

Getter for grid average.

Returns
The average point location as a double.

◆ GetGridIndexMap()

std::map< std::size_t, std::size_t > hops::MHO_UniformGridPointsCalculator::GetGridIndexMap ( )
inline

Getter for grid index map maps the indexes of the original points to their new locations in the uniform grid array.

Returns
std::pair<std::size_t, std::size_t representing the index mapping.

◆ GetGridPoints()

void hops::MHO_UniformGridPointsCalculator::GetGridPoints ( std::vector< double > *  grid_pts)

Getter for grid points.

Parameters
grid_pts(std::vector< double >*)

◆ GetGridSpacing()

double hops::MHO_UniformGridPointsCalculator::GetGridSpacing ( ) const
inline

Getter for grid spacing - the distance between points on the uniform grid.

Returns
Current grid spacing as a double.

◆ GetGridStart()

double hops::MHO_UniformGridPointsCalculator::GetGridStart ( ) const
inline

Getter for grid start.

Returns
The starting point of the grid as a double.

◆ GetNGridPoints()

std::size_t hops::MHO_UniformGridPointsCalculator::GetNGridPoints ( ) const
inline

Getter for the number of points in the uniform grid.

Returns
Number of grid points as std::size_t.

◆ GetSpacingErrorStatus()

bool hops::MHO_UniformGridPointsCalculator::GetSpacingErrorStatus ( ) const
inline

Getter for spacing error status.

Returns
Boolean indicating whether there is a spacing error.

◆ GetSpread()

double hops::MHO_UniformGridPointsCalculator::GetSpread ( ) const
inline

Getter for spread - the grid spread about the average.

Returns
Current spread value as a double

◆ GetUniquePoints()

void hops::MHO_UniformGridPointsCalculator::GetUniquePoints ( const std::vector< double > &  in_pts,
double  eps,
std::vector< double > &  out_pts,
std::map< std::size_t, std::size_t > &  index_map 
) const

pre-processing step – makes sure the points are unique given some epsilon and if not, then provides a std::map<int, int> to map the input vector indices to the output vector

Parameters
in_ptsInput vector of double precision points
epsEpsilon value for uniqueness check
out_ptsOutput vector of unique points
index_mapMap from input index to output index

◆ SetDefaultGridPoints()

void hops::MHO_UniformGridPointsCalculator::SetDefaultGridPoints ( std::size_t  n)
inline

Setter for default grid points.

Parameters
nInput number of grid points

◆ SetEpsilon()

void hops::MHO_UniformGridPointsCalculator::SetEpsilon ( double  eps)
inline

Setter for epsilon.

Parameters
epsInput epsilon value of type double

◆ SetPoints() [1/2]

void hops::MHO_UniformGridPointsCalculator::SetPoints ( const double *  pts,
std::size_t  npts 
)

Setter for points - expects points to be given in increasing order.

Parameters
ptsInput vector of double values representing grid points

◆ SetPoints() [2/2]

void hops::MHO_UniformGridPointsCalculator::SetPoints ( const std::vector< double > &  pts)

Setter for points - expects points to be given in increasing order.

Parameters
ptsInput points vector

Member Data Documentation

◆ fAbsEps

double hops::MHO_UniformGridPointsCalculator::fAbsEps
protected

◆ fAverageLocation

double hops::MHO_UniformGridPointsCalculator::fAverageLocation
protected

◆ fDefaultGridPoints

int hops::MHO_UniformGridPointsCalculator::fDefaultGridPoints
protected

◆ fEpsilon

double hops::MHO_UniformGridPointsCalculator::fEpsilon
protected

◆ fIndexMap

std::map< std::size_t, std::size_t > hops::MHO_UniformGridPointsCalculator::fIndexMap
protected

◆ fMaxSpacing

double hops::MHO_UniformGridPointsCalculator::fMaxSpacing
protected

◆ fMinSpacing

double hops::MHO_UniformGridPointsCalculator::fMinSpacing
protected

◆ fNGridPoints

double hops::MHO_UniformGridPointsCalculator::fNGridPoints
protected

◆ fPoints

std::vector< double > hops::MHO_UniformGridPointsCalculator::fPoints
protected

◆ fSpacing

double hops::MHO_UniformGridPointsCalculator::fSpacing
protected

◆ fSpacingError

bool hops::MHO_UniformGridPointsCalculator::fSpacingError
protected

◆ fSpread

double hops::MHO_UniformGridPointsCalculator::fSpread
protected

◆ fStart

double hops::MHO_UniformGridPointsCalculator::fStart
protected

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