PowerLaw.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006 by Aidan Hotan
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/MEAL/MEAL/PowerLaw.h
10 
11 #ifndef __PowerLaw_H
12 #define __PowerLaw_H
13 
14 #include "MEAL/Univariate.h"
15 #include "MEAL/Scalar.h"
16 #include "MEAL/Parameters.h"
17 
18 namespace MEAL {
19 
21  class PowerLaw : public Univariate<Scalar> {
22 
23  public:
24 
25  PowerLaw ();
26 
28  void set_scale (double scale);
29 
31  double get_scale () const;
32 
34  void set_offset (double offset);
35 
37  double get_offset () const;
38 
40  void set_power (double power);
41 
43  double get_power () const;
44 
45  // ///////////////////////////////////////////////////////////////////
46  //
47  // Function implementation
48  //
49  // ///////////////////////////////////////////////////////////////////
50 
52  std::string get_name () const;
53 
54  protected:
55 
57  void calculate (double& x, std::vector<double>* grad=0);
58 
59  private:
60 
62  Parameters parameters;
63 
64  };
65 
66 }
67 
68 #endif
Abstract base class implements parameter storage and access.
Definition: Parameters.h:28
double get_offset() const
Get the horizontal offset.
Definition: PowerLaw.C:45
void set_offset(double offset)
Set the horizontal offset.
Definition: PowerLaw.C:39
std::string get_name() const
Return the name of the class.
Definition: PowerLaw.C:20
const ScalarMath log(const ScalarMath &x)
Return a ScalarMath instance representing log(x)
Definition: ScalarMath.C:232
void calculate(double &x, std::vector< double > *grad=0)
Return the value (and gradient, if requested) of the function.
Definition: PowerLaw.C:63
const ScalarMath pow(const ScalarMath &x, const ScalarMath &y)
Return a ScalarMath instance representing x^y.
Definition: ScalarMath.C:264
Namespace in which all modeling and calibration related code is declared.
Definition: ExampleComplex2.h:16
double get_scale() const
Get the centre.
Definition: PowerLaw.C:33
double get_power() const
Get the power.
Definition: PowerLaw.C:57
void set_scale(double scale)
Set the amplitude scale factor.
Definition: PowerLaw.C:27
void set_power(double power)
Set the power.
Definition: PowerLaw.C:51

Generated using doxygen 1.8.17