Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
InterpolantBase.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_InterpolantBase_h_
9#define model_InterpolantBase_h_
10
11#include <map>
12#include <Eigen/Dense>
13
14namespace model
15{
16
18 {
19 int type;
20 double period;
21
23 ExtrapolationMethod(const int&,const double&);
24
25 };
26
27 class InterpolantBase : public std::map<double,double>
28 {
29
30 public:
31 typedef std::map<double,double> MapType;
32 typedef Eigen::Matrix<double,Eigen::Dynamic,2> MatrixType;
33 ExtrapolationMethod extrapolation; // 0=default, 1=constant
34
35 private:
36 static MapType matrix2Map(const MatrixType& data);
37 static MatrixType map2Matrix(const MapType& data);
38
39 virtual double _f(const double& x) const = 0;
40
41
42 public:
43
44 InterpolantBase(const MapType& data,const ExtrapolationMethod& extrap);
45 InterpolantBase(const MatrixType& data,const ExtrapolationMethod& extrap);
46 virtual ~InterpolantBase();
47 double xMin() const;
48 double xMax() const;
49 double operator()(const double& x) const; // pure virtual
50 double f(const double& x) const;
51 double atPeriodic(const double& x,const double& xL,const double& xH) const;
52 MapType& map();
53 const MapType& map() const;
54
55 };
56
57} // close namespace model
58#endif
Eigen::Matrix< double, Eigen::Dynamic, 2 > MatrixType
InterpolantBase(const MapType &data, const ExtrapolationMethod &extrap)
std::map< double, double > MapType
double operator()(const double &x) const
double atPeriodic(const double &x, const double &xL, const double &xH) const
ExtrapolationMethod extrapolation
function int_R syms a b c u real f
Definition int_R.m:4
x
Definition int_R.m:12