Jpp  pmt_effective_area_update
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JMATH::JPower Class Reference

Power law function object. More...

#include <JPower.hh>

Public Member Functions

 JPower (const double alpha, const double factor=1.0)
 Constructor. More...
 
double getValue (const double x) const
 Function value. More...
 
double getDerivative (const double x) const
 Derivative value. More...
 
double getIntegral (const double x) const
 Integral value. More...
 
double operator() (const double x) const
 Function value. More...
 

Protected Attributes

double alpha
 
double factor
 

Friends

std::istream & operator>> (std::istream &in, JPower &object)
 Read power from input. More...
 
std::ostream & operator<< (std::ostream &out, const JPower &object)
 Write power to output. More...
 

Detailed Description

Power law function object.

Evaluation of function, derivative and integral values.

Definition at line 22 of file JPower.hh.

Constructor & Destructor Documentation

JMATH::JPower::JPower ( const double  alpha,
const double  factor = 1.0 
)
inline

Constructor.

Parameters
alphaspectral index
factormultiplication factor

Definition at line 30 of file JPower.hh.

32  {
33  this->alpha = alpha;
34  this->factor = factor;
35  }
double alpha
Definition: JPower.hh:117
double factor
Definition: JPower.hh:118

Member Function Documentation

double JMATH::JPower::getValue ( const double  x) const
inline

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 44 of file JPower.hh.

45  {
46  return factor * pow(x, alpha);
47  }
double alpha
Definition: JPower.hh:117
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double factor
Definition: JPower.hh:118
double JMATH::JPower::getDerivative ( const double  x) const
inline

Derivative value.

Parameters
xabscissa value
Returns
derivative value

Definition at line 56 of file JPower.hh.

57  {
58  return factor * alpha * pow(x, alpha - 1);
59  }
double alpha
Definition: JPower.hh:117
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double factor
Definition: JPower.hh:118
double JMATH::JPower::getIntegral ( const double  x) const
inline

Integral value.

Parameters
xabscissa value
Returns
integral value

Definition at line 68 of file JPower.hh.

69  {
70  if (alpha != -1.0)
71  return factor * pow(x, alpha + 1) / (alpha + 1);
72  else
73  return factor * log(x);
74  }
double alpha
Definition: JPower.hh:117
T pow(const T &x, const double y)
Power .
Definition: JMath.hh:98
double factor
Definition: JPower.hh:118
double JMATH::JPower::operator() ( const double  x) const
inline

Function value.

Parameters
xabscissa value
Returns
function value

Definition at line 83 of file JPower.hh.

84  {
85  return getValue(x);
86  }
double getValue(const double x) const
Function value.
Definition: JPower.hh:44

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JPower object 
)
friend

Read power from input.

Parameters
ininput stream
objectpower
Returns
input stream

Definition at line 96 of file JPower.hh.

97  {
98  in >> object.alpha >> object.factor;
99 
100  return in;
101  }
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:40
std::ostream& operator<< ( std::ostream &  out,
const JPower object 
)
friend

Write power to output.

Parameters
outoutput stream
objecttrigonometric
Returns
output stream

Definition at line 111 of file JPower.hh.

112  {
113  return out << object.alpha << ' ' << object.factor;
114  }

Member Data Documentation

double JMATH::JPower::alpha
protected

Definition at line 117 of file JPower.hh.

double JMATH::JPower::factor
protected

Definition at line 118 of file JPower.hh.


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