SEclone basic classes for tagging

 

Functions included in tdb0.cpp

 

 

I just give the code for the time being with partiel comments

 

InitD() is the expansion of weak links.

 

Yloop() is a subroutine of the search of an active loop seen in TZPTLN.

    loop is the parent bitfield for m1

    m2  is the value to set to mincluded

 

Loop_Layer() looks for eliminations outside a loop

  That code has to be revisited (and simplified) after the last changes in the process

  

Same for IsActiveOr() and  CleanOr()

 

This will be done in my next test run;

 

//<<<<<<<<<<<<<<<<<<<<<<<<  générer les descendants

void TDB::InitD(int np)

{TDB ww=*this;   int pas;

 for( int i=2;i<col;i++)

  {if (t[i].Nul())continue;   int n=1;pas=0;

   while(n && pas<np)

    { n=0;pas++;for(int j=2;j<col;j++)    // un descendant trouve

            {if((j==i)|| (j==(i^1)))continueif(t[i].Off(j)) continue;

        CB1024 x=ww.t[j]-t[i];       if(x.NonNul()) {t[i]|=x;n++;}

   }} // end j  while

 if(lchainm<pas) lchainm=pas; }

 }// end i   proc

 

 

/*  we look for a pure tag  Yloop m1-> m1 containing m2

    loop is the list of tags that could enter the loop   */

void TDB::Yloop(int m1,int m2, CB1024 & loop)

{if(o$.ot){E$.Enl();loop.ImageMarques("y loop ",0);

           E$.Esp();mms.ev(m1); E$.E( " -> "); mms.ev(m2);

                 E$.E( " -> "); mms.ev(m1);  E$.Enl();}

mincluded=m2;

 

Direct_Path(m1,m1, loop,4); // ask for y loop

if(length<1)

   {if(o$.ot) {E$.Enl("y loop retour vide ");}

     return; }// should exceed the max length

 path.CleanLoop(2*(path.ipth-1));

}

 

 

 

//======== is there eliminations from a closed loop within a layer

// on primary weak links

void TDB::Loop_Layer()

{E$.Enl("loop layer"); //Image();

 for(int i=2;i<col;i++) for(int j=2;j<zpln.mfinc;j+=2)

 if((i-j) && (i-(j^1))) // candidate not in the layer

 if(t[i].On(j) && t[i].On(j^1)) // ok if it is a loop

 {if(op0)

    { E$.E("loop layer vu ->"); mms.ev(i);E$.Esp(); mms.ev(j);E$.Enl();}

  CF_R r1=zcf.GetConflitChemin(i,j),r2=zcf.GetConflitChemin(i,j^1);

  if((r1.length-1)||  (r2.length-1)) continue; // only basic

  if(r1.p1-r2.p1) continue; // exclude that situaton (2 layers)

  if(o$.ot){E$.E("loop essai loop thru ");

            zpln.Image(r1.p2);E$.Esp(); zpln.Image(r2.p2);E$.Enl();}

  int length=zl.Loop_thru(r1.p2,r2.p2,r1.p1);

  if(o$.ot) {E$.E("loop essai loop thru retour l="); E$.Enl(length);}

  if(length>3) // ok it is a closed loop

    {if(!tchain.Chaine( length,zl.path1.GetFirst() ) ) continue;

 

     ZINFL zw=t81f[zpln.zp[r1.p1].ig].z & t81f[zpln.zp[r1.p1].ig].z

                     & jdk.c[zpln.zp[r1.p1].ch];

    tchain.Add_Print(zw,zpln.zp[r1.p1].ch);

    }

 }

  

}

 

 

 

//================================

int TDB::IsActiveOr(USHORT m1,USHORT m2)// yes if potential elimination

{//E$.E( "isactive");mms.ev(m1);E$.Esp(); mms.ev(m2);E$.Enl(); 

for(int j=2;j<col;j++) 

         if(t[j].On(m1) && t[j].On(m2)  && (j-(m1^1)) && (j-(m2^1)) )return 1;

return 0;}

 

 

 

//=============================

void TDB::CleanOr(USHORT m1,USHORT m2)  // do it

{for(int j=2;j<col;j++) 

        if((t[j].On(m1)&& t[j].On(m2))   && (j-(m1^1)) && (j-(m2^1)) )

        zpln.SuppMarque(j);

}

 

 

//<<<<<<<<<<<<<<<<<<<<<<<

void TDB::Image() {E$.Enl( "Image zone tdb");

 for(int i=2;i<col;i++)  if(t[i].NonNul())  t[i].ImageMarques(" ",i);   }