mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Close expressions in arg to cshift
This commit is contained in:
parent
82f71643a4
commit
cb7ee37562
@ -49,4 +49,29 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
|||||||
#ifdef GRID_COMMS_SHMEM
|
#ifdef GRID_COMMS_SHMEM
|
||||||
#include <Grid/cshift/Cshift_mpi.h> // uses same implementation of communicator
|
#include <Grid/cshift/Cshift_mpi.h> // uses same implementation of communicator
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
NAMESPACE_BEGIN(Grid);
|
||||||
|
|
||||||
|
template<typename Op, typename T1>
|
||||||
|
auto Cshift(const LatticeUnaryExpression<Op,T1> &expr,int dim,int shift)
|
||||||
|
-> Lattice<decltype(expr.op.func(eval(0, expr.arg1)))>
|
||||||
|
{
|
||||||
|
return Cshift(closure(expr),dim,shift);
|
||||||
|
}
|
||||||
|
template <class Op, class T1, class T2>
|
||||||
|
auto Cshift(const LatticeBinaryExpression<Op,T1,T2> &expr,int dim,int shift)
|
||||||
|
-> Lattice<decltype(expr.op.func(eval(0, expr.arg1),eval(0, expr.arg2)))>
|
||||||
|
{
|
||||||
|
return Cshift(closure(expr),dim,shift);
|
||||||
|
}
|
||||||
|
template <class Op, class T1, class T2, class T3>
|
||||||
|
auto Cshift(const LatticeTrinaryExpression<Op,T1,T2,T3> &expr,int dim,int shift)
|
||||||
|
-> Lattice<decltype(expr.op.func(eval(0, expr.arg1),
|
||||||
|
eval(0, expr.arg2),
|
||||||
|
eval(0, expr.arg3)))>
|
||||||
|
{
|
||||||
|
return Cshift(closure(expr),dim,shift);
|
||||||
|
}
|
||||||
|
NAMESPACE_END(Grid);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user