1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-09-20 09:15:38 +01:00

Fixing build errors

This commit is contained in:
Michael Marshall 2019-02-28 20:30:16 +00:00
parent 4b9200b35c
commit a344a2227e
2 changed files with 12 additions and 13 deletions

View File

@ -134,8 +134,10 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
int twoBlock = mat.dimension(3);
int threeBlock = mat.dimension(4);
GridBase *grid = wi[0]._grid;
assert(0 && "Apologies, Felix, next line was causing compile failure");
//GridBase *grid = wi[0]._grid;
GridBase *grid = nullptr;
const int nd = grid->_ndimension;
const int Nsimd = grid->Nsimd();
@ -200,7 +202,9 @@ void A2Autils<FImpl>::NucleonFieldMom(Eigen::Tensor<ComplexD,6> &mat,
// After getting the sitewise product do the mom phase loop
int base = Nmom*i+Nmom*Lblock*j+Nmom*Lblock*Rblock*r;
assert(0 && "Apologies, Felix, next line was causing compile failure");
//int base = Nmom*i+Nmom*Lblock*j+Nmom*Lblock*Rblock*r;
int base = 0;
for ( int m=0;m<Nmom;m++){
int idx = m+base;
auto phase = mom[m]._odata[ss];

View File

@ -841,15 +841,10 @@ namespace Grid {
// First check whether dimensions match (Eigen tensor library will assert if they don't match)
bool bReturnValue = (T1::NumIndices == T2::NumIndices);
for( auto i = 0 ; bReturnValue && i < T1::NumIndices ; i++ )
bReturnValue = ( lhs.dimension(i)) == rhs.dimension(i);
bReturnValue = ( lhs.dimension(i) == rhs.dimension(i) );
if( bReturnValue ) {
using Traits = EigenIO::Traits<typename T1::Scalar>;
using scalar_type = typename Traits::scalar_type;
for_all( lhs, [&](scalar_type &c, typename T1::Index n, const std::array<size_t, T1::NumIndices + Traits::rank> &Dims ) {
scalar_type x = c - rhs[Dims];
if( x < 1e-10 )
bReturnValue = false;
} );
Eigen::Tensor<bool, 0, T1::Options> bResult = (lhs == rhs).all();
bReturnValue = bResult(0);
}
return bReturnValue;
}
@ -865,13 +860,13 @@ namespace Grid {
}
template <typename T>
static inline typename std::enable_if<!std::is_base_of<Eigen::TensorBase<T, Eigen::ReadOnlyAccessors>, T>::value, void>::type
static inline typename std::enable_if<!EigenIO::is_tensor<T>::value, void>::type
WriteMember(std::ostream &os, const T &object) {
os << object;
}
template <typename T>
static inline typename std::enable_if<std::is_base_of<Eigen::TensorBase<T, Eigen::ReadOnlyAccessors>, T>::value, void>::type
static inline typename std::enable_if<EigenIO::is_tensor<T>::value, void>::type
WriteMember(std::ostream &os, const T &object) {
os << "Eigen::Tensor";
}