1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-27 14:15:55 +01:00

Close expressions passed as an argument

This commit is contained in:
Peter Boyle 2020-09-01 15:30:33 -04:00
parent 1654c4f3c0
commit eac1f08b7b

View File

@ -53,23 +53,21 @@ namespace PeriodicBC {
return Cshift(tmp,mu,-1);// moves towards positive mu return Cshift(tmp,mu,-1);// moves towards positive mu
} }
template<class gauge,typename Op, typename T1> auto template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,void>::type * = nullptr>
CovShiftForward(const Lattice<gauge> &Link, auto CovShiftForward(const Lattice<gauge> &Link,
int mu, int mu,
const LatticeUnaryExpression<Op,T1> &expr) const Expr &expr) -> decltype(closure(expr))
-> Lattice<decltype(expr.op.func(eval(0, expr.arg1)))>
{ {
Lattice<decltype(expr.op.func(eval(0, expr.arg1)))> arg(expr); auto arg = closure(expr);
return CovShiftForward(Link,mu,arg); return CovShiftForward(Link,mu,arg);
} }
template<class gauge,typename Op, typename T1> auto template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,void>::type * = nullptr>
CovShiftBackward(const Lattice<gauge> &Link, auto CovShiftBackward(const Lattice<gauge> &Link,
int mu, int mu,
const LatticeUnaryExpression<Op,T1> &expr) const Expr &expr) -> decltype(closure(expr))
-> Lattice<decltype(expr.op.func(eval(0, expr.arg1)))>
{ {
Lattice<decltype(expr.op.func(eval(0, expr.arg1)))> arg(expr); auto arg = closure(expr);
return CovShiftForward(Link,mu,arg); return CovShiftBackward(Link,mu,arg);
} }
} }
@ -142,26 +140,23 @@ namespace ConjugateBC {
return Cshift(tmp,mu,-1);// moves towards positive mu return Cshift(tmp,mu,-1);// moves towards positive mu
} }
template<class gauge,typename Op, typename T1> auto template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,void>::type * = nullptr>
CovShiftForward(const Lattice<gauge> &Link, auto CovShiftForward(const Lattice<gauge> &Link,
int mu, int mu,
const LatticeUnaryExpression<Op,T1> &expr) const Expr &expr) -> decltype(closure(expr))
-> Lattice<decltype(expr.op.func(eval(0, expr.arg1)))>
{ {
Lattice<decltype(expr.op.func(eval(0, expr.arg1)))> arg(expr); auto arg = closure(expr);
return CovShiftForward(Link,mu,arg); return CovShiftForward(Link,mu,arg);
} }
template<class gauge,typename Op, typename T1> auto template<class gauge,class Expr,typename std::enable_if<is_lattice_expr<Expr>::value,void>::type * = nullptr>
CovShiftBackward(const Lattice<gauge> &Link, auto CovShiftBackward(const Lattice<gauge> &Link,
int mu, int mu,
const LatticeUnaryExpression<Op,T1> &expr) const Expr &expr) -> decltype(closure(expr))
-> Lattice<decltype(expr.op.func(eval(0, expr.arg1)))>
{ {
Lattice<decltype(expr.op.func(eval(0, expr.arg1)))> arg(expr); auto arg = closure(expr);
return CovShiftForward(Link,mu,arg); return CovShiftBackward(Link,mu,arg);
} }
} }