本文整理汇总了C++中Site::pos方法的典型用法代码示例。如果您正苦于以下问题:C++ Site::pos方法的具体用法?C++ Site::pos怎么用?C++ Site::pos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Site
的用法示例。
在下文中一共展示了Site::pos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void AlgTcharge::run()
{
Lattice& lattice( AlgLattice() );
Float tmat[nfunc][nfunc];
for (int f1(0);f1<nfunc;f1++)
for (int f2(0);f2<nfunc;f2++)
tmat[f1][f2] = 0;
// sum over lattice
Site nloop;
while ( nloop.LoopsOverNode() )
{
// Array of imaginary parts of the plaquettes
// at a given site
// plaqs[0] = F_01
// plaqs[1] = F_02
// plaqs[2] = F_03
// plaqs[3] = F_12
// plaqs[4] = F_13
// plaqs[5] = F_23
Matrix plaqs[nfunc][6];
//
// fill plaqs with the full plaquettes
// - then zero the real parts
//
int mu;
int nu;
int index(0);
for (mu=0;mu<3;++mu)
{
for (nu=mu+1;nu<4;nu++)
{
for (int f(0);f<nfunc;f++)
{
(*(leaf_map[f]))( lattice, plaqs[f][index], nloop.pos(), mu, nu );
ZeroReal(plaqs[f][index]);
}
index++;
}
}
for (int f1(0);f1<nfunc;f1++)
{
for (int f2(f1);f2<nfunc;f2++)
{
tmat[f1][f2] += MkTop(plaqs[f1],plaqs[f2]).real();
}
}
}
// global sum the approximations
for (int f1(0);f1<nfunc;f1++)
{
for (int f2(f1);f2<nfunc;f2++)
{
glb_sum( &tmat[f1][f2] );
}
}
// Print out results
//----------------------------------------------------------------
if(common_arg->filename != 0)
{
char *fname = "alg_tcharge()";
FILE *fp;
if( (fp = Fopen(common_arg->filename, "a")) == NULL ) {
ERR.FileA(cname,fname,common_arg->filename);
}
Fprintf(fp,"AlgTcharge:\n");
Fprintf(fp,"nleaf : %i\n",nfunc);
for (int f(0);f<nfunc;f++)
Fprintf(fp," %i : %s\n",f,names[f]);
for (int f1(0);f1<nfunc;f1++)
{
for (int f2(f1);f2<nfunc;f2++)
{
Fprintf(fp,"%i %i : %15e\n",f1,f2,tmat[f1][f2]);
}
}
Fclose(fp);
}
}