mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00: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 {
|
||||
public:
|
||||
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> {
|
||||
|
Loading…
Reference in New Issue
Block a user