mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
C++ NAMESPACE format emacs happy
This commit is contained in:
parent
6d7bdfb5f5
commit
c0a9b38c02
@ -36,294 +36,294 @@
|
|||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
namespace Grid {
|
NAMESPACE_BEGIN(Grid);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
// Precision mapping
|
// Precision mapping
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
template<class vobj> static std::string getFormatString (void)
|
template<class vobj> static std::string getFormatString (void)
|
||||||
{
|
{
|
||||||
std::string format;
|
std::string format;
|
||||||
typedef typename getPrecision<vobj>::real_scalar_type stype;
|
typedef typename getPrecision<vobj>::real_scalar_type stype;
|
||||||
if ( sizeof(stype) == sizeof(float) ) {
|
if ( sizeof(stype) == sizeof(float) ) {
|
||||||
format = std::string("IEEE32BIG");
|
format = std::string("IEEE32BIG");
|
||||||
}
|
|
||||||
if ( sizeof(stype) == sizeof(double) ) {
|
|
||||||
format = std::string("IEEE64BIG");
|
|
||||||
}
|
|
||||||
return format;
|
|
||||||
}
|
}
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
if ( sizeof(stype) == sizeof(double) ) {
|
||||||
// header specification/interpretation
|
format = std::string("IEEE64BIG");
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
}
|
||||||
class FieldMetaData : Serializable {
|
return format;
|
||||||
public:
|
}
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// header specification/interpretation
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
class FieldMetaData : Serializable {
|
||||||
|
public:
|
||||||
|
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(FieldMetaData,
|
GRID_SERIALIZABLE_CLASS_MEMBERS(FieldMetaData,
|
||||||
int, nd,
|
int, nd,
|
||||||
std::vector<int>, dimension,
|
std::vector<int>, dimension,
|
||||||
std::vector<std::string>, boundary,
|
std::vector<std::string>, boundary,
|
||||||
int, data_start,
|
int, data_start,
|
||||||
std::string, hdr_version,
|
std::string, hdr_version,
|
||||||
std::string, storage_format,
|
std::string, storage_format,
|
||||||
double, link_trace,
|
double, link_trace,
|
||||||
double, plaquette,
|
double, plaquette,
|
||||||
uint32_t, checksum,
|
uint32_t, checksum,
|
||||||
uint32_t, scidac_checksuma,
|
uint32_t, scidac_checksuma,
|
||||||
uint32_t, scidac_checksumb,
|
uint32_t, scidac_checksumb,
|
||||||
unsigned int, sequence_number,
|
unsigned int, sequence_number,
|
||||||
std::string, data_type,
|
std::string, data_type,
|
||||||
std::string, ensemble_id,
|
std::string, ensemble_id,
|
||||||
std::string, ensemble_label,
|
std::string, ensemble_label,
|
||||||
std::string, ildg_lfn,
|
std::string, ildg_lfn,
|
||||||
std::string, creator,
|
std::string, creator,
|
||||||
std::string, creator_hardware,
|
std::string, creator_hardware,
|
||||||
std::string, creation_date,
|
std::string, creation_date,
|
||||||
std::string, archive_date,
|
std::string, archive_date,
|
||||||
std::string, floating_point);
|
std::string, floating_point);
|
||||||
FieldMetaData(void) {
|
FieldMetaData(void) {
|
||||||
nd=4;
|
nd=4;
|
||||||
dimension.resize(4);
|
dimension.resize(4);
|
||||||
boundary.resize(4);
|
boundary.resize(4);
|
||||||
scidac_checksuma=0;
|
scidac_checksuma=0;
|
||||||
scidac_checksumb=0;
|
scidac_checksumb=0;
|
||||||
checksum=0;
|
checksum=0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace QCD {
|
namespace QCD {
|
||||||
|
|
||||||
using namespace Grid;
|
using namespace Grid;
|
||||||
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Bit and Physical Checksumming and QA of data
|
// Bit and Physical Checksumming and QA of data
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
inline void GridMetaData(GridBase *grid,FieldMetaData &header)
|
inline void GridMetaData(GridBase *grid,FieldMetaData &header)
|
||||||
{
|
{
|
||||||
int nd = grid->_ndimension;
|
int nd = grid->_ndimension;
|
||||||
header.nd = nd;
|
header.nd = nd;
|
||||||
header.dimension.resize(nd);
|
header.dimension.resize(nd);
|
||||||
header.boundary.resize(nd);
|
header.boundary.resize(nd);
|
||||||
header.data_start = 0;
|
header.data_start = 0;
|
||||||
for(int d=0;d<nd;d++) {
|
for(int d=0;d<nd;d++) {
|
||||||
header.dimension[d] = grid->_fdimensions[d];
|
header.dimension[d] = grid->_fdimensions[d];
|
||||||
}
|
|
||||||
for(int d=0;d<nd;d++) {
|
|
||||||
header.boundary[d] = std::string("PERIODIC");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
for(int d=0;d<nd;d++) {
|
||||||
inline void MachineCharacteristics(FieldMetaData &header)
|
header.boundary[d] = std::string("PERIODIC");
|
||||||
{
|
|
||||||
// Who
|
|
||||||
struct passwd *pw = getpwuid (getuid());
|
|
||||||
if (pw) header.creator = std::string(pw->pw_name);
|
|
||||||
|
|
||||||
// When
|
|
||||||
std::time_t t = std::time(nullptr);
|
|
||||||
std::tm tm_ = *std::localtime(&t);
|
|
||||||
std::ostringstream oss;
|
|
||||||
// oss << std::put_time(&tm_, "%c %Z");
|
|
||||||
header.creation_date = oss.str();
|
|
||||||
header.archive_date = header.creation_date;
|
|
||||||
|
|
||||||
// What
|
|
||||||
struct utsname name; uname(&name);
|
|
||||||
header.creator_hardware = std::string(name.nodename)+"-";
|
|
||||||
header.creator_hardware+= std::string(name.machine)+"-";
|
|
||||||
header.creator_hardware+= std::string(name.sysname)+"-";
|
|
||||||
header.creator_hardware+= std::string(name.release);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MachineCharacteristics(FieldMetaData &header)
|
||||||
|
{
|
||||||
|
// Who
|
||||||
|
struct passwd *pw = getpwuid (getuid());
|
||||||
|
if (pw) header.creator = std::string(pw->pw_name);
|
||||||
|
|
||||||
|
// When
|
||||||
|
std::time_t t = std::time(nullptr);
|
||||||
|
std::tm tm_ = *std::localtime(&t);
|
||||||
|
std::ostringstream oss;
|
||||||
|
// oss << std::put_time(&tm_, "%c %Z");
|
||||||
|
header.creation_date = oss.str();
|
||||||
|
header.archive_date = header.creation_date;
|
||||||
|
|
||||||
|
// What
|
||||||
|
struct utsname name; uname(&name);
|
||||||
|
header.creator_hardware = std::string(name.nodename)+"-";
|
||||||
|
header.creator_hardware+= std::string(name.machine)+"-";
|
||||||
|
header.creator_hardware+= std::string(name.sysname)+"-";
|
||||||
|
header.creator_hardware+= std::string(name.release);
|
||||||
|
}
|
||||||
|
|
||||||
#define dump_meta_data(field, s) \
|
#define dump_meta_data(field, s) \
|
||||||
s << "BEGIN_HEADER" << std::endl; \
|
s << "BEGIN_HEADER" << std::endl; \
|
||||||
s << "HDR_VERSION = " << field.hdr_version << std::endl; \
|
s << "HDR_VERSION = " << field.hdr_version << std::endl; \
|
||||||
s << "DATATYPE = " << field.data_type << std::endl; \
|
s << "DATATYPE = " << field.data_type << std::endl; \
|
||||||
s << "STORAGE_FORMAT = " << field.storage_format << std::endl; \
|
s << "STORAGE_FORMAT = " << field.storage_format << std::endl; \
|
||||||
for(int i=0;i<4;i++){ \
|
for(int i=0;i<4;i++){ \
|
||||||
s << "DIMENSION_" << i+1 << " = " << field.dimension[i] << std::endl ; \
|
s << "DIMENSION_" << i+1 << " = " << field.dimension[i] << std::endl ; \
|
||||||
} \
|
} \
|
||||||
s << "LINK_TRACE = " << std::setprecision(10) << field.link_trace << std::endl; \
|
s << "LINK_TRACE = " << std::setprecision(10) << field.link_trace << std::endl; \
|
||||||
s << "PLAQUETTE = " << std::setprecision(10) << field.plaquette << std::endl; \
|
s << "PLAQUETTE = " << std::setprecision(10) << field.plaquette << std::endl; \
|
||||||
for(int i=0;i<4;i++){ \
|
for(int i=0;i<4;i++){ \
|
||||||
s << "BOUNDARY_"<<i+1<<" = " << field.boundary[i] << std::endl; \
|
s << "BOUNDARY_"<<i+1<<" = " << field.boundary[i] << std::endl; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
s << "CHECKSUM = "<< std::hex << std::setw(10) << field.checksum << std::dec<<std::endl; \
|
s << "CHECKSUM = "<< std::hex << std::setw(10) << field.checksum << std::dec<<std::endl; \
|
||||||
s << "SCIDAC_CHECKSUMA = "<< std::hex << std::setw(10) << field.scidac_checksuma << std::dec<<std::endl; \
|
s << "SCIDAC_CHECKSUMA = "<< std::hex << std::setw(10) << field.scidac_checksuma << std::dec<<std::endl; \
|
||||||
s << "SCIDAC_CHECKSUMB = "<< std::hex << std::setw(10) << field.scidac_checksumb << std::dec<<std::endl; \
|
s << "SCIDAC_CHECKSUMB = "<< std::hex << std::setw(10) << field.scidac_checksumb << std::dec<<std::endl; \
|
||||||
s << "ENSEMBLE_ID = " << field.ensemble_id << std::endl; \
|
s << "ENSEMBLE_ID = " << field.ensemble_id << std::endl; \
|
||||||
s << "ENSEMBLE_LABEL = " << field.ensemble_label << std::endl; \
|
s << "ENSEMBLE_LABEL = " << field.ensemble_label << std::endl; \
|
||||||
s << "SEQUENCE_NUMBER = " << field.sequence_number << std::endl; \
|
s << "SEQUENCE_NUMBER = " << field.sequence_number << std::endl; \
|
||||||
s << "CREATOR = " << field.creator << std::endl; \
|
s << "CREATOR = " << field.creator << std::endl; \
|
||||||
s << "CREATOR_HARDWARE = "<< field.creator_hardware << std::endl; \
|
s << "CREATOR_HARDWARE = "<< field.creator_hardware << std::endl; \
|
||||||
s << "CREATION_DATE = " << field.creation_date << std::endl; \
|
s << "CREATION_DATE = " << field.creation_date << std::endl; \
|
||||||
s << "ARCHIVE_DATE = " << field.archive_date << std::endl; \
|
s << "ARCHIVE_DATE = " << field.archive_date << std::endl; \
|
||||||
s << "FLOATING_POINT = " << field.floating_point << std::endl; \
|
s << "FLOATING_POINT = " << field.floating_point << std::endl; \
|
||||||
s << "END_HEADER" << std::endl;
|
s << "END_HEADER" << std::endl;
|
||||||
|
|
||||||
template<class vobj> inline void PrepareMetaData(Lattice<vobj> & field, FieldMetaData &header)
|
template<class vobj> inline void PrepareMetaData(Lattice<vobj> & field, FieldMetaData &header)
|
||||||
{
|
{
|
||||||
GridBase *grid = field._grid;
|
GridBase *grid = field._grid;
|
||||||
std::string format = getFormatString<vobj>();
|
std::string format = getFormatString<vobj>();
|
||||||
header.floating_point = format;
|
header.floating_point = format;
|
||||||
header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
|
header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
|
||||||
GridMetaData(grid,header);
|
GridMetaData(grid,header);
|
||||||
MachineCharacteristics(header);
|
MachineCharacteristics(header);
|
||||||
}
|
}
|
||||||
inline void GaugeStatistics(Lattice<vLorentzColourMatrixF> & data,FieldMetaData &header)
|
inline void GaugeStatistics(Lattice<vLorentzColourMatrixF> & data,FieldMetaData &header)
|
||||||
{
|
{
|
||||||
// How to convert data precision etc...
|
// How to convert data precision etc...
|
||||||
header.link_trace=Grid::QCD::WilsonLoops<PeriodicGimplF>::linkTrace(data);
|
header.link_trace=Grid::QCD::WilsonLoops<PeriodicGimplF>::linkTrace(data);
|
||||||
header.plaquette =Grid::QCD::WilsonLoops<PeriodicGimplF>::avgPlaquette(data);
|
header.plaquette =Grid::QCD::WilsonLoops<PeriodicGimplF>::avgPlaquette(data);
|
||||||
}
|
}
|
||||||
inline void GaugeStatistics(Lattice<vLorentzColourMatrixD> & data,FieldMetaData &header)
|
inline void GaugeStatistics(Lattice<vLorentzColourMatrixD> & data,FieldMetaData &header)
|
||||||
{
|
{
|
||||||
// How to convert data precision etc...
|
// How to convert data precision etc...
|
||||||
header.link_trace=Grid::QCD::WilsonLoops<PeriodicGimplD>::linkTrace(data);
|
header.link_trace=Grid::QCD::WilsonLoops<PeriodicGimplD>::linkTrace(data);
|
||||||
header.plaquette =Grid::QCD::WilsonLoops<PeriodicGimplD>::avgPlaquette(data);
|
header.plaquette =Grid::QCD::WilsonLoops<PeriodicGimplD>::avgPlaquette(data);
|
||||||
}
|
}
|
||||||
template<> inline void PrepareMetaData<vLorentzColourMatrixF>(Lattice<vLorentzColourMatrixF> & field, FieldMetaData &header)
|
template<> inline void PrepareMetaData<vLorentzColourMatrixF>(Lattice<vLorentzColourMatrixF> & field, FieldMetaData &header)
|
||||||
{
|
{
|
||||||
|
|
||||||
GridBase *grid = field._grid;
|
GridBase *grid = field._grid;
|
||||||
std::string format = getFormatString<vLorentzColourMatrixF>();
|
std::string format = getFormatString<vLorentzColourMatrixF>();
|
||||||
header.floating_point = format;
|
header.floating_point = format;
|
||||||
header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
|
header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
|
||||||
GridMetaData(grid,header);
|
GridMetaData(grid,header);
|
||||||
GaugeStatistics(field,header);
|
GaugeStatistics(field,header);
|
||||||
MachineCharacteristics(header);
|
MachineCharacteristics(header);
|
||||||
}
|
}
|
||||||
template<> inline void PrepareMetaData<vLorentzColourMatrixD>(Lattice<vLorentzColourMatrixD> & field, FieldMetaData &header)
|
template<> inline void PrepareMetaData<vLorentzColourMatrixD>(Lattice<vLorentzColourMatrixD> & field, FieldMetaData &header)
|
||||||
{
|
{
|
||||||
GridBase *grid = field._grid;
|
GridBase *grid = field._grid;
|
||||||
std::string format = getFormatString<vLorentzColourMatrixD>();
|
std::string format = getFormatString<vLorentzColourMatrixD>();
|
||||||
header.floating_point = format;
|
header.floating_point = format;
|
||||||
header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
|
header.checksum = 0x0; // Nersc checksum unused in ILDG, Scidac
|
||||||
GridMetaData(grid,header);
|
GridMetaData(grid,header);
|
||||||
GaugeStatistics(field,header);
|
GaugeStatistics(field,header);
|
||||||
MachineCharacteristics(header);
|
MachineCharacteristics(header);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Utilities ; these are QCD aware
|
// Utilities ; these are QCD aware
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
inline void reconstruct3(LorentzColourMatrix & cm)
|
inline void reconstruct3(LorentzColourMatrix & cm)
|
||||||
{
|
{
|
||||||
const int x=0;
|
const int x=0;
|
||||||
const int y=1;
|
const int y=1;
|
||||||
const int z=2;
|
const int z=2;
|
||||||
for(int mu=0;mu<Nd;mu++){
|
for(int mu=0;mu<Nd;mu++){
|
||||||
cm(mu)()(2,x) = adj(cm(mu)()(0,y)*cm(mu)()(1,z)-cm(mu)()(0,z)*cm(mu)()(1,y)); //x= yz-zy
|
cm(mu)()(2,x) = adj(cm(mu)()(0,y)*cm(mu)()(1,z)-cm(mu)()(0,z)*cm(mu)()(1,y)); //x= yz-zy
|
||||||
cm(mu)()(2,y) = adj(cm(mu)()(0,z)*cm(mu)()(1,x)-cm(mu)()(0,x)*cm(mu)()(1,z)); //y= zx-xz
|
cm(mu)()(2,y) = adj(cm(mu)()(0,z)*cm(mu)()(1,x)-cm(mu)()(0,x)*cm(mu)()(1,z)); //y= zx-xz
|
||||||
cm(mu)()(2,z) = adj(cm(mu)()(0,x)*cm(mu)()(1,y)-cm(mu)()(0,y)*cm(mu)()(1,x)); //z= xy-yx
|
cm(mu)()(2,z) = adj(cm(mu)()(0,x)*cm(mu)()(1,y)-cm(mu)()(0,y)*cm(mu)()(1,x)); //z= xy-yx
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Some data types for intermediate storage
|
// Some data types for intermediate storage
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
template<typename vtype> using iLorentzColour2x3 = iVector<iVector<iVector<vtype, Nc>, 2>, Nd >;
|
template<typename vtype> using iLorentzColour2x3 = iVector<iVector<iVector<vtype, Nc>, 2>, Nd >;
|
||||||
|
|
||||||
typedef iLorentzColour2x3<Complex> LorentzColour2x3;
|
typedef iLorentzColour2x3<Complex> LorentzColour2x3;
|
||||||
typedef iLorentzColour2x3<ComplexF> LorentzColour2x3F;
|
typedef iLorentzColour2x3<ComplexF> LorentzColour2x3F;
|
||||||
typedef iLorentzColour2x3<ComplexD> LorentzColour2x3D;
|
typedef iLorentzColour2x3<ComplexD> LorentzColour2x3D;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
// Simple classes for precision conversion
|
// Simple classes for precision conversion
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
||||||
template <class fobj, class sobj>
|
template <class fobj, class sobj>
|
||||||
struct BinarySimpleUnmunger {
|
struct BinarySimpleUnmunger {
|
||||||
typedef typename getPrecision<fobj>::real_scalar_type fobj_stype;
|
typedef typename getPrecision<fobj>::real_scalar_type fobj_stype;
|
||||||
typedef typename getPrecision<sobj>::real_scalar_type sobj_stype;
|
typedef typename getPrecision<sobj>::real_scalar_type sobj_stype;
|
||||||
|
|
||||||
void operator()(sobj &in, fobj &out) {
|
void operator()(sobj &in, fobj &out) {
|
||||||
// take word by word and transform accoding to the status
|
// take word by word and transform accoding to the status
|
||||||
fobj_stype *out_buffer = (fobj_stype *)&out;
|
fobj_stype *out_buffer = (fobj_stype *)&out;
|
||||||
sobj_stype *in_buffer = (sobj_stype *)∈
|
sobj_stype *in_buffer = (sobj_stype *)∈
|
||||||
size_t fobj_words = sizeof(out) / sizeof(fobj_stype);
|
size_t fobj_words = sizeof(out) / sizeof(fobj_stype);
|
||||||
size_t sobj_words = sizeof(in) / sizeof(sobj_stype);
|
size_t sobj_words = sizeof(in) / sizeof(sobj_stype);
|
||||||
assert(fobj_words == sobj_words);
|
assert(fobj_words == sobj_words);
|
||||||
|
|
||||||
for (unsigned int word = 0; word < sobj_words; word++)
|
for (unsigned int word = 0; word < sobj_words; word++)
|
||||||
out_buffer[word] = in_buffer[word]; // type conversion on the fly
|
out_buffer[word] = in_buffer[word]; // type conversion on the fly
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class fobj, class sobj>
|
template <class fobj, class sobj>
|
||||||
struct BinarySimpleMunger {
|
struct BinarySimpleMunger {
|
||||||
typedef typename getPrecision<fobj>::real_scalar_type fobj_stype;
|
typedef typename getPrecision<fobj>::real_scalar_type fobj_stype;
|
||||||
typedef typename getPrecision<sobj>::real_scalar_type sobj_stype;
|
typedef typename getPrecision<sobj>::real_scalar_type sobj_stype;
|
||||||
|
|
||||||
void operator()(fobj &in, sobj &out) {
|
void operator()(fobj &in, sobj &out) {
|
||||||
// take word by word and transform accoding to the status
|
// take word by word and transform accoding to the status
|
||||||
fobj_stype *in_buffer = (fobj_stype *)∈
|
fobj_stype *in_buffer = (fobj_stype *)∈
|
||||||
sobj_stype *out_buffer = (sobj_stype *)&out;
|
sobj_stype *out_buffer = (sobj_stype *)&out;
|
||||||
size_t fobj_words = sizeof(in) / sizeof(fobj_stype);
|
size_t fobj_words = sizeof(in) / sizeof(fobj_stype);
|
||||||
size_t sobj_words = sizeof(out) / sizeof(sobj_stype);
|
size_t sobj_words = sizeof(out) / sizeof(sobj_stype);
|
||||||
assert(fobj_words == sobj_words);
|
assert(fobj_words == sobj_words);
|
||||||
|
|
||||||
for (unsigned int word = 0; word < sobj_words; word++)
|
for (unsigned int word = 0; word < sobj_words; word++)
|
||||||
out_buffer[word] = in_buffer[word]; // type conversion on the fly
|
out_buffer[word] = in_buffer[word]; // type conversion on the fly
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template<class fobj,class sobj>
|
template<class fobj,class sobj>
|
||||||
struct GaugeSimpleMunger{
|
struct GaugeSimpleMunger{
|
||||||
void operator()(fobj &in, sobj &out) {
|
void operator()(fobj &in, sobj &out) {
|
||||||
for (int mu = 0; mu < Nd; mu++) {
|
for (int mu = 0; mu < Nd; mu++) {
|
||||||
for (int i = 0; i < Nc; i++) {
|
for (int i = 0; i < Nc; i++) {
|
||||||
for (int j = 0; j < Nc; j++) {
|
for (int j = 0; j < Nc; j++) {
|
||||||
out(mu)()(i, j) = in(mu)()(i, j);
|
out(mu)()(i, j) = in(mu)()(i, j);
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
template <class fobj, class sobj>
|
template <class fobj, class sobj>
|
||||||
struct GaugeSimpleUnmunger {
|
struct GaugeSimpleUnmunger {
|
||||||
|
|
||||||
void operator()(sobj &in, fobj &out) {
|
void operator()(sobj &in, fobj &out) {
|
||||||
for (int mu = 0; mu < Nd; mu++) {
|
for (int mu = 0; mu < Nd; mu++) {
|
||||||
for (int i = 0; i < Nc; i++) {
|
for (int i = 0; i < Nc; i++) {
|
||||||
for (int j = 0; j < Nc; j++) {
|
for (int j = 0; j < Nc; j++) {
|
||||||
out(mu)()(i, j) = in(mu)()(i, j);
|
out(mu)()(i, j) = in(mu)()(i, j);
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
template<class fobj,class sobj>
|
template<class fobj,class sobj>
|
||||||
struct Gauge3x2munger{
|
struct Gauge3x2munger{
|
||||||
void operator() (fobj &in,sobj &out){
|
void operator() (fobj &in,sobj &out){
|
||||||
for(int mu=0;mu<Nd;mu++){
|
for(int mu=0;mu<Nd;mu++){
|
||||||
for(int i=0;i<2;i++){
|
for(int i=0;i<2;i++){
|
||||||
for(int j=0;j<3;j++){
|
for(int j=0;j<3;j++){
|
||||||
out(mu)()(i,j) = in(mu)(i)(j);
|
out(mu)()(i,j) = in(mu)(i)(j);
|
||||||
}}
|
}}
|
||||||
}
|
|
||||||
reconstruct3(out);
|
|
||||||
}
|
}
|
||||||
};
|
reconstruct3(out);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<class fobj,class sobj>
|
template<class fobj,class sobj>
|
||||||
struct Gauge3x2unmunger{
|
struct Gauge3x2unmunger{
|
||||||
void operator() (sobj &in,fobj &out){
|
void operator() (sobj &in,fobj &out){
|
||||||
for(int mu=0;mu<Nd;mu++){
|
for(int mu=0;mu<Nd;mu++){
|
||||||
for(int i=0;i<2;i++){
|
for(int i=0;i<2;i++){
|
||||||
for(int j=0;j<3;j++){
|
for(int j=0;j<3;j++){
|
||||||
out(mu)(i)(j) = in(mu)()(i,j);
|
out(mu)(i)(j) = in(mu)()(i,j);
|
||||||
}}
|
}}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NAMESPACE_END(Grid);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user