mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-05 09:35:54 +01:00
Tabulated functions: method to change interpolation type
This commit is contained in:
parent
6906b0c00d
commit
a498a836ce
@ -29,18 +29,11 @@ using namespace Latan;
|
||||
// constructors ////////////////////////////////////////////////////////////////
|
||||
TabFunction::TabFunction(const DVec &x, const DVec &y,
|
||||
const InterpType interpType)
|
||||
: interpType_(interpType)
|
||||
{
|
||||
setData(x, y);
|
||||
setInterpolationType(interpType);
|
||||
}
|
||||
|
||||
//TabFunction::TabFunction(const XYStatData &data, const Index i, const Index j,
|
||||
// const InterpType interpType)
|
||||
//: interpType_(interpType)
|
||||
//{
|
||||
// setData(data, i, j);
|
||||
//}
|
||||
|
||||
// access //////////////////////////////////////////////////////////////////////
|
||||
void TabFunction::setData(const DVec &x, const DVec &y)
|
||||
{
|
||||
@ -54,10 +47,10 @@ void TabFunction::setData(const DVec &x, const DVec &y)
|
||||
}
|
||||
}
|
||||
|
||||
//void TabFunction::setData(const XYStatData &data, const Index i, const Index j)
|
||||
//{
|
||||
// setData(data.x(i), data.y(j));
|
||||
//}
|
||||
void TabFunction::setInterpolationType(const InterpType interpType)
|
||||
{
|
||||
interpType_ = interpType;
|
||||
}
|
||||
|
||||
// function call ///////////////////////////////////////////////////////////////
|
||||
double TabFunction::operator()(const double *arg) const
|
||||
@ -154,12 +147,6 @@ DoubleFunction Latan::interpolate(const DVec &x, const DVec &y,
|
||||
return TabFunction(x, y, interpType).makeFunction();
|
||||
}
|
||||
|
||||
//DoubleFunction Latan::interpolate(const XYStatData &data, const Index i,
|
||||
// const Index j, const InterpType interpType)
|
||||
//{
|
||||
// return TabFunction(data, i, j, interpType).makeFunction();
|
||||
//}
|
||||
|
||||
map<double, double>::const_iterator TabFunction::nearest(const double x) const
|
||||
{
|
||||
map<double, double>::const_iterator ret;
|
||||
|
@ -45,13 +45,11 @@ public:
|
||||
TabFunction(void) = default;
|
||||
TabFunction(const DVec &x, const DVec &y,
|
||||
const InterpType interpType = InterpType::LINEAR);
|
||||
//TabFunction(const XYStatData &data, const Index i = 0, const Index j = 0,
|
||||
// const InterpType interpType = InterpType::LINEAR);
|
||||
// destructor
|
||||
virtual ~TabFunction(void) = default;
|
||||
// access
|
||||
void setData(const DVec &x, const DVec &y);
|
||||
// void setData(const XYStatData &data, const Index i = 0, const Index j = 0);
|
||||
void setInterpolationType(const InterpType interpType);
|
||||
// function call
|
||||
double operator()(const double *arg) const;
|
||||
// factory
|
||||
@ -65,9 +63,6 @@ private:
|
||||
|
||||
DoubleFunction interpolate(const DVec &x, const DVec &y,
|
||||
const InterpType interpType = InterpType::LINEAR);
|
||||
//DoubleFunction interpolate(const XYStatData &data, const Index i = 0,
|
||||
// const Index j = 0,
|
||||
// const InterpType interpType = InterpType::LINEAR);
|
||||
|
||||
END_LATAN_NAMESPACE
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user