Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

formula/formulaLiCo.hh
Go to the documentation of this file.
00001 #ifndef formulaLiCo_hh
00002 #define formulaLiCo_hh
00003 
00004 #include "formula.hh"
00005 
00006 namespace concepts {
00007 
00012   class FormulaLiCo : public Formula<Real> {
00013   public:
00020     FormulaLiCo(const Formula<Real>& frmA, const Formula<Real>& frmB, Real cA, Real cB)
00021       : frmA_(frmA), frmB_(frmB), cA_(cA), cB_(cB) { }
00023     virtual Formula<Real> * clone () const {
00024       return new FormulaLiCo(frmA_, frmB_, cA_, cB_);
00025     }
00026 
00028     virtual Real operator() (const Real p, const Real t=0.0) const {
00029       return cA_*frmA_(p, t) + cB_*frmB_(p, t);
00030     }
00032     virtual Real operator() (const Real2d &p, const Real t=0.0) const {
00033       return cA_*frmA_(p, t) + cB_*frmB_(p, t);
00034     }
00036     virtual Real operator() (const Real3d &p, const Real t=0.0) const {
00037       return cA_*frmA_(p, t) + cB_*frmB_(p, t);
00038     }
00039   private:
00040     const Formula<Real>& frmA_;
00041     const Formula<Real>& frmB_;
00042     const Real cA_;
00043     const Real cB_;
00044   };
00045 
00046 } // namespace concepts
00047 
00048 #endif //formulaLiCo_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)