@@ -7110,6 +7110,9 @@ bool fwd_to_sink_fast_long(int i,GVec<int>& path,int& minpath,int& maxpath,GBitV
71107110 }
71117111 else {
71127112 for(int c=0;c<nchildren;c++) {
7113+
7114+ bool childonpath=false;
7115+ if(pathpat[inode->child[c]]) childonpath=true;
71137116 // check if child is already on the path
71147117 int *pos=gpos[edge(i,inode->child[c],gno)];
71157118 if(pos && pathpat[*pos]) {
@@ -7203,9 +7206,10 @@ bool fwd_to_sink_fast_long(int i,GVec<int>& path,int& minpath,int& maxpath,GBitV
72037206 }
72047207 }
72057208
7206-
7207- pathpat[inode->child[c]]=0;
72087209 if(pos) pathpat[*pos]=0;
7210+ if(childonpath) break;
7211+ pathpat[inode->child[c]]=0;
7212+
72097213
72107214 }
72117215 }
@@ -7276,7 +7280,6 @@ bool fwd_to_sink_fast_long(int i,GVec<int>& path,int& minpath,int& maxpath,GBitV
72767280 if(transfrag[tmax]->nodes.Last()>maxpath) maxpath=transfrag[tmax]->nodes.Last();
72777281 }
72787282
7279-
72807283 return fwd_to_sink_fast_long(maxc,path,minpath,maxpath,pathpat,transfrag,no2gnode,nodecov,gno,gpos);
72817284}
72827285
@@ -7326,6 +7329,10 @@ bool back_to_source_fast_long(int i,GVec<int>& path,int& minpath,int& maxpath,GB
73267329 //int maxparent=inode->parent[0];
73277330 //float maxparentcov=-1;
73287331 for(int p=0;p<nparents;p++) {
7332+
7333+ bool parentonpath=false;
7334+ if(pathpat[inode->parent[p]]) parentonpath=true;
7335+
73297336 // check if parent is already on the path
73307337 int *pos=gpos[edge(inode->parent[p],i,gno)];
73317338 if(pos && pathpat[*pos]) { // this is next child on the path
@@ -7421,8 +7428,9 @@ bool back_to_source_fast_long(int i,GVec<int>& path,int& minpath,int& maxpath,GB
74217428 }
74227429 }
74237430
7424- pathpat[inode->parent[p]]=0;
74257431 if(pos) pathpat[*pos]=0;
7432+ if(parentonpath) break;
7433+ pathpat[inode->parent[p]]=0;
74267434
74277435 }
74287436 }
@@ -8073,7 +8081,7 @@ float long_max_flow(int gno,GVec<int>& path,GBitVec& istranscript,GPVec<CTransfr
80738081 /*
80748082 { // DEBUG ONLY
80758083 printTime(stderr);
8076- fprintf(stderr,"Start max flow algorithm for path ");
8084+ fprintf(stderr,"Start max flow algorithm for gno=%d and path ",gno );
80778085 printBitVec(pathpat);
80788086 fprintf(stderr," :");
80798087 for(int i=0;i<n;i++) fprintf(stderr," %d:%d",i,path[i]);
@@ -10798,7 +10806,15 @@ void get_trf_long(int gno,int edgeno, GIntHash<int> &gpos,GPVec<CGraphnode>& no2
1079810806 /*
1079910807 { // DEBUG ONLY
1080010808 fprintf(stderr,"\n\n***Start get_trf_long with maxi=%d minp=%d maxp=%d and transcript:",maxi,minp,maxp);
10801- for(int i=0;i<transfrag[t]->nodes.Count();i++) fprintf(stderr," %d",transfrag[t]->nodes[i]);
10809+ for(int i=0;i<transfrag[t]->nodes.Count();i++) {
10810+ if(i) {
10811+ pos=gpos[edge(transfrag[t]->nodes[i-1],transfrag[t]->nodes[i],gno)];
10812+ if(pos && pathpat[*pos])
10813+ fprintf(stderr,"-");
10814+ }
10815+ fprintf(stderr," %d",transfrag[t]->nodes[i]);
10816+
10817+ }
1080210818 fprintf(stderr," pathpat=");
1080310819 //printBitVec(pathpat);
1080410820 fprintf(stderr,"\n");
0 commit comments