mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
Improved force terms
This commit is contained in:
parent
bb89a82a07
commit
e947992957
@ -34,6 +34,16 @@ NAMESPACE_BEGIN(Grid);
|
||||
// outerProduct Scalar x Scalar -> Scalar
|
||||
// Vector x Vector -> Matrix
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
template<class CC,IfComplex<CC> = 0>
|
||||
accelerator_inline CC outerProduct(const CC &l, const CC& r)
|
||||
{
|
||||
return l*conj(r);
|
||||
}
|
||||
template<class RR,IfReal<RR> = 0>
|
||||
accelerator_inline RR outerProduct(const RR &l, const RR& r)
|
||||
{
|
||||
return l*r;
|
||||
}
|
||||
|
||||
template<class l,class r,int N> accelerator_inline
|
||||
auto outerProduct (const iVector<l,N>& lhs,const iVector<r,N>& rhs) -> iMatrix<decltype(outerProduct(lhs._internal[0],rhs._internal[0])),N>
|
||||
@ -57,17 +67,6 @@ auto outerProduct (const iScalar<l>& lhs,const iScalar<r>& rhs) -> iScalar<declt
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class CC,IfComplex<CC> = 0>
|
||||
accelerator_inline CC outerProduct(const CC &l, const CC& r)
|
||||
{
|
||||
return l*conj(r);
|
||||
}
|
||||
template<class RR,IfReal<RR> = 0>
|
||||
accelerator_inline RR outerProduct(const RR &l, const RR& r)
|
||||
{
|
||||
return l*r;
|
||||
}
|
||||
|
||||
NAMESPACE_END(Grid);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user