Scaler Class Reference

#include <Scaler.h>

Public Member Functions

 Scaler (const Libpf::Utility::ScalingMode &sm, double xmin, double xmax, double ymin=1.0, double ymax=10.0)
 
 Scaler (void)
 defaults to ScalingMode::noscaling ScalingMode More...
 
void setup (const Libpf::Utility::ScalingMode &sm, double xmin, double xmax, double ymin=1.0, double ymax=10.0)
 
void setup (double ymin, double ymax)
 
double X (double x_)
 scale More...
 
double x (double y_)
 unscale More...
 
double dX (double x_)
 differential for scaling (dX(x)/dx) More...
 
double dx (double y_)
 differential for unscaling (dx(X)/dX) More...
 
double xmin (void) const
 
double xmax (void) const
 
double deltax (void) const
 
double ymin (void) const
 
double ymax (void) const
 
double deltay (void) const
 
const std::string & tostring (void)
 returns a reference to a string describing the current mode of the Scaler More...
 

Detailed Description

Provides scaling of a scalar variable

#include <libpf/core/Scaler.h>

Note
ScalingMode::log requires that xmin and xmax must be non-null and xmin and xmax must have the same sign
ScalingMode::power requires that xmin and xmax must be different from zero and have the same sign, and ymin and ymax must be different from zero and have the same sign
idempotency (scaled value is equal to unscaled value provided xmin = ymin and xmax = ymax) is guaranteed only for ScalingMode::nocaling, linear and power
Warning
Thread safe:
Extendable:
Platform dependencies:

Constructor & Destructor Documentation

◆ Scaler() [1/2]

Scaler::Scaler ( const Libpf::Utility::ScalingMode sm,
double  xmin,
double  xmax,
double  ymin = 1.0,
double  ymax = 10.0 
)
Parameters
smScalingMode
xminminimum unscaled value
xmaxmaximum unscaled value
yminminimum scaled value
ymaxmaximum scaled value

◆ Scaler() [2/2]

Scaler::Scaler ( void  )

defaults to ScalingMode::noscaling ScalingMode

Member Function Documentation

◆ deltax()

double Scaler::deltax ( void  ) const

◆ deltay()

double Scaler::deltay ( void  ) const

◆ dX()

double Scaler::dX ( double  x_)

differential for scaling (dX(x)/dx)

◆ dx()

double Scaler::dx ( double  y_)

differential for unscaling (dx(X)/dX)

◆ setup() [1/2]

void Scaler::setup ( const Libpf::Utility::ScalingMode sm,
double  xmin,
double  xmax,
double  ymin = 1.0,
double  ymax = 10.0 
)

resets the Scaler

Parameters
smScalingMode
xminminimum unscaled value
xmaxmaximum unscaled value
yminminimum scaled value
ymaxmaximum scaled value

◆ setup() [2/2]

void Scaler::setup ( double  ymin,
double  ymax 
)

resets only the scaled range; ScalingMode and unscaled range are unchanged

Parameters
yminminimum scaled value
ymaxmaximum scaled value

◆ tostring()

const std::string & Scaler::tostring ( void  )

returns a reference to a string describing the current mode of the Scaler

◆ X()

double Scaler::X ( double  x_)

scale

◆ x()

double Scaler::x ( double  y_)

unscale

◆ xmax()

double Scaler::xmax ( void  ) const

◆ xmin()

double Scaler::xmin ( void  ) const

◆ ymax()

double Scaler::ymax ( void  ) const

◆ ymin()

double Scaler::ymin ( void  ) const

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