formulaContainer.hh

Go to the documentation of this file.
1 
8 #ifndef formulaContainer_hh
9 #define formulaContainer_hh
10 
11 #include "toolbox/sharedPointer.hh"
12 #include "formula.hh"
13 #include "constFormula.hh"
14 
15 
16 namespace concepts {
17 
18 
19  // ******************************************************** FormulaContainer **
20 
21  template<class F>
22  class FormulaContainer : public Formula<F> {
23  public:
31  FormulaContainer(const F x);
32 
36 
46  explicit FormulaContainer(const Formula<F>* frm);
49 
54  virtual F operator() (const Real p, const Real t = 0.0) const;
55  virtual F operator() (const Real2d& p, const Real t = 0.0) const;
56  virtual F operator() (const Real3d& p, const Real t = 0.0) const;
57 
59  virtual FormulaContainer<F>* clone() const {
60  return new FormulaContainer<F>(frm_);
61  }
62 
63  const Formula<F>& frm() const { return *frm_; }
64 
66  bool empty() const { return frm_.get() == 0; }
67 
68  virtual ~FormulaContainer();
69  protected:
70  virtual std::ostream& info(std::ostream& os) const;
71  private:
74  };
75 
76 
77 } // namespace concepts
78 
79 
80 #endif // formulaContainer_hh
const Formula< F > & frm() const
FormulaContainer(const Formula< F > &frm)
Constructor for a formula, takes a clone.
virtual std::ostream & info(std::ostream &os) const
Interface for a formula.
Definition: lform.hh:18
virtual FormulaContainer< F > * clone() const
Virtual copy constructor.
FormulaContainer(const RCP< const Formula< F > > frm)
Constructor for an RCP to a formula, replaces the own RCP.
FormulaContainer(const Formula< F > *frm)
Constructor for a pointer to a formula in dynamic memory which will be deleted by this class.
FormulaContainer(const F x)
Special constructor for a constant.
Reference-counting pointer.
Definition: bf_iddiv.hh:15
virtual F operator()(const Real p, const Real t=0.0) const
Evaluates the formula.
bool empty() const
Returns true if no formula is stored.
RCP< const Formula< F > > frm_
Element formula is stored as a RCP.
FormulaContainer()
Constructor with no argument.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
FormulaContainer(const FormulaContainer< F > &frm)
Copy constructor.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich