1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00: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 twoBlock = mat.dimension(3);
int threeBlock = mat.dimension(4); 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 nd = grid->_ndimension;
const int Nsimd = grid->Nsimd(); 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 // 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++){ for ( int m=0;m<Nmom;m++){
int idx = m+base; int idx = m+base;
auto phase = mom[m]._odata[ss]; 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) // First check whether dimensions match (Eigen tensor library will assert if they don't match)
bool bReturnValue = (T1::NumIndices == T2::NumIndices); bool bReturnValue = (T1::NumIndices == T2::NumIndices);
for( auto i = 0 ; bReturnValue && i < T1::NumIndices ; i++ ) 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 ) { if( bReturnValue ) {
using Traits = EigenIO::Traits<typename T1::Scalar>; Eigen::Tensor<bool, 0, T1::Options> bResult = (lhs == rhs).all();
using scalar_type = typename Traits::scalar_type; bReturnValue = bResult(0);
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;
} );
} }
return bReturnValue; return bReturnValue;
} }
@ -865,13 +860,13 @@ namespace Grid {
} }
template <typename T> 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) { WriteMember(std::ostream &os, const T &object) {
os << object; os << object;
} }
template <typename T> 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) { WriteMember(std::ostream &os, const T &object) {
os << "Eigen::Tensor"; os << "Eigen::Tensor";
} }