mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-10 19:20:44 +01:00
DoubleFunctionSample: more call operators
This commit is contained in:
parent
62d395e8e2
commit
dfe6240c14
@ -105,12 +105,35 @@ double DoubleFunction::operator()(void) const
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
DSample DoubleFunctionSample::operator()(const DMatSample &arg) const
|
DSample DoubleFunctionSample::operator()(const DMatSample &arg) const
|
||||||
{
|
{
|
||||||
DSample result(arg.size());
|
DSample result(size());
|
||||||
|
|
||||||
FOR_STAT_ARRAY(arg, s)
|
FOR_STAT_ARRAY((*this), s)
|
||||||
{
|
{
|
||||||
result[s] = (*this)[s](arg[s]);
|
result[s] = (*this)[s](arg[s]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DSample DoubleFunctionSample::operator()(const double *arg) const
|
||||||
|
{
|
||||||
|
DSample result(size());
|
||||||
|
|
||||||
|
FOR_STAT_ARRAY((*this), s)
|
||||||
|
{
|
||||||
|
result[s] = (*this)[s](arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
DSample DoubleFunctionSample::operator()(const DVec &arg) const
|
||||||
|
{
|
||||||
|
return (*this)(arg.data());
|
||||||
|
}
|
||||||
|
|
||||||
|
DSample DoubleFunctionSample::operator()(const vector<double> &arg) const
|
||||||
|
{
|
||||||
|
return (*this)(arg.data());
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -86,8 +86,21 @@ public:
|
|||||||
virtual ~DoubleFunctionSample(void) = default;
|
virtual ~DoubleFunctionSample(void) = default;
|
||||||
// function call
|
// function call
|
||||||
DSample operator()(const DMatSample &arg) const;
|
DSample operator()(const DMatSample &arg) const;
|
||||||
|
DSample operator()(const double *arg) const;
|
||||||
|
DSample operator()(const DVec &arg) const;
|
||||||
|
DSample operator()(const std::vector<double> &arg) const;
|
||||||
|
template <typename... Ts>
|
||||||
|
DSample operator()(const double arg0, const Ts... args) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename... Ts>
|
||||||
|
DSample DoubleFunctionSample::operator()(const double arg0,
|
||||||
|
const Ts... args) const
|
||||||
|
{
|
||||||
|
const double arg[] = {arg0, args...};
|
||||||
|
|
||||||
|
return (*this)(arg);
|
||||||
|
}
|
||||||
|
|
||||||
END_NAMESPACE
|
END_NAMESPACE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user