本文整理汇总了C++中writeF函数的典型用法代码示例。如果您正苦于以下问题:C++ writeF函数的具体用法?C++ writeF怎么用?C++ writeF使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了writeF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: make_vinf
static void make_vinf(void)
{
if(flag_12) writeF("static ");
writeF("char * varName_ext[%d]={\"P(cms)\"",nvars+nfunc+1);
scanvars(3);
writeF("};\n");
}
示例2: permRec
static void permRec(int ntot,int* np, int i0, int *pused, int *perm)
{
int i,j;
if(i0==ntot)
{
for(j=0;j<ntot;j++) if(perm[j]!=j)
{ int i;
writeF(",\n{");
for(i=0;i<ntot-1;i++)writeF("%d,",perm[i]+1);
writeF("%d}",perm[i]+1);
cPerm[ncPerm++]=makeCperm(ntot,np,perm);
break;
}
return;
}
for(j=0;j<ntot;j++) if(np[j]==np[i0] && !pused[j] )
{ perm[i0]=j;
pused[j]=1;
permRec(ntot,np,i0+1,pused,perm);
pused[j]=0;
}
}
示例3: scanvars
static void scanvars(int mode)
{
int k;
for(k=1;k<=nmodelvar;k++)
{ varlist modl=modelvars+k;
if (vararr[k].used && !modl->func && !modl->pwidth)
{
switch(mode)
{
case 2: writeF("\n,%E",modl->varvalue); break;
case 3: writeF("\n,\"%s\"",modl->varname); break;
}
}
}
for(k=1;k<=nmodelvar;k++)
{ varlist modl=modelvars+k;
if (vararr[k].used && (modl->func || modl->pwidth ))
{
switch(mode)
{
case 2: if(modl->hidden) writeF("\n,1"); else writeF("\n,0"); break;
case 3: writeF("\n,\"%s\"",modl->varname); break;
}
}
}
}
示例4: sortvars
static void sortvars(void)
{
int k;
for(k=4;k<=nmodelvar;k++) if(vararr[k].used && (k<=nCommonVars||modelvars[k].pub))
writeF("\n,\"%s\"",modelvars[k].varname);
for(k=1+nCommonVars;k<=nmodelvar;k++)if (vararr[k].used && !modelvars[k].pub)
writeF("\n,\"%s\"",modelvars[k].varname);
}
示例5: writpict
static void writpict(unsigned ndiagr)
{ vcsect vcs;
csdiagram csdiagr;
fseek(diagrq,ndiagr*sizeof(csdiagr),SEEK_SET);
FREAD1(csdiagr,diagrq);
transfdiagr(&csdiagr,&vcs);
writeF("/*\n");
DiagramToOutFile(&vcs,1,' ');
writeF("*/\n");
}
示例6: diagramReduce
static void diagramReduce( vcsect * vcs, catrec * cr )
{
writeF("\n");
writeF("DiagrNumber:=\"%d_%d\"$\n",cr->nsub_,cr->ndiagr_);
writeF("\n");
if (vcs) DiagramToOutFile(vcs,0,'%');
emitexpression(cr);
writeF("\n\n");
writeF("addToSum()$\n");
}
示例7: diagramMath
static void diagramMath(vcsect * vcs,catrec * cr)
{
writeF("\n(*\n");
writeF(" Diagram %d in subprocess %d\n",cr->ndiagr_,cr->nsub_);
if (vcs != NULL) DiagramToOutFile(vcs,0,' ');
writeF("*)\n");
emitexpression(cr);
writeF("\naddToSum;\n");
}
示例8: writeparameters
static void writeparameters(int nsub)
{
int k;
char ch;
char s[STRSIZ];
writeF("%%\n");
writeF("parameters:={\n");
for(k=1,ch=' ';k<=nmodelvar;k++)if(vararr[k].used)
{ if(modelvars[k].func)
{
sscanf(modelvars[k].func,"%[^%|\n]",s);
if(!modifyF(s)) continue;
} else sprintf(s,"%E",vararr[k].tmpvalue);
writeF("%c%s=>%s\n",ch,vararr[k].alias,s); ch=',';
}
writeF("}$\n");
writeF("%%\n");
writeF("substitutions:={\n");
for(k=nmodelvar,ch = ' '; k ;k--) if(vararr[k].used && modelvars[k].func)
{
sscanf(modelvars[k].func,"%[^%|\n]",s);
if(modifyF(s)) continue;
writeF("%c%s=>%s\n",ch,vararr[k].alias,s);
ch=',';
}
writeF("}$\n");
}
示例9: emitindex
static void emitindex(set *index)
{ int n,l;
l=set_first(index,1);
if(!l) return;
writeF(" Index ");
for(n=0;(n<4)&&l;n++)
{
if(n) writeF(",");
writeF("m%d",l);
set_del1(index,l);
l=set_first(index,1);
}
writeF("$\n");
}
示例10: writeDenominators
static void writeDenominators(deninforec* dendescript)
{
int i,k;
int nden_t2=nden_t, nden_s2=nden_s;
for (i = 1; i <= dendescript->tot_den; i++)
{ int numm = dendescript->denarr[i-1].order_num;
if(dendescript->denarr[i-1].width==0) numm += nden_w; else
{ if(dendescript->denarr[i-1].stype) nden_s2--;
else { numm += nden_s; nden_t2--;}
}
if(dendescript->denarr[i-1].power == 1) writeF("*Q1[%d]",numm);
else writeF("*Q2[%d]",numm);
}
writeF(";\n");
if(nden_s2+nden_t2)
{
if(nden_s2)
{
writeF("if(gswidth_ext )");
writeF(" R=R");
for (k = 1; k <= nden_s; k++)
{ int addpr = 1;
for (i = 1; i <= dendescript->tot_den; i++)
if (dendescript->denarr[i-1].width && dendescript->denarr[i-1].stype&&
k == dendescript->denarr[i-1].order_num) addpr = 0;
if (addpr) writeF("*Q0[%d]",k);
}
writeF(";\n");
}
if(nden_t2)
{ writeF("if(gtwidth_ext) R=R");
for (k = nden_s+1; k <= nden_w; k++)
{ int addpr = 1;
for (i = 1; i <= dendescript->tot_den; i++)
if (dendescript->denarr[i-1].width && (!dendescript->denarr[i-1].stype) &&
k == dendescript->denarr[i-1].order_num+nden_s) addpr = 0;
if (addpr) writeF("*Q0[%d]",k);
}
writeF(";\n");
}
}
}
示例11: calcColor
static void calcColor(long diag)
{
csdiagram csdiagr;
fseek(diagrq, (diag-1)*sizeof(csdiagr),SEEK_SET);
FREAD1(csdiagr,diagrq);
if(cBasisPower&&generateColorWeights(&csdiagr,cBasisPower,nC,cChains,cCoefN,cCoefD))
{ int k;
writeF(" if(cb_coeff_ext)\n {\n");
for(k=0; k<cBasisPower; k++)
if(cCoefN[k]) writeF(" cb_coeff_ext[%d] += (R*%d)/(%d);\n",k,
cCoefN[k],cCoefD[k]);
writeF(" }\n");
}
}
示例12: r_mult
static void r_mult(int arg1,int arg2,set index1)
{ char name0[8],name1[8],name2[8];
set mind;
unsigned m,mm,maxmm;
int pstn[15];
int n,l;
set index;
index=index1;
sprintf(name1,"Vrt_%d",arg1);
sprintf(name2,"Vrt_%d",arg2);
if(arg1 < arg2) strcpy(name0,name1); else strcpy(name0,name2);
mind=set_and(index,setmassindex);
if(set_eq0(mind)) reducemult(name0,name1,name2,index); else
{
reducemult("Vrt_0",name1,name2,index);
l = 1; n = 0;
while (!set_eq0(mind))
{
if (set_in(l,mind)) pstn[n++] = l;
set_del1(&mind,l++);
}
maxmm = (1 << n) - 1 ;
for (mm = 1;mm <= maxmm ; mm++)
{
writeF(" Vrt_L:=%s$ Vrt_R:=%s$\n",name1,name2);
mind=set_constr(_E);
m = mm; n = 1;
while (m != 0)
{
if ((m & 1) != 0 && (l = pstn[n-1]) != 0)
{
writeF(" Vrt_L:=(Vrt_L where %s)$\n",subst(l,arg1));
writeF(" Vrt_R:=(Vrt_R where %s)$\n",subst(l,arg2));
set_add1(&mind,l);
}
++(n);
m >>= 1;
}
reducemult("Vrt_0","Vrt_0 + Vrt_L","Vrt_R",set_aun(index,mind));
writeF(" Clear Vrt_L $ Clear Vrt_R $\n");
}
writeF(" %s:=Vrt_0 $ Clear Vrt_0 $\n",name0);
}
if (arg1 < arg2)
{
writeF(" Clear %s$\n",name2);
for (n = 1; n <= vcs.sizet; n++)
if (vertmap[n-1] == arg2) vertmap[n-1] = arg1;
}
if (arg2 < arg1)
{
writeF(" Clear %s$\n",name1);
for (n = 1; n <= vcs.sizet; n++)
if (vertmap[n-1] == arg1) vertmap[n-1] = arg2;
}
} /* R_mult */
示例13: head
static void head(void)
{ int l;
writeF("%% ----------- VARIABLES ------------------ \n");
writeF(" vector A,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,ZERO_;\n");
writeF(" vector m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16;\n");
writeF("%%\n");
writeF("%%--------- Mass shell declarations -----------\n");
for (l = 1; l <= nin + nout; l++)
writeF(" MASS P%d = %s$ MSHELL P%d$\n",l,inoutmasses[l-1],l);
writeF("%%\n");
writeF("operator propDen$\n");
}
示例14: emitfactors
static void emitfactors(void)
{
int c, i, j, s, vln, pnum;
writeF("%%---------- Factors ---------------\n");
/* ------- Symmetry Factor ------- */
writeF(" SymmFact:=%d/%d$ %% Diagram symmerty factor\n",
vcs.symnum,vcs.symdenum);
/* ----- average factor --------- */
for (c=1,i=0; i < vcs.sizel; i++)
{
vln = vcs.valence[i];
for (j = 0; j < vln; j++)
if (IN_PRTCL & vcs.vertlist[i][j].prop)
{
pnum = vcs.vertlist[i][j].partcl;
s = prtclbase1[pnum].spin;
switch (s)
{
case 1: if(!strchr("LR",prtclbase1[pnum].hlp)) c*=2; break;
case 2: if(zeromass(pnum)) c*=2; else c*=3; break;
case 3: if(zeromass(pnum)) c*=2; else c*=4; break;
case 4: if(zeromass(pnum)) c*=2; else c*=5;
}
c *= abs(prtclbase1[pnum].cdim);
}
}
writeF(" AverFact:=1/%d$ %% Normalization factor of polarization average\n",c);
/* ----- Fermion factor --------- */
for (c=1,i= 0; i < vcs.sizel; i++)
for (j=0; j <vcs.valence[i]; j++)
{
pnum=vcs.vertlist[i][j].partcl;
if(prtclbase1[pnum].spin&1 && (IN_PRTCL & vcs.vertlist[i][j].prop))c*=-1;
}
writeF(" FermFact:=%d$ %% (-1)**(number of in-fermion particles)\n",c);
/* ----- Color factor --------- */
writeF(" ColorFact:=%d/%d$ %% QCD color weight of diagram \n%%\n",
vcs.clrnum,vcs.clrdenum);
}
示例15: c_prog
int c_prog(void)
{
int result;
catalog=fopen(CATALOG_NAME "2","rb");
if(catalog)
{
int nin_=nin,nout_=nout, subproc_sq_=subproc_sq;
/* archiv=fopen(ARCHIV_NAME "2","rb"); */
diagrq=fopen(DIAGRQ_NAME "2","rb");
menuq=fopen(MENUQ_NAME "2","rb");
nin=1; nout=2;
{ char txt[100]; int ndel, ncalc, nrest;
long recpos;
for(subproc_sq=0;rd_menu(2,subproc_sq+1,txt,&ndel,&ncalc,&nrest,&recpos); subproc_sq++);
}
outFileOpen("%sresults%cwidth_2.c",pathtouser,f_slash);
labl();
writeF("#include<math.h>\n");
writeF("#include<stdio.h>\n");
writeF("#include\"extern_2.h\"\n");
writeF("#include\"num_out.h\"\n");
writeF("#include\"num_in.h\"\n");
result=c_prog_int(1);
outFileClose();
system("cd results; sed s/_ext/_2/g width_2.c > width2.c; "
"cat width2.c $CALCHEP/include/width_2+ > width_2.c; rm width2.c; "
"mv extern.h extern_2.h");
fclose(catalog);
whichArchive(0,0,0);
fclose(diagrq);
fclose(menuq);
nin=nin_; nout=nout_;
subproc_sq=subproc_sq_;
} else if(nin+nout>3)
{ outFileOpen("%sresults%cwidth_2.c",pathtouser,f_slash);
writeF("extern double width2_ext(char * pname);\n");
writeF("double width2_ext(char * pname){return 0.;}\n");
outFileClose();
}
catalog=fopen(CATALOG_NAME,"rb");
diagrq=fopen(DIAGRQ_NAME,"rb");
menuq=fopen(MENUQ_NAME,"rb");
result=c_prog_int(0);
fclose(catalog);
whichArchive(0,0,0);
fclose(diagrq);
fclose(menuq);
return result;
}