frm_product.hh

Go to the documentation of this file.
1 
8 #ifndef productformula_hh
9 #define productformula_hh
10 
11 #include "basics/typedefs.hh"
12 #include "basics/output.hh"
14 #include "formulaContainer.hh"
15 #include "exceptions.hh"
16 
17 namespace concepts {
18 
19 
20  // ************************************************************ Frm_Product **
21 
30  template<class F, class H = F, class J = F>
31  class Frm_Product : public Formula<F> {
32  public:
34  const FormulaContainer<J> frm2)
35  : frm1_(frm1), frm2_(frm2)
36  {
37  if (frm1.empty()) throw(PointerToEmptyElementFormula());
38  if (frm2.empty()) throw(PointerToEmptyElementFormula());
39  }
40  virtual F operator() (const Real p, const Real t = 0.0) const {
41  return frm1_(p,t) * frm2_(p,t);
42  }
43  virtual F operator() (const Real2d& p, const Real t = 0.0) const {
44  return frm1_(p,t) * frm2_(p,t);
45  }
46  virtual F operator() (const Real3d& p, const Real t = 0.0) const {
47  return frm1_(p,t) * frm2_(p,t);
48  }
49  virtual Frm_Product<F,H,J>* clone() const {
50  return new Frm_Product<F,H,J>(frm1_, frm2_);
51  }
52  protected:
53  virtual std::ostream& info(std::ostream& os) const {
54  return os << concepts::typeOf(*this)<< "(" << frm1_ << " * " << frm2_ << ")";
55  }
56  private:
61  };
62 
63  // ************************************************************ operator* **
64 
66 
68 
70 
72 
73  // ************
74 
76 
78 
80 
82 
83 } // namespace concepts
84 
85 
86 #endif // productformula_hh
virtual std::ostream & info(std::ostream &os) const
Definition: frm_product.hh:53
virtual F operator()(const Real p, const Real t=0.0) const
Application operator.
Definition: frm_product.hh:40
const FormulaContainer< J > frm2_
Second Formula.
Definition: frm_product.hh:60
Class for a product of formula.
Definition: frm_product.hh:31
Point< typename Combtype< F, Real >::type, dim > operator*(const Real x, const Point< F, dim > &y)
const FormulaContainer< H > frm1_
First Formula.
Definition: frm_product.hh:58
Interface for a formula.
Definition: lform.hh:18
virtual Frm_Product< F, H, J > * clone() const
Definition: frm_product.hh:49
Frm_Product(const FormulaContainer< H > frm1, const FormulaContainer< J > frm2)
Definition: frm_product.hh:33
std::complex< Real > Cmplx
Type for a complex number. It also depends on the setting of Real.
Definition: typedefs.hh:39
bool empty() const
Returns true if no formula is stored.
std::string typeOf(const T &t)
Return the typeid name of a class object.
Definition: output.hh:43
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Exception class to express that the RCP pointer points to 0.
Definition: exceptions.hh:55
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich