Jpp  17.1.1
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  }
then cat $TRIPOD_INITIAL<< EOF1 256877.5 4743716.7-2438.42 256815.5 4743395.0-2435.53 257096.2 4743636.0-2439.5EOFfiJEditDetector-a $DETECTOR_INITIAL-s"-1 addz -6.9"-o $DETECTOReval`JPrintDetector-a $DETECTOR-O SUMMARY`for STRING in ${STRINGS[*]};do set_variable MODULE`getModule-a $DETECTOR-L"$STRING 0"`JEditDetector-a $DETECTOR-M"$MODULE setz -2.9"-o $DETECTORdonecp-p $TRIPOD_INITIAL $TRIPODJAcoustics.sh $DETECTOR_IDcat > acoustics_trigger_parameters txt<< EOFQ=0.0;TMax_s=0.020;numberOfHits=90;EOFJAcousticsEventBuilder.sh $DETECTOR $RUNS[*]INPUT_FILES=(`ls KM3NeT_ ${(l:8::0::0:) DETECTOR_ID}_0 *${^RUNS}_event.root`) cd $WORKDIRif[!$HOMEDIR-ef $WORKDIR];then cp-p $HOMEDIR/$DETECTOR $WORKDIR cp-p $HOMEDIR/$TRIPOD $WORKDIR cp-p $HOMEDIR/${^INPUT_FILES}$WORKDIR cp-p $HOMEDIR/{acoustics_fit_parameters, acoustics_trigger_parameters, disable, hydrophone, mechanics, sound_velocity, tripod, waveform}.txt $WORKDIRfisource $JPP_DIR/examples/JAcoustics/acoustics-fit-toolkit.shtimer_startinitialise stage_1B > &stage log
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
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: