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