24 if (mu < 0 || mu >=
Nd)
29 for(
int i=0; i < nodeSites; ++i)
34 copy_site(d.elem(iouter), iinner, cc.elem());
47 for(
int i=0; i < s1.size(); ++i)
58 int nsubset_indices = func.numSubsets();
62 QDP_info(
"Set a subset: nsubset = %d",nsubset_indices);
66 sub.resize(nsubset_indices);
75 for(
int linear=0; linear < nodeSites; ++linear)
81 int icolor = func(coord);
84 cout <<
" coord="<<coord<<
" node="<<node<<
" linear="<<linear<<
" col="<<icolor << std::endl;
94 if (icolor < 0 || icolor >= nsubset_indices)
95 QDP_error_exit(
"Set: coloring is outside legal range: color[%d]=%d",linear,icolor);
107 for(
int cb=0; cb < nsubset_indices; ++cb)
112 int num_sitetable = 0;
113 for(
int linear=0; linear < nodeSites; ++linear)
120 sitetable.resize(num_sitetable);
128 if (num_sitetable > 0)
131 for(
int i=0; i < num_sitetable; ++i)
135 for(
int linear=0, j=0; linear < nodeSites; ++linear)
137 sitetable[j++] = linear;
143 start = sitetable[0];
144 end = sitetable[sitetable.size()-1];
147 for(
int prev=sitetable[0], i=0; i < sitetable.size(); ++i)
148 if (sitetable[i] != prev++)
151 QDP_info(
"Set(%d): sitetable[%d]=%d",cb,i,sitetable[i]);
166 sub[cb].make(ordRep, start, end, &(
sitetables[cb]), cb,
this);
169 QDP_info(
"Subset(%d): num_sitetable=%d start=%d end=%d",cb,num_sitetable,start,end);
multi1d< int > lat_color
Index or color array of lattice.
void make(const SetFunc &fn)
Constructor from a function object.
multi1d< multi1d< int > > sitetables
Array of sitetable arrays.
multi1d< Subset > sub
A set is composed of an array of subsets.
Container for a multi-dimensional 1D array.
OScalar< PScalar< PScalar< RScalar< INTEGER32 > > > > Integer
OLattice< PScalar< PScalar< RScalar< INTEGER32 > > > > LatticeInteger
TextWriter & operator<<(TextWriter &txt, const std::string &output)
void copy_site(IScalar< T > &d, int isite, const IScalar< T1 > &s1)
dest [some type] = source [some type]
Layout namespace holding info on problem size and machine info.
int nodeNumber()
Returns the node number of this node.
int linearSiteIndex(int site)
The linearized site index for the corresponding lexicographic site.
int sitesOnNode()
Subgrid lattice volume.
multi1d< int > siteCoords(int node, int index) QDP_CONST
Reconstruct the lattice coordinate from the node and site number.
LatticeInteger latticeCoordinate(int mu)
coord[mu] <- mu : fill with lattice coord in mu direction
StandardOutputStream cout
Yet another random number generator.
void QDP_error_exit(const char *format,...)
Simple error display and abort routine.
int QDP_info(const char *format,...)
Simple information display routine.
Primary include file for QDP.