GeoModel - GeoModelCore
Rectangular.h
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 //----------------------Rectangular-----------------------------------------//
7 // //
8 // Class Rectangular //
9 // //
10 //--------------------------------------------------------------------------//
11 #ifndef Rectangular_h
12 #define Rectangular_h 1
13 #include "GeoGenericFunctions/AbsFunction.h"
14 #include "GeoGenericFunctions/Parameter.h"
15 namespace GeoGenfun {
16 
21  class Rectangular : public AbsFunction {
22 
23  FUNCTION_OBJECT_DEF(Rectangular)
24 
25  public:
26 
27  // Constructor
28  Rectangular();
29 
30  // Copy constructor
31  Rectangular(const Rectangular &right);
32 
33  // Destructor
34  virtual ~Rectangular();
35 
36  // Retreive function value
37  virtual double operator ()(double argument) const override;
38  virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
39 
40  // Get the position of the first discontinuity
41  const Parameter & x0() const;
42  Parameter & x0();
43 
44  // Get the position of the second discontinuity
45  const Parameter & x1() const;
46  Parameter & x1();
47 
48  // Get the value of the function at its baseline
49  const Parameter & baseline() const;
50  Parameter & baseline();
51 
52  // Get the value of the function at its top
53  const Parameter & height() const;
54  Parameter & height();
55 
56  // Derivative.
57  Derivative partial (unsigned int) const override;
58 
59  // Does this function have an analytic derivative?
60  virtual bool hasAnalyticDerivative() const override {return true;}
61 
62  private:
63 
64  // It is illegal to assign an adjustable constant
65  const Rectangular & operator=(const Rectangular &right);
66 
67  // Here is the decay constant
68  Parameter _x0;
69  Parameter _x1;
70  Parameter _baseline;
71  Parameter _height;
72 
73  };
74 } // namespace Genfun
75 #endif
Definition: Abs.h:15