Class documentation of Concepts

Loading...
Searching...
No Matches
formulaLiCo.hh
Go to the documentation of this file.
1
8#ifndef formulaLiCo_hh
9#define formulaLiCo_hh
10
11#include "formula.hh"
12
13namespace concepts {
14
19 class FormulaLiCo : public Formula<Real> {
20 public:
28 : frmA_(frmA), frmB_(frmB), cA_(cA), cB_(cB) { }
30 virtual Formula<Real> * clone () const {
31 return new FormulaLiCo(frmA_, frmB_, cA_, cB_);
32 }
33
35 virtual Real operator() (const Real p, const Real t=0.0) const {
36 return cA_*frmA_(p, t) + cB_*frmB_(p, t);
37 }
39 virtual Real operator() (const Real2d &p, const Real t=0.0) const {
40 return cA_*frmA_(p, t) + cB_*frmB_(p, t);
41 }
43 virtual Real operator() (const Real3d &p, const Real t=0.0) const {
44 return cA_*frmA_(p, t) + cB_*frmB_(p, t);
45 }
46 private:
47 const Formula<Real>& frmA_;
48 const Formula<Real>& frmB_;
49 const Real cA_;
50 const Real cB_;
51 };
52
53} // namespace concepts
54
55#endif //formulaLiCo_hh
virtual Real operator()(const Real p, const Real t=0.0) const
Application operator for one dimension.
virtual Formula< Real > * clone() const
Return a clone of this linear combination.
FormulaLiCo(const Formula< Real > &frmA, const Formula< Real > &frmB, Real cA, Real cB)
double Real
Definition typedefs.hh:39
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320