frmE_conjugate.hh

Go to the documentation of this file.
1 
8 #ifndef FORMULA_FRME_CONJUGATE_HH_
9 #define FORMULA_FRME_CONJUGATE_HH_
10 
11 #include "basics/debug.hh"
12 #include "basics/output.hh"
13 #include "toolbox/sharedPointer.hh"
15 #include "exceptions.hh"
16 
17 #define ConjElemFormDestr_D 0
18 #define ConjElemFormClone_D 0
19 
20 namespace concepts {
21 
22 
23  // *********************************************************** FrmE_Product **
24 
32  template<typename F,
33  typename G = typename Realtype<F>::type>
34  class FrmE_Conjugate : public ElementFormula<F,G> {
35  public:
37  if (frm.empty()) throw(PointerToEmptyElementFormula());
38  }
39 
40  virtual ~FrmE_Conjugate() {
41  DEBUGL(ConjElemFormDestr_D, "Delete " << *this)
42  }
43  virtual F operator() (const ElementWithCell<G>& elm,
44  const Real p, const Real t = 0.0) const
45  {
46  return std::conj(frm_(elm, p, t));
47  }
48  virtual F operator() (const ElementWithCell<G>& elm,
49  const Real2d& p, const Real t = 0.0) const
50  {
51  return std::conj(frm_(elm, p, t));
52  }
53  virtual F operator() (const ElementWithCell<G>& elm,
54  const Real3d& p, const Real t = 0.0) const
55  {
56  return std::conj(frm_(elm, p, t));
57  }
58  virtual FrmE_Conjugate<F,G>* clone() const {
60  return new FrmE_Conjugate<F,G>(frm_);
61  }
62  protected:
63  virtual std::ostream& info(std::ostream& os) const {
64  return os << concepts::typeOf(*this) << "(" << frm_ << ")";
65  }
66  private:
69  };
70 
71 } // namespace concepts
72 
73 namespace std {
74 
75  // ************************************************************ std::conj **
76 
77  template<class F>
80  {
81  return FrmE_Conjugate(frm);
82  }
83 
84 } // namespace std
85 
86 #endif /* FORMULA_FRME_CONJUGATE_HH_ */
virtual F operator()(const ElementWithCell< G > &elm, const Real p, const Real t=0.0) const
const concepts::Real conj(const concepts::Real &v)
Returns the conjugate complex of a real value.
Definition: operations.hh:83
virtual FrmE_Conjugate< F, G > * clone() const
Virtual constructor.
Element with cell.
#define DEBUGL(doit, msg)
bool empty() const
Returns true if no formula is stored.
#define ConjElemFormClone_D
#define ConjElemFormDestr_D
Interface for a formula defined element by element.
ElementFormulaContainer< F, G > frm_
ElementFormula.
Conjugate complex of an element formula.
FrmE_Conjugate(const ElementFormulaContainer< F, G > frm)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
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