mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 00:45:36 +00: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);
|
||||
}
|
||||
|
||||
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 ////////////////////////////////////////////////////////////////////////
|
||||
DoubleFunction DoubleFunction::bind(const Index argIndex,
|
||||
const double val) const
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
double operator()(void) const;
|
||||
template <typename... Ts>
|
||||
double operator()(const double arg0, const Ts... args) const;
|
||||
std::map<double, double> operator()(const std::map<double, double> &m) const;
|
||||
// bind
|
||||
DoubleFunction bind(const Index argIndex, const double val) const;
|
||||
DoubleFunction bind(const Index argIndex, const DVec &x) const;
|
||||
|
Loading…
Reference in New Issue
Block a user