47 int cldeg[MAXPOINTS], clnum[MAXPOINTS], clext[MAXPOINTS];
48 int cmind[MAXLEGS+1],cmaxd[MAXLEGS+1];
52static void ProcessDiagram(
EGraph *eg,
void *ti);
53static int processVertex(
TOPOTYPE *TopoInf,
int pointsremaining,
int level);
58int LoadModel(
MODEL *m)
66 if ( m->grccmodel != NULL )
return(0);
76 if ( m->ncouplings > GRCC_MAXNCPLG ) {
77 MesPrint(
"Too many coupling constants in model. Current limit is %d.",(WORD)GRCC_MAXNCPLG);
78 MesPrint(
"Suggestion: recompile Form with a larger value for GRCC_MAXNCPLG");
81 minp.defpart = GRCC_DEFBYCODE;
82 minp.name = (
char *)(m->name);
83 minp.ncouple = m->ncouplings;
84 for ( i = 0; i < GRCC_MAXNCPLG; i++ ) minp.cnamlist[i] = NULL;
85 for ( i = 0; i < minp.ncouple; i++ )
86 minp.cnamlist[i] = (
char *)(VARNAME(symbols,m->couplings[i]));
91 for ( i = 0; i < m->nparticles; i++ ) {
92 if ( minp.defpart == GRCC_DEFBYCODE ) {
95 pinp.pcode = m->vertices[i]->particles[0].number;
96 pinp.acode = m->vertices[i]->particles[1].number;
97 switch ( m->vertices[i]->particles[0].spin ) {
99 pinp.ptypec = GRCC_PT_Scalar;
102 pinp.ptypec = GRCC_PT_Ghost;
105 if ( m->vertices[i]->particles[0].type == 0 )
106 pinp.ptypec = GRCC_PT_Majorana;
108 pinp.ptypec = GRCC_PT_Undef;
111 if ( m->vertices[i]->particles[0].type == 0 )
112 pinp.ptypec = GRCC_PT_Majorana;
114 pinp.ptypec = GRCC_PT_Dirac;
117 pinp.ptypec = GRCC_PT_Vector;
120 pinp.ptypec = GRCC_PT_Undef;
125 pinp.name = (
char *)(VARNAME(functions,m->vertices[i]->particles[0].number));
126 pinp.aname = (
char *)(VARNAME(functions,m->vertices[i]->particles[1].number));
127 switch ( m->vertices[i]->particles[0].spin ) {
129 pinp.ptypen =
"scalar";
132 pinp.ptypen =
"ghost";
135 if ( m->vertices[i]->particles[0].type == 0 )
136 pinp.ptypen =
"majorana";
138 pinp.ptypen =
"undef";
141 if ( m->vertices[i]->particles[0].type == 0 )
142 pinp.ptypen =
"majorana";
144 pinp.ptypen =
"dirac";
147 pinp.ptypen =
"vector";
150 pinp.ptypen =
"undef";
154 pinp.extonly = m->vertices[i]->externonly;
155 mdl->addParticle(&pinp);
157 mdl->addParticleEnd();
161 for ( i = m->nparticles; i < m->invertices; i++ ) {
162 VERTEX *v = m->vertices[i];
163 if ( minp.defpart == GRCC_DEFBYCODE ) {
164 iinp.icode = NODEFUNCTION+i;
170 iinp.nplistn = v->nparticles;
171 for ( j = 0; j < iinp.nplistn; j++ ) {
172 if ( minp.defpart == GRCC_DEFBYCODE ) {
173 iinp.plistc[j] = v->particles[j].number;
176 iinp.plistn[j] = (
char *)(VARNAME(functions,v->particles[j].number));
186 for ( j = 0; j < m->ncouplings; j++ ) {
187 iinp.cvallist[j] = 0;
188 for ( k = 0; k < v->ncouplings; k += 2 ) {
189 if ( v->couplings[k] == m->couplings[j] ) {
190 iinp.cvallist[j] = v->couplings[k+1];
195 mdl->addInteraction(&iinp);
197 mdl->addInteractionEnd();
198 m->grccmodel = (
void *)mdl;
205int ConvertParticle(
Model *model,
int formnum)
211 for ( i = 0; i < model->nParticles; i++ ) {
212 if ( model->particles[i]->pcode == formnum ) {
return(i); }
213 else if ( model->particles[i]->acode == formnum ) {
return(-i); }
215 MesPrint(
"Particle %d not found in model %s",formnum,model->name);
223int ReConvertParticle(
Model *model,
int grccnum)
228 if ( grccnum < 0 ) {
return(model->particles[-grccnum]->acode); }
229 else {
return(model->particles[grccnum]->pcode); }
235int numParticle(
MODEL *m,WORD n)
238 for ( i = 0; i < m->nparticles; i++ ) {
239 if ( m->vertices[i]->particles[0].number == n )
return(i);
240 if ( m->vertices[i]->particles[1].number == n )
return(i);
242 MesPrint(
"numParticle: particle %d not found in model",n);
250void ProcessDiagram(
EGraph *eg,
void *ti)
261 if ( ( info->flags & TOPOLOGIESONLY ) == TOPOLOGIESONLY )
return;
263 WORD *term = info->term, *newterm, *oldworkpointer = AT.WorkPointer;
264 WORD *tdia = term + info->diaoffset;
265 WORD *tail = tdia + tdia[1];
266 WORD *tend = term + *term;
267 WORD *fill, *startfill, *cfill, *afill;
271 int numlegs, vect, edge, maxmom = 0;
273 newterm = term + *term;
274 for ( i = 1; i < info->diaoffset; i++ ) newterm[i] = term[i];
275 fill = newterm + info->diaoffset;
279 if ( ( info->flags & WITHOUTNODES ) == 0 ) {
280 for ( i = 0; i < eg->nNodes; i++ ) {
284 numlegs = eg->nodes[i]->deg;
286 *fill++ = NODEFUNCTION;
289 *fill++ = -SNUMBER; *fill++ = i+1;
294 if ( !eg->isExternal(i) ) {
295 afill = fill; *fill++ = 0; *fill++ = 1; FILLARG(fill)
296 cfill = fill; *fill++ = 0;
297 intr = eg->nodes[i]->intrct;
298 for ( j = 0; j < model->interacts[intr]->nclist; j++ ) {
299 if ( model->interacts[intr]->clist[j] != 0 ) {
300 *fill++ = SYMBOL; *fill++ = 4;
301 *fill++ = m->couplings[j];
302 *fill++ = model->interacts[intr]->clist[j];
305 *fill++ = 1; *fill++ = 1; *fill++ = 3;
306 *cfill = fill - cfill;
307 *afill = fill - afill;
316 for ( j = 0; j < numlegs; j++ ) {
317 *fill++ = ARGHEAD+FUNHEAD+6;
320 edge = eg->nodes[i]->edges[j];
324 if ( edge < 0 ) { a = ReConvertParticle(model,-eg->edges[vect]->ptcl); }
325 else { a = ReConvertParticle(model,eg->edges[vect]->ptcl); }
329 *fill++ = edge < 0 ? -MINVECTOR: -VECTOR;
330 if ( numlegs == 1 || vect < info->numextern ) {
331 *fill++ = SetElements[Sets[info->externalset].first+vect];
334 *fill++ = SetElements[Sets[info->internalset].first+(vect-eg->nExtern)];
336 maxmom = MaX(maxmom, vect-eg->nExtern);
338 *fill++ = 1; *fill++ = 1; *fill++ = 3;
340 startfill[1] = fill-startfill;
343 if ( ( info->flags & WITHEDGES ) == WITHEDGES ) {
344 for ( i = 0; i < eg->nEdges; i++ ) {
345 int n1 = eg->edges[i]->nodes[0];
346 int n2 = eg->edges[i]->nodes[1];
354 *fill++ = -SNUMBER; *fill++ = i+1;
356 *fill++ = ARGHEAD+FUNHEAD+6;
360 int a = ReConvertParticle(model,eg->edges[i]->ptcl);
366 if ( i < info->numextern ) {
367 *fill++ = SetElements[Sets[info->externalset].first+i];
370 *fill++ = SetElements[Sets[info->internalset].first+(i-eg->nExtern)];
371 maxmom = MaX(maxmom, i-eg->nExtern);
373 *fill++ = 1; *fill++ = 1; *fill++ = 3;
375 *fill++ = -SNUMBER; *fill++ = n1+1;
376 *fill++ = -SNUMBER; *fill++ = n2+1;
377 startfill[1] = fill - startfill;
380 if ( ( info->flags & WITHBLOCKS ) == WITHBLOCKS ) {
381 for ( i = 0; i < eg->econn->nblocks; i++ ) {
389 *fill++ = eg->econn->blocks[i].loop;
393 int bnodes[GRCC_MAXNODES], k;
394 WORD *argfill = fill, *funfill;
395 *fill++ = 0; *fill++ = 0; FILLARG(fill)
397 for ( k = 0; k < GRCC_MAXNODES; k++ ) bnodes[k] = 0;
398 for ( k = 0; k < eg->econn->blocks[i].nmedges; k++ ) {
399 bnodes[eg->econn->blocks[i].edges[k][0]] = 1;
400 bnodes[eg->econn->blocks[i].edges[k][1]] = 1;
402 for ( k = 0; k < GRCC_MAXNODES; k++ ) {
403 if ( bnodes[k] == 0 )
continue;
408 *fill++ = NODEFUNCTION;
411 *fill++ = -SNUMBER; *fill++ = k+1;
412 numlegs = eg->nodes[k]->deg;
413 for ( j = 0; j < numlegs; j++ ) {
414 edge = eg->nodes[k]->edges[j];
417 if ( numlegs == 1 || vect < info->numextern ) {
418 *fill++ = SetElements[Sets[info->externalset].first+vect];
421 *fill++ = SetElements[Sets[info->internalset].first+(vect-info->numextern)];
422 maxmom = MaX(maxmom, vect-info->numextern);
425 funfill[1] = fill-funfill;
427 *fill++ = 1; *fill++ = 1; *fill++ = 3;
428 *argfill = fill - argfill;
429 argfill[ARGHEAD] = argfill[0] - ARGHEAD;
430 startfill[1] = fill-startfill;
433 if ( ( info->flags & WITHONEPISETS ) == WITHONEPISETS ) {
434 for ( i = 0; i < eg->econn->nopic; i++ ) {
442 for ( j = 0; j < eg->econn->opics[i].nnodes; j++ ) {
444 *fill++ = eg->econn->opics[i].nodes[j]+1;
446 startfill[1] = fill-startfill;
452 if ( info->numtopo-1 < MAXPOSITIVE ) {
453 *fill++ = TOPO; *fill++ = FUNHEAD+2; FILLFUN(fill)
454 *fill++ = -SNUMBER; *fill++ = (WORD)(info->numtopo-1);
456 else if ( info->numtopo-1 < FULLMAX-1 ) {
457 *fill++ = TOPO; *fill++ = FUNHEAD+ARGHEAD+4; FILLFUN(fill)
458 *fill++ = ARGHEAD+4; *fill++ = 0; FILLARG(fill)
460 *fill++ = (WORD)((info->numtopo-1) & WORDMASK);
461 *fill++ = 1; *fill++ = 3;
464 *fill++ = TOPO; *fill++ = FUNHEAD+ARGHEAD+6; FILLFUN(fill)
465 *fill++ = ARGHEAD+6; *fill++ = 0; FILLARG(fill)
466 *fill++ = 6; *fill++ = (WORD)((info->numtopo-1) >> BITSINWORD);
467 *fill++ = (WORD)((info->numtopo-1) & WORDMASK);
468 *fill++ = 0; *fill++ = 1; *fill++ = 5;
473 if ( eg->nsym != 1 ) {
474 *fill++ = SNUMBER; *fill++ = 4; *fill++ = (WORD)eg->nsym; *fill++ = -1;
476 if ( eg->esym != 1 ) {
477 *fill++ = SNUMBER; *fill++ = 4; *fill++ = (WORD)eg->esym; *fill++ = -1;
479 if ( eg->extperm != 1 ) {
480 *fill++ = SNUMBER; *fill++ = 4; *fill++ = (WORD)eg->extperm; *fill++ = 1;
485 if ( maxmom >= Sets[info->internalset].last - Sets[info->internalset].first ) {
486 MLOCK(ErrorMessageLock);
487 MesPrint(
"&Insufficient internal momenta in diagrams_");
488 MUNLOCK(ErrorMessageLock);
494 while ( tail < tend ) *fill++ = *tail++;
495 if ( eg->fsign < 0 ) fill[-1] = -fill[-1];
496 *newterm = fill - newterm;
497 AT.WorkPointer = fill;
500 AT.WorkPointer = oldworkpointer;
506Bool fendMG(
EGraph *eg,
void *ti)
516Bool ProcessTopology(
EGraph *eg,
void *ti)
528 if ( ( ( info->flags & CHECKEXTERN ) == CHECKEXTERN ) && info->currentMODEL != NULL ) {
530 int numlegs, vect, edge;
531 for ( i = 0; i < eg->nNodes; i++ ) {
532 if ( eg->isExternal(i) )
continue;
533 numlegs = eg->nodes[i]->deg;
534 for ( j = 0; j < numlegs; j++ ) {
535 edge = eg->nodes[i]->edges[j];
537 if ( vect < info->numextern && info->legcouple[vect][numlegs] == 0 ) {
549 if ( ( info->flags & TOPOLOGIESONLY ) == 0 ) {
557 WORD *term = info->term, *newterm, *oldworkpointer = AT.WorkPointer;
558 WORD *tdia = term + info->diaoffset;
559 WORD *tail = tdia + tdia[1];
560 WORD *tend = term + *term;
561 WORD *fill, *startfill;
565 int numlegs, vect, edge, maxmom = 0;
567 newterm = term + *term;
568 for ( i = 1; i < info->diaoffset; i++ ) newterm[i] = term[i];
569 fill = newterm + info->diaoffset;
573 for ( i = 0; i < eg->nNodes; i++ ) {
577 numlegs = eg->nodes[i]->deg;
579 *fill++ = NODEFUNCTION;
582 *fill++ = -SNUMBER; *fill++ = i+1;
583 if ( model != NULL && m != NULL ) {
584 if ( !eg->isExternal(i) ) {
585 WORD *afill = fill; *fill++ = 0; *fill++ = 1; FILLARG(fill)
586 WORD *cfill = fill; *fill++ = 0;
587 int cpl = 2*eg->nodes[i]->extloop+eg->nodes[i]->deg-2;
588 *fill++ = SYMBOL; *fill++ = 4;
589 *fill++ = m->couplings[0];
591 *fill++ = 1; *fill++ = 1; *fill++ = 3;
592 *cfill = fill - cfill;
593 *afill = fill - afill;
594 if ( *afill == ARGHEAD+8 && afill[ARGHEAD+4] == 1 ) {
595 fill = afill; *fill++ = -SYMBOL; *fill++ = afill[ARGHEAD+3];
606 for ( j = 0; j < numlegs; j++ ) {
607 edge = eg->nodes[i]->edges[j];
609 *fill++ = edge < 0 ? -MINVECTOR: -VECTOR;
610 if ( numlegs == 1 || vect < info->numextern ) {
611 *fill++ = SetElements[Sets[info->externalset].first+vect];
614 *fill++ = SetElements[Sets[info->internalset].first+(vect-info->numextern)];
616 maxmom = MaX(maxmom, vect-info->numextern);
619 startfill[1] = fill-startfill;
621 if ( ( info->flags & WITHEDGES ) == WITHEDGES ) {
622 for ( i = 0; i < eg->nEdges; i++ ) {
623 int n1 = eg->edges[i]->nodes[0];
624 int n2 = eg->edges[i]->nodes[1];
631 *fill++ = -SNUMBER; *fill++ = i+1;
634 if ( i < info->numextern ) {
635 *fill++ = SetElements[Sets[info->externalset].first+i];
638 *fill++ = SetElements[Sets[info->internalset].first+(i-eg->nExtern)];
639 maxmom = MaX(maxmom, i-eg->nExtern);
642 *fill++ = -SNUMBER; *fill++ = n1+1;
643 *fill++ = -SNUMBER; *fill++ = n2+1;
644 startfill[1] = fill - startfill;
650 if ( ( info->flags & WITHBLOCKS ) == WITHBLOCKS ) {
651 for ( i = 0; i < eg->econn->nblocks; i++ ) {
659 *fill++ = eg->econn->blocks[i].loop;
663 int bnodes[GRCC_MAXNODES], k;
664 WORD *argfill = fill, *funfill;
665 *fill++ = 0; *fill++ = 0; FILLARG(fill)
667 for ( k = 0; k < GRCC_MAXNODES; k++ ) bnodes[k] = 0;
668 for ( k = 0; k < eg->econn->blocks[i].nmedges; k++ ) {
669 bnodes[eg->econn->blocks[i].edges[k][0]] = 1;
670 bnodes[eg->econn->blocks[i].edges[k][1]] = 1;
672 for ( k = 0; k < GRCC_MAXNODES; k++ ) {
673 if ( bnodes[k] == 0 )
continue;
678 *fill++ = NODEFUNCTION;
681 *fill++ = -SNUMBER; *fill++ = k+1;
682 numlegs = eg->nodes[k]->deg;
683 for ( j = 0; j < numlegs; j++ ) {
684 edge = eg->nodes[k]->edges[j];
687 if ( numlegs == 1 || vect < info->numextern ) {
688 *fill++ = SetElements[Sets[info->externalset].first+vect];
691 *fill++ = SetElements[Sets[info->internalset].first+(vect-info->numextern)];
692 maxmom = MaX(maxmom, vect-info->numextern);
695 funfill[1] = fill-funfill;
697 *fill++ = 1; *fill++ = 1; *fill++ = 3;
698 *argfill = fill - argfill;
699 argfill[ARGHEAD] = argfill[0] - ARGHEAD;
700 startfill[1] = fill-startfill;
717 if ( ( info->flags & WITHONEPISETS ) == WITHONEPISETS ) {
718 for ( i = 0; i < eg->econn->nopic; i++ ) {
726 for ( j = 0; j < eg->econn->opics[i].nnodes; j++ ) {
728 *fill++ = eg->econn->opics[i].nodes[j]+1;
730 startfill[1] = fill-startfill;
736 if ( info->numtopo < MAXPOSITIVE ) {
737 *fill++ = TOPO; *fill++ = FUNHEAD+2; FILLFUN(fill)
738 *fill++ = -SNUMBER; *fill++ = (WORD)(info->numtopo);
740 else if ( info->numtopo < FULLMAX-1 ) {
741 *fill++ = TOPO; *fill++ = FUNHEAD+ARGHEAD+4; FILLFUN(fill)
742 *fill++ = ARGHEAD+4; *fill++ = 0; FILLARG(fill)
744 *fill++ = (WORD)(info->numtopo & WORDMASK);
745 *fill++ = 1; *fill++ = 3;
748 *fill++ = TOPO; *fill++ = FUNHEAD+ARGHEAD+6; FILLFUN(fill)
749 *fill++ = ARGHEAD+6; *fill++ = 0; FILLARG(fill)
750 *fill++ = 6; *fill++ = (WORD)(info->numtopo >> BITSINWORD);
751 *fill++ = (WORD)(info->numtopo & WORDMASK);
752 *fill++ = 0; *fill++ = 1; *fill++ = 5;
757 if ( maxmom >= Sets[info->internalset].last - Sets[info->internalset].first ) {
758 MLOCK(ErrorMessageLock);
759 MesPrint(
"&Insufficient internal momenta in diagrams_");
760 MUNLOCK(ErrorMessageLock);
766 while ( tail < tend ) *fill++ = *tail++;
767 if ( eg->fsign < 0 ) fill[-1] = -fill[-1];
768 *newterm = fill - newterm;
769 AT.WorkPointer = fill;
772 AT.WorkPointer = oldworkpointer;
779void SetDualOpts(
int *opt,
const WORD num,
const int key,
const char* key_name,
780 const int dual,
const char* dual_name,
const int val,
const int dval) {
782 if ( ( num & key ) == key ) {
783 if ( ( num & dual ) == dual ) {
784 MLOCK(ErrorMessageLock);
785 MesPrint(
"&Conflicting diagram filters: %s and %s.", key_name, dual_name);
786 MUNLOCK(ErrorMessageLock);
794 if ( ( num & dual ) == dual ) {
806int GenDiagrams(PHEAD WORD *term, WORD level)
813 int babble = AC.GrccVerbose ? 2 : 0;
815 WORD inset,outset,*coupl,setnum,optionnumber = 0;
816 int i, j, cpl[GRCC_MAXNCPLG];
817 int ninitl, initlPart[GRCC_MAXLEGS], nfinal, finalPart[GRCC_MAXLEGS];
818 for ( i = 0; i < GRCC_MAXNCPLG; i++ ) cpl[i] = 0;
819 std::map<int,int> momlist;
826 info.diaoffset = AR.funoffset;
827 info.externalset = term[info.diaoffset+FUNHEAD+7];
828 info.internalset = term[info.diaoffset+FUNHEAD+9];
830 inset = term[info.diaoffset+FUNHEAD+3];
831 outset = term[info.diaoffset+FUNHEAD+5];
832 coupl = term + info.diaoffset + FUNHEAD + 10;
834 if ( term[info.diaoffset+1] > FUNHEAD + 12 ) {
835 optionnumber = term[info.diaoffset+FUNHEAD+13];
839 if ( term[info.diaoffset+1] > *coupl+FUNHEAD+10 )
840 optionnumber = term[info.diaoffset+*coupl+FUNHEAD+11];
842 setnum = term[info.diaoffset+FUNHEAD+1];
844 m = AC.models[SetElements[Sets[setnum].first]];
846 model = (
Model *)m->grccmodel;
848 info.currentModel = (
void *)model;
849 info.currentMODEL = (
void *)m;
852 info.flags = optionnumber;
856 opt->setOutAG(ProcessDiagram, &info);
857 opt->setOutMG(ProcessTopology, &info);
859 opt->values[GRCC_OPT_SymmInitial] = ( optionnumber & WITHSYMMETRIZEI ) == WITHSYMMETRIZEI;
860 opt->values[GRCC_OPT_SymmFinal] = ( optionnumber & WITHSYMMETRIZEF ) == WITHSYMMETRIZEF;
868 int qgopt[GRCC_QGRAF_OPT_Size];
869 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_ONEPI], optionnumber,ONEPARTI,
"ONEPI_", ONEPARTR,
"ONEPR_", 1,-1);
870 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_ONSHELL], optionnumber,ONSHELL,
"ONSHELL_", OFFSHELL,
"OFFSHELL_", 1,-1);
871 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_NOSIGMA], optionnumber,NOSIGMA,
"NOSIGMA_", SIGMA,
"SIGMA_", 1,-1);
872 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_NOSNAIL], optionnumber,NOSNAIL,
"NOSNAIL_", SNAIL,
"SNAIL_", 1,-1);
873 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_NOTADPOLE],optionnumber,NOTADPOLE,
"NOTADPOLE_",TADPOLE ,
"TADPOLE_", 1,-1);
874 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_SIMPLE], optionnumber,SIMPLE,
"SIMPLE_", NOTSIMPLE,
"NOTSIMPLE_",1,-1);
875 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_BIPART], optionnumber,BIPART,
"BIPART_", NONBIPART,
"NONBIPART_",1,-1);
876 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_CYCLI], optionnumber,CYCLI,
"CYCLI_", CYCLR,
"CYCLR_", 1,-1);
877 SetDualOpts(&qgopt[GRCC_QGRAF_OPT_FLOOP], optionnumber,FLOOP,
"FLOOP_", NOTFLOOP,
"NOTFLOOP_", 1,-1);
879 opt->setQGrafOpt(qgopt);
881 opt->setOutputF(False,
"");
882 opt->setOutputP(False,
"");
883 opt->printLevel(babble);
886 ninitl = Sets[inset].last - Sets[inset].first;
887 for ( i = 0; i < ninitl; i++ ) {
888 x = SetElements[Sets[inset].first+i];
889 initlPart[i] = ConvertParticle(model,x);
890 info.legcouple[i] = m->vertices[numParticle(m,x)]->couplings;
892 nfinal = Sets[outset].last - Sets[outset].first;
893 for ( i = 0; i < nfinal; i++ ) {
894 x = SetElements[Sets[outset].first+i];
895 finalPart[i] = ConvertParticle(model,x);
896 info.legcouple[i+ninitl] = m->vertices[numParticle(m,x)]->couplings;
898 info.numextern = ninitl + nfinal;
899 for ( i = 2; i <= MAXLEGS; i++ ) {
900 if ( m->legcouple[i] == 1 ) {
901 for ( j = 0; j < info.numextern; j++ ) {
902 if ( info.legcouple[j][i] == 0 ) { info.flags |= CHECKEXTERN;
goto Go_on; }
908 if ( info.numextern > Sets[info.externalset].last - Sets[info.externalset].first ) {
909 MLOCK(ErrorMessageLock);
910 MesPrint(
"&Insufficient external momenta in diagrams_");
911 MUNLOCK(ErrorMessageLock);
916 for ( i = 0; i < Sets[info.externalset].last - Sets[info.externalset].first; i++ ) {
917 const int momcode = SetElements[Sets[info.externalset].first + i];
918 if ( momcode < AM.OffsetVector ) {
919 MLOCK(ErrorMessageLock);
920 MesPrint(
"&Invalid negative external momentum in diagrams_: -%s",
921 VARNAME(vectors, momcode+WILDMASK-AM.OffsetVector));
922 MUNLOCK(ErrorMessageLock);
926 if ( momlist[momcode] != 1 ) {
927 MLOCK(ErrorMessageLock);
928 MesPrint(
"&Invalid repeated momentum in diagrams_: %s",
929 VARNAME(vectors, momcode-AM.OffsetVector));
930 MUNLOCK(ErrorMessageLock);
934 for ( i = 0; i < Sets[info.internalset].last - Sets[info.internalset].first; i++ ) {
935 const int momcode = SetElements[Sets[info.internalset].first + i];
936 if ( momcode < AM.OffsetVector ) {
937 MLOCK(ErrorMessageLock);
938 MesPrint(
"&Invalid negative internal momentum in diagrams_: -%s",
939 VARNAME(vectors, momcode+WILDMASK-AM.OffsetVector));
940 MUNLOCK(ErrorMessageLock);
944 if ( momlist[momcode] != 1 ) {
945 MLOCK(ErrorMessageLock);
946 MesPrint(
"&Invalid repeated momentum in diagrams_: %s",
947 VARNAME(vectors, momcode-AM.OffsetVector));
948 MUNLOCK(ErrorMessageLock);
961 if ( *coupl == -SNUMBER ) {
967 int nc = coupl[1]*2 + ninitl + nfinal - 2;
968 int *scratch = (
int *)Malloc1(nc*
sizeof(
int),
"DistrN");
971 if ( ( info.flags & TOPOLOGIESONLY ) == 0 ) {
972 while ( DistrN(nc,cpl,m->ncouplings,scratch) ) {
973 proc =
new Process(pid, model, opt, ninitl, initlPart, nfinal, finalPart, cpl);
980 proc =
new Process(pid, model, opt, ninitl, initlPart, nfinal, finalPart, cpl);
983 M_free(scratch,
"DistrN");
988 else if ( *coupl == -SYMBOL ) {
989 for ( i = 0; i < m->ncouplings; i++ ) {
990 if ( m->couplings[i] == coupl[1] ) {
998 t = coupl + ARGHEAD+3;
999 tstop = coupl+*coupl; tstop -= ABS(tstop[-1]);
1000 while ( t < tstop ) {
1001 for ( i = 0; i < m->ncouplings; i++ ) {
1002 if ( m->couplings[i] == *t ) {
1013 proc =
new Process(pid, model, opt, ninitl, initlPart, nfinal, finalPart, cpl);
1035int processVertex(
TOPOTYPE *TopoInf,
int pointsremaining,
int level)
1039 for ( i = pointsremaining, j = 0; i >= 0; i -= TopoInf->vert[level]-2, j++ ) {
1040 if ( TopoInf->vertmax && TopoInf->vertmax[level] >= 0
1041 && j > TopoInf->vertmax[level] )
break;
1043 TopoInf->cldeg[TopoInf->ncl] = TopoInf->vert[level];
1044 TopoInf->clnum[TopoInf->ncl] = j;
1045 TopoInf->clext[TopoInf->ncl] = 0;
1048 MGraph *mgraph =
new MGraph(1, TopoInf->ncl, TopoInf->cldeg,
1049 TopoInf->clnum, TopoInf->clext,
1050 TopoInf->cmind, TopoInf->cmaxd, TopoInf->opt);
1060 if ( level < TopoInf->nvert-1 ) {
1062 TopoInf->cldeg[TopoInf->ncl] = TopoInf->vert[level];
1063 TopoInf->clnum[TopoInf->ncl] = j;
1064 TopoInf->clext[TopoInf->ncl] = 0;
1067 if ( processVertex(TopoInf,i,level+1) < 0 )
return(-1);
1068 if ( j > 0 ) { TopoInf->ncl--; }
int Generator(PHEAD WORD *, WORD)