@@ -245,7 +245,7 @@ void ProcessDiagram(EGraph *eg, void *ti)
245245//
246246// Now get the nodes
247247//
248- if ( ( info->flags & NONODES ) == 0 ) {
248+ if ( ( info->flags & WITHOUTNODES ) == 0 ) {
249249 for ( i = 0 ; i < eg->nNodes ; i++ ) {
250250//
251251// node_(number,coupling,particle_1(momentum_1),...,particle_n(momentum_n))
@@ -395,7 +395,7 @@ void ProcessDiagram(EGraph *eg, void *ti)
395395 startfill[1 ] = fill-startfill;
396396 }
397397 }
398- if ( ( info->flags & WITHONEPI ) == WITHONEPI ) {
398+ if ( ( info->flags & WITHONEPISETS ) == WITHONEPISETS ) {
399399 for ( i = 0 ; i < eg->econn ->nopic ; i++ ) {
400400 startfill = fill;
401401 *fill++ = ONEPI;
@@ -452,8 +452,6 @@ void ProcessDiagram(EGraph *eg, void *ti)
452452 *newterm = fill - newterm;
453453 AT.WorkPointer = fill;
454454
455- // MesPrint("<> %a",newterm[0],newterm);
456-
457455 Generator (BHEAD newterm,info->level );
458456 AT.WorkPointer = oldworkpointer;
459457}
@@ -664,7 +662,7 @@ Bool ProcessTopology(EGraph *eg, void *ti)
664662// startfill[1] = fill-startfill;
665663// }
666664 }
667- if ( ( info->flags & WITHONEPI ) == WITHONEPI ) {
665+ if ( ( info->flags & WITHONEPISETS ) == WITHONEPISETS ) {
668666 for ( i = 0 ; i < eg->econn ->nopic ; i++ ) {
669667 startfill = fill;
670668 *fill++ = ONEPI;
@@ -718,15 +716,39 @@ Bool ProcessTopology(EGraph *eg, void *ti)
718716 *newterm = fill - newterm;
719717 AT.WorkPointer = fill;
720718
721- // MesPrint("<> %a",*newterm,newterm);
722-
723719 Generator (BHEAD newterm,info->level );
724720 AT.WorkPointer = oldworkpointer;
725721 info->numtopo ++;
726722 return False;
727723}
728724
729725// #] ProcessTopology :
726+ // #[ SetDualOpts :
727+ void SetDualOpts (int *opt, const WORD num, const int key, const char * key_name,
728+ const int dual, const char * dual_name, const int val, const int dval) {
729+
730+ if ( ( num & key ) == key ) {
731+ if ( ( num & dual ) == dual ) {
732+ MLOCK (ErrorMessageLock);
733+ MesPrint (" &Conflicting diagram filters: %s and %s." , key_name, dual_name);
734+ MUNLOCK (ErrorMessageLock);
735+ Terminate (-1 );
736+ }
737+ else {
738+ *opt = val;
739+ }
740+ }
741+ else {
742+ if ( ( num & dual ) == dual ) {
743+ *opt = dval;
744+ }
745+ else {
746+ // The default value is always 0.
747+ *opt = 0 ;
748+ }
749+ }
750+ }
751+ // #] SetDualOpts :
730752// #[ GenDiagrams :
731753
732754int GenDiagrams (PHEAD WORD *term, WORD level)
@@ -780,48 +802,45 @@ int GenDiagrams(PHEAD WORD *term, WORD level)
780802
781803 opt->setOutAG (ProcessDiagram, &info);
782804 opt->setOutMG (ProcessTopology, &info);
783- // opt->setEndMG(fendMG, &info);
784805
785- opt->values [GRCC_OPT_1PI] = ( optionnumber & ONEPARTICLEIRREDUCIBLE ) == ONEPARTICLEIRREDUCIBLE;
786- opt->values [GRCC_OPT_NoTadpole] = ( optionnumber & NOTADPOLES ) == NOTADPOLES;
787- //
788- // Next are snails:
789- //
790- opt->values [GRCC_OPT_No1PtBlock] = ( optionnumber & NOTADPOLES ) == NOTADPOLES;
791- //
792- if ( ( optionnumber & WITHINSERTIONS ) == WITHINSERTIONS ) {
793- opt->values [GRCC_OPT_No2PtL1PI] = True;
794- opt->values [GRCC_OPT_NoAdj2PtV] = True;
795- opt->values [GRCC_OPT_No2PtL1PI] = True;
796- }
797- else {
798- opt->values [GRCC_OPT_NoAdj2PtV] = True;
799- }
806+ // TODO decide what to do here
800807 opt->values [GRCC_OPT_SymmInitial] = ( optionnumber & WITHSYMMETRIZE ) == WITHSYMMETRIZE;
801- opt->values [GRCC_OPT_SymmFinal] = ( optionnumber & WITHSYMMETRIZE ) == WITHSYMMETRIZE;
808+ // opt->values[GRCC_OPT_SymmFinal] = ( optionnumber & WITHSYMMETRIZE ) == WITHSYMMETRIZE;
802809
810+ // TODO what does this do? info.flags already knows if WITHBLOCKS is set
803811// opt->values[GRCC_OPT_Block] = ( optionnumber & WITHBLOCKS ) == WITHBLOCKS;
804812
813+ // Now the "qgraf-compatible filtering options":
814+ int qgopt[GRCC_QGRAF_OPT_Size];
815+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_ONEPI], optionnumber,ONEPARTI, " ONEPI_" , ONEPARTR, " ONEPR_" , 1 ,-1 );
816+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_ONSHELL], optionnumber,ONSHELL, " ONSHELL_" , OFFSHELL, " OFFSHELL_" , 1 ,-1 );
817+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_NOSIGMA], optionnumber,NOSIGMA, " NOSIGMA_" , SIGMA, " SIGMA_" , 1 ,-1 );
818+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_NOSNAIL], optionnumber,NOSNAIL, " NOSNAIL_" , SNAIL, " SNAIL_" , 1 ,-1 );
819+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_NOTADPOLE],optionnumber,NOTADPOLE," NOTADPOLE_" ,TADPOLE , " TADPOLE_" , 1 ,-1 );
820+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_SIMPLE], optionnumber,SIMPLE, " SIMPLE_" , NOTSIMPLE," NOTSIMPLE_" ,1 ,-1 );
821+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_BIPART], optionnumber,BIPART, " BIPART_" , NONBIPART," NONBIPART_" ,1 ,-1 );
822+ SetDualOpts (&qgopt[GRCC_QGRAF_OPT_CYCLI], optionnumber,CYCLI, " CYCLI_" , CYCLR, " CYCLR_" , 1 ,-1 );
823+ qgopt[GRCC_QGRAF_OPT_FLOOP] = ( optionnumber & FLOOP ) == FLOOP;
824+ // Now set the options internally:
825+ opt->setQGrafOpt (qgopt);
826+
805827 opt->setOutputF (False," " );
806828 opt->setOutputP (False," " );
807829 opt->printLevel (babble);
808830
809- // opt->values[GRCC_OPT_Step] = GRCC_AGraph;
810-
811831// Load the various arrays.
812-
813- ninitl = Sets[inset].last - Sets[inset].first ;
814- for ( i = 0 ; i < ninitl; i++ ) {
815- x = SetElements[Sets[inset].first +i];
816- initlPart[i] = ConvertParticle (model,x);
832+ ninitl = Sets[inset].last - Sets[inset].first ;
833+ for ( i = 0 ; i < ninitl; i++ ) {
834+ x = SetElements[Sets[inset].first +i];
835+ initlPart[i] = ConvertParticle (model,x);
817836 info.legcouple [i] = m->vertices [numParticle (m,x)]->couplings ;
818- }
819- nfinal = Sets[outset].last - Sets[outset].first ;
820- for ( i = 0 ; i < nfinal; i++ ) {
821- x = SetElements[Sets[outset].first +i];
822- finalPart[i] = ConvertParticle (model,x);
837+ }
838+ nfinal = Sets[outset].last - Sets[outset].first ;
839+ for ( i = 0 ; i < nfinal; i++ ) {
840+ x = SetElements[Sets[outset].first +i];
841+ finalPart[i] = ConvertParticle (model,x);
823842 info.legcouple [i+ninitl] = m->vertices [numParticle (m,x)]->couplings ;
824- }
843+ }
825844 info.numextern = ninitl + nfinal;
826845 for ( i = 2 ; i <= MAXLEGS; i++ ) {
827846 if ( m->legcouple [i] == 1 ) {
@@ -850,16 +869,14 @@ Go_on:;
850869
851870 if ( ( info.flags & TOPOLOGIESONLY ) == 0 ) {
852871 while ( DistrN (nc,cpl,m->ncouplings ,scratch) ) {
853- proc = new Process (pid, model, opt,
854- ninitl, initlPart, nfinal, finalPart, cpl);
872+ proc = new Process (pid, model, opt, ninitl, initlPart, nfinal, finalPart, cpl);
855873 delete proc;
856874 info.numtopo = 1 ;
857875 }
858876 }
859877 else {
860878 cpl[0 ] = nc;
861- proc = new Process (pid, model, opt,
862- ninitl, initlPart, nfinal, finalPart, cpl);
879+ proc = new Process (pid, model, opt, ninitl, initlPart, nfinal, finalPart, cpl);
863880 delete proc;
864881 }
865882 M_free (scratch," DistrN" );
@@ -892,8 +909,7 @@ Go_on:;
892909/*
893910 And now the generation:
894911*/
895- proc = new Process (pid, model, opt,
896- ninitl, initlPart, nfinal, finalPart, cpl);
912+ proc = new Process (pid, model, opt, ninitl, initlPart, nfinal, finalPart, cpl);
897913 opt->end ();
898914 delete proc;
899915 delete opt;
@@ -1000,21 +1016,21 @@ int GenTopologies(PHEAD WORD *term, WORD level)
10001016
10011017 info.flags |= TOPOLOGIESONLY; // this is the topologies_ function after all.
10021018 if ( t1 < tstop && t1[0 ] == -SNUMBER ) {
1003- if ( ( t1[1 ] & NONODES ) == NONODES ) info.flags |= NONODES ;
1019+ if ( ( t1[1 ] & WITHOUTNODES ) == WITHOUTNODES ) info.flags |= WITHOUTNODES ;
10041020 if ( ( t1[1 ] & WITHEDGES ) == WITHEDGES ) info.flags |= WITHEDGES;
10051021 if ( ( t1[1 ] & WITHBLOCKS ) == WITHBLOCKS ) info.flags |= WITHBLOCKS;
1006- if ( ( t1[1 ] & WITHONEPI ) == WITHONEPI ) info.flags |= WITHONEPI ;
1007- opt->values [GRCC_OPT_1PI] = ( t1[1 ] & ONEPARTICLEIRREDUCIBLE ) == ONEPARTICLEIRREDUCIBLE ;
1008- // opt->values[GRCC_OPT_NoTadpole] = ( t1[1] & NOTADPOLES ) == NOTADPOLES ;
1009- opt->values [GRCC_OPT_NoTadpole] = ( t1[1 ] & NOSNAILS ) == NOSNAILS ;
1010- opt->values [GRCC_OPT_No1PtBlock] = ( t1[1 ] & NOTADPOLES ) == NOTADPOLES ;
1011- opt->values [GRCC_OPT_NoExtSelf] = ( t1[1 ] & NOEXTSELF ) == NOEXTSELF;
1012-
1013- if ( ( t1[1 ] & WITHINSERTIONS ) == WITHINSERTIONS ) {
1014- opt->values [GRCC_OPT_No2PtL1PI] = True;
1015- opt->values [GRCC_OPT_NoAdj2PtV] = True;
1016- opt->values [GRCC_OPT_No2PtL1PI] = True;
1017- }
1022+ if ( ( t1[1 ] & WITHONEPISETS ) == WITHONEPISETS ) info.flags |= WITHONEPISETS ;
1023+ opt->values [GRCC_OPT_1PI] = ( t1[1 ] & ONEPARTI ) == ONEPARTI ;
1024+ // opt->values[GRCC_OPT_NoTadpole] = ( t1[1] & NOTADPOLE ) == NOTADPOLE ;
1025+ opt->values [GRCC_OPT_NoTadpole] = ( t1[1 ] & NOSNAIL ) == NOSNAIL ;
1026+ opt->values [GRCC_OPT_No1PtBlock] = ( t1[1 ] & NOTADPOLE ) == NOTADPOLE ;
1027+ // opt->values[GRCC_OPT_NoExtSelf] = ( t1[1] & NOEXTSELF ) == NOEXTSELF;
1028+
1029+ // if ( ( t1[1] & WITHINSERTIONS ) == WITHINSERTIONS ) {
1030+ // opt->values[GRCC_OPT_No2PtL1PI] = True;
1031+ // opt->values[GRCC_OPT_NoAdj2PtV] = True;
1032+ // opt->values[GRCC_OPT_No2PtL1PI] = True;
1033+ // }
10181034 opt->values [GRCC_OPT_SymmInitial] = ( t1[1 ] & WITHSYMMETRIZE ) == WITHSYMMETRIZE;
10191035 }
10201036
0 commit comments