1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-27 22:25:56 +01:00

C++ NAMESPACE format emacs happy

This commit is contained in:
paboyle 2018-01-13 00:03:57 +00:00
parent 6d7bdfb5f5
commit c0a9b38c02

View File

@ -36,13 +36,13 @@
#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) ) {
@ -52,12 +52,12 @@ namespace Grid {
format = std::string("IEEE64BIG"); format = std::string("IEEE64BIG");
} }
return format; return format;
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// header specification/interpretation // header specification/interpretation
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
class FieldMetaData : Serializable { class FieldMetaData : Serializable {
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(FieldMetaData, GRID_SERIALIZABLE_CLASS_MEMBERS(FieldMetaData,
int, nd, int, nd,
@ -89,11 +89,11 @@ namespace Grid {
scidac_checksumb=0; scidac_checksumb=0;
checksum=0; checksum=0;
} }
}; };
namespace QCD { namespace QCD {
using namespace Grid; using namespace Grid;
@ -165,8 +165,8 @@ namespace Grid {
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;
@ -232,11 +232,11 @@ template<class vobj> inline void PrepareMetaData(Lattice<vobj> & field, FieldMet
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;
@ -252,10 +252,10 @@ struct BinarySimpleUnmunger {
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;
@ -271,7 +271,7 @@ struct BinarySimpleMunger {
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>
@ -323,7 +323,7 @@ struct BinarySimpleMunger {
} }
} }
}; };
}
} }
NAMESPACE_END(Grid);