mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-11 03:20:46 +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 ////////////////////////////////////////////////////////////////
|
// constructors ////////////////////////////////////////////////////////////////
|
||||||
TabFunction::TabFunction(const DVec &x, const DVec &y,
|
TabFunction::TabFunction(const DVec &x, const DVec &y,
|
||||||
const InterpType interpType)
|
const InterpType interpType)
|
||||||
: interpType_(interpType)
|
|
||||||
{
|
{
|
||||||
setData(x, y);
|
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 //////////////////////////////////////////////////////////////////////
|
// access //////////////////////////////////////////////////////////////////////
|
||||||
void TabFunction::setData(const DVec &x, const DVec &y)
|
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)
|
void TabFunction::setInterpolationType(const InterpType interpType)
|
||||||
//{
|
{
|
||||||
// setData(data.x(i), data.y(j));
|
interpType_ = interpType;
|
||||||
//}
|
}
|
||||||
|
|
||||||
// function call ///////////////////////////////////////////////////////////////
|
// function call ///////////////////////////////////////////////////////////////
|
||||||
double TabFunction::operator()(const double *arg) const
|
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();
|
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 TabFunction::nearest(const double x) const
|
||||||
{
|
{
|
||||||
map<double, double>::const_iterator ret;
|
map<double, double>::const_iterator ret;
|
||||||
|
@ -45,13 +45,11 @@ public:
|
|||||||
TabFunction(void) = default;
|
TabFunction(void) = default;
|
||||||
TabFunction(const DVec &x, const DVec &y,
|
TabFunction(const DVec &x, const DVec &y,
|
||||||
const InterpType interpType = InterpType::LINEAR);
|
const InterpType interpType = InterpType::LINEAR);
|
||||||
//TabFunction(const XYStatData &data, const Index i = 0, const Index j = 0,
|
|
||||||
// const InterpType interpType = InterpType::LINEAR);
|
|
||||||
// destructor
|
// destructor
|
||||||
virtual ~TabFunction(void) = default;
|
virtual ~TabFunction(void) = default;
|
||||||
// access
|
// access
|
||||||
void setData(const DVec &x, const DVec &y);
|
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
|
// function call
|
||||||
double operator()(const double *arg) const;
|
double operator()(const double *arg) const;
|
||||||
// factory
|
// factory
|
||||||
@ -65,9 +63,6 @@ private:
|
|||||||
|
|
||||||
DoubleFunction interpolate(const DVec &x, const DVec &y,
|
DoubleFunction interpolate(const DVec &x, const DVec &y,
|
||||||
const InterpType interpType = InterpType::LINEAR);
|
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
|
END_LATAN_NAMESPACE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user