GeoModel - GeoModelCore
FunctionDifference.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 
7 
8 //--------------------------FunctionDifference------------------------------//
9 // //
10 // FunctionDifference, result of subtraction of two functions //
11 // //
12 //--------------------------------------------------------------------------//
13 
14 #ifndef FunctionDifference_h
15 #define FunctionDifference_h 1
16 #include "GeoGenericFunctions/AbsFunction.h"
17 
18 // For persistification:
19 class FunctionDifferenceRecorder;
20 
21 namespace GeoGenfun {
22 
24 
25  FUNCTION_OBJECT_DEF(FunctionDifference)
26 
27  public:
28 
29  // Constructor
30  FunctionDifference(const AbsFunction* arg1, const AbsFunction *arg2);
31 
32  // Copy constructor
34 
35  // Destructor
36  virtual ~FunctionDifference();
37 
38  // Retreive function value
39  virtual double operator ()(double argument) const override;
40  virtual double operator ()(const Argument & a) const override;
41 
42  // Dimensionality
43  virtual unsigned int dimensionality() const override;
44 
45  // Derivative.
46  virtual Derivative partial (unsigned int) const override;
47 
48  // Does this function have an analytic derivative?
49  virtual bool hasAnalyticDerivative() const override {return true;}
50 
51  private:
52 
53  // It is illegal to assign a FunctionDifference
54  const FunctionDifference & operator=(const FunctionDifference &right);
55 
56  const AbsFunction *_arg1;
57  const AbsFunction *_arg2;
58 
59  // For persistification:
60  friend class ::FunctionDifferenceRecorder;
61 
62  };
63 } // namespace GeoGenfun
64 #endif
Definition: Abs.h:15