mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-11 03:20:46 +01:00
Functions can act on maps
This commit is contained in:
parent
6addec5e14
commit
be14739695
@ -111,6 +111,20 @@ double DoubleFunction::operator()(void) const
|
|||||||
return (*this)(nullptr);
|
return (*this)(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<double, double> DoubleFunction::operator()(const std::map<double, double> &m) const
|
||||||
|
{
|
||||||
|
checkSize(1);
|
||||||
|
|
||||||
|
std::map<double, double> res;
|
||||||
|
|
||||||
|
for (auto &val: m)
|
||||||
|
{
|
||||||
|
res[val.first] = (*this)(val.second);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
// bind ////////////////////////////////////////////////////////////////////////
|
// bind ////////////////////////////////////////////////////////////////////////
|
||||||
DoubleFunction DoubleFunction::bind(const Index argIndex,
|
DoubleFunction DoubleFunction::bind(const Index argIndex,
|
||||||
const double val) const
|
const double val) const
|
||||||
|
@ -52,6 +52,7 @@ public:
|
|||||||
double operator()(void) const;
|
double operator()(void) const;
|
||||||
template <typename... Ts>
|
template <typename... Ts>
|
||||||
double operator()(const double arg0, const Ts... args) const;
|
double operator()(const double arg0, const Ts... args) const;
|
||||||
|
std::map<double, double> operator()(const std::map<double, double> &m) const;
|
||||||
// bind
|
// bind
|
||||||
DoubleFunction bind(const Index argIndex, const double val) const;
|
DoubleFunction bind(const Index argIndex, const double val) const;
|
||||||
DoubleFunction bind(const Index argIndex, const DVec &x) const;
|
DoubleFunction bind(const Index argIndex, const DVec &x) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user