CFL
Approx.hpp
Go to the documentation of this file.
1 //Copyright (c) Dmitry Kramkov, 2000-2006. All rights reserved.
2 
3 #ifndef __cflApprox_hpp__
4 #define __cflApprox_hpp__
5 
6 #include "cfl/Interp.hpp"
7 
18 
22 namespace cfl
23 {
36 
38 
43  class IApprox
44  {
45  public:
49  virtual ~IApprox(){};
50 
57  virtual IApprox* newApprox(double dLeft, double dRight) const = 0;
58 
66  virtual const std::valarray<double>& arg() const = 0;
67 
74  virtual Function approximate(const std::valarray<double>& rValues) const = 0;
75  };
76 
77 
79 
85  class Approx
86  {
87  public:
92  explicit Approx(IApprox * pNewP = 0);
93 
99  void assign(double dLeft, double dRight);
100 
104  const std::valarray<double> & arg() const;
105 
109  Function approximate(const std::valarray<double> & rValues) const;
110 
111  private:
113  };
114 
116 
121  namespace NApprox
122  {
129  Approx chebyshev(const Function & rSize);
130 
141  Approx toApprox(const Function & rSize, const Interp & rInterp);
142  }
144 }
145 
146 #include "cfl/Inline/iApprox.hpp"
147 #endif // of __cflApprox_hpp__
Standard concrete class for interpolation of one-dimensional functions.
Definition: Interp.hpp:57
Concrete class for a one-dimensional function.
Definition: Function.hpp:78
virtual Function approximate(const std::valarray< double > &rValues) const =0
virtual IApprox * newApprox(double dLeft, double dRight) const =0
Approx chebyshev(const Function &rSize)
Interpolation of one-dimensional functions.
virtual ~IApprox()
Definition: Approx.hpp:49
Main namespace for cfl library.
Definition: Approx.hpp:22
Standard concrete class for numerical approximation.
Definition: Approx.hpp:85
Interface class for numerical approximation.
Definition: Approx.hpp:43
virtual const std::valarray< double > & arg() const =0
Approx toApprox(const Function &rSize, const Interp &rInterp)