mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 19:25:56 +01:00
LinearFunction loops over vectors by default, can be overloaded
This commit is contained in:
parent
67e08aa952
commit
73a95fa96f
@ -530,6 +530,16 @@ public:
|
|||||||
template<class Field> class LinearFunction {
|
template<class Field> class LinearFunction {
|
||||||
public:
|
public:
|
||||||
virtual void operator() (const Field &in, Field &out) = 0;
|
virtual void operator() (const Field &in, Field &out) = 0;
|
||||||
|
|
||||||
|
virtual void operator() (const std::vector<Field> &in, std::vector<Field> &out)
|
||||||
|
{
|
||||||
|
assert(in.size() == out.size());
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < in.size(); ++i)
|
||||||
|
{
|
||||||
|
(*this)(in[i], out[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class Field> class IdentityLinearFunction : public LinearFunction<Field> {
|
template<class Field> class IdentityLinearFunction : public LinearFunction<Field> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user