abc/src/base/io/ioReadPlaMo.c
// detects pairs of distance-1 cubes with identical outputs
detects pairs of distance-1 cubes with identical outputs
detects pairs of distance - 1 cubes with identical outputs
Vec_Int_t * Mop_ManFindDist1Pairs( Mop_Man_t * p, Vec_Int_t * vGroup )
{
    int c1, c2, iCube1, iCube2;
    Vec_Int_t * vPairs = Vec_IntAlloc( 100 );
    Vec_IntForEachEntry( vGroup, iCube1, c1 )
    {
        word * pCube1Out, * pCube1 = Mop_ManCubeIn( p, iCube1 );
        Vec_IntForEachEntryStart( vGroup, iCube2, c2, c1+1 )
        {
            word * pCube2Out, * pCube2 = Mop_ManCubeIn( p, iCube2 );
            if ( !Mop_ManCheckDist1(pCube1, pCube2, p->nWordsIn) )
                continue;
            pCube1Out = Mop_ManCubeOut( p, iCube1 );
            pCube2Out = Mop_ManCubeOut( p, iCube2 );
            if ( !memcmp(pCube1Out, pCube2Out, sizeof(word)*p->nWordsOut) )
                Vec_IntPushTwo( vPairs, c1, c2 );
        }
    }
    return vPairs;
}
Vec_Int_t * Mop_ManFindDist1Pairs ( Mop_Man_t * p , Vec_Int_t * vGroup ) { int c1 , c2 , iCube1 , iCube2 ; Vec_Int_t * vPairs = Vec_IntAlloc ( 100 ) ; Vec_IntForEachEntry ( vGroup , iCube1 , c1 ) { word * pCube1Out , * pCube1 = Mop_ManCubeIn ( p , iCube1 ) ; Vec_IntForEachEntryStart ( vGroup , iCube2 , c2 , c1 + 1 ) { word * pCube2Out , * pCube2 = Mop_ManCubeIn ( p , iCube2 ) ; if ( ! Mop_ManCheckDist1 ( pCube1 , pCube2 , p -> nWordsIn ) ) continue ; pCube1Out = Mop_ManCubeOut ( p , iCube1 ) ; pCube2Out = Mop_ManCubeOut ( p , iCube2 ) ; if ( ! memcmp ( pCube1Out , pCube2Out , sizeof ( word ) * p -> nWordsOut ) ) Vec_IntPushTwo ( vPairs , c1 , c2 ) ; } } return vPairs ; }
detects pairs of distance-1 cubes with identical outputs
detects pairs of distance - 1 cubes with identical outputs