basis.hh

Go to the documentation of this file.
1 
7 #ifndef fncbasis_hh
8 #define fncbasis_hh
9 
10 #include "basics/outputOperator.hh"
11 #include "space/space.hh"
12 
13 namespace concepts {
14 
15  // ************************************************************** Function **
16 
20  template<class F>
21  class Function : public virtual OutputOperator {
22  public:
24  template<class G>
25  inline Function(const Space<G>& spc) : dim_(spc.dim()) {}
26  inline Function(const uint dim) : dim_(dim) {}
27 
29  virtual Function<F>& operator=(const Function<F>& fnc) = 0;
30 
32  virtual F& operator()(uint i) = 0;
34  virtual F operator()(uint i) const = 0;
35 
37  virtual Function<F>& operator+=(const Function<F>& fnc);
39  virtual Function<F>& operator+=(F c);
40 
42  virtual Function<F>& operator-=(const Function<F>& fnc);
44  virtual Function<F>& operator-=(F c);
45 
47  virtual Function<F>& operator*=(F a);
48 
50  virtual Function<F>& add(const Function<F>& fnc, F a);
51 
53  uint dim() const { return dim_; }
54  protected:
55  virtual std::ostream& info(std::ostream& os) const;
57  uint dim_;
58  };
59 
60 } // namespace concepts
61 
62 #endif // fncbasis_hh
Function(const Space< G > &spc)
Constructor.
Definition: basis.hh:25
virtual Function< F > & operator+=(const Function< F > &fnc)
Addition operator.
Abstract class for a function.
Definition: basis.hh:21
virtual F operator()(uint i) const =0
Index operator.
virtual Function< F > & operator+=(F c)
Addition operator.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Function< F > & add(const Function< F > &fnc, F a)
Adds a times fnc to this function.
virtual Function< F > & operator-=(F c)
Subtraction operator.
virtual Function< F > & operator*=(F a)
Scaling operator.
uint dim_
Dimension of the function (or of the space the function is defined)
Definition: basis.hh:57
uint dim() const
Returns the dimension of the function.
Definition: basis.hh:53
virtual F & operator()(uint i)=0
Index operator.
virtual Function< F > & operator=(const Function< F > &fnc)=0
Assignment operator.
virtual Function< F > & operator-=(const Function< F > &fnc)
Subtraction operator.
Function(const uint dim)
Definition: basis.hh:26
Class providing an output operator.
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