abc/src/base/io/ioReadPlaMo.c
// takes cubes with identical literal count and removes duplicates
takes cubes with identical literal count and removes duplicates
takes cubes with identical literal count and removes duplicates
int Mop_ManRemoveIdentical( Mop_Man_t * p, Vec_Int_t * vGroup )
{
    int w, c1, c2, iCube1, iCube2, nEqual = 0;
    Vec_IntForEachEntry( vGroup, iCube1, c1 )
    if ( iCube1 != -1 )
    {
        word * pCube1Out, * pCube1 = Mop_ManCubeIn( p, iCube1 );
        Vec_IntForEachEntryStart( vGroup, iCube2, c2, c1+1 )
        if ( iCube2 != -1 )
        {
            word * pCube2Out, * pCube2 = Mop_ManCubeIn( p, iCube2 );
            if ( memcmp(pCube1, pCube2, sizeof(word)*p->nWordsIn) )
                continue;
            pCube1Out = Mop_ManCubeOut( p, iCube1 );
            pCube2Out = Mop_ManCubeOut( p, iCube2 );
            for ( w = 0; w < p->nWordsOut; w++ )
                pCube1Out[w] |= pCube2Out[w];
            Vec_IntWriteEntry( vGroup, c2, -1 );
            Vec_IntPush( p->vFree, iCube2 );
            nEqual++;
        }
    }
    if ( nEqual )
        Map_ManGroupCompact( vGroup );
    return nEqual;
}
int Mop_ManRemoveIdentical ( Mop_Man_t * p , Vec_Int_t * vGroup ) { int w , c1 , c2 , iCube1 , iCube2 , nEqual = 0 ; Vec_IntForEachEntry ( vGroup , iCube1 , c1 ) if ( iCube1 != -1 ) { word * pCube1Out , * pCube1 = Mop_ManCubeIn ( p , iCube1 ) ; Vec_IntForEachEntryStart ( vGroup , iCube2 , c2 , c1 + 1 ) if ( iCube2 != -1 ) { word * pCube2Out , * pCube2 = Mop_ManCubeIn ( p , iCube2 ) ; if ( memcmp ( pCube1 , pCube2 , sizeof ( word ) * p -> nWordsIn ) ) continue ; pCube1Out = Mop_ManCubeOut ( p , iCube1 ) ; pCube2Out = Mop_ManCubeOut ( p , iCube2 ) ; for ( w = 0 ; w < p -> nWordsOut ; w ++ ) pCube1Out [ w ] |= pCube2Out [ w ] ; Vec_IntWriteEntry ( vGroup , c2 , -1 ) ; Vec_IntPush ( p -> vFree , iCube2 ) ; nEqual ++ ; } } if ( nEqual ) Map_ManGroupCompact ( vGroup ) ; return nEqual ; }
takes cubes with identical literal count and removes duplicates
takes cubes with identical literal count and removes duplicates
// merge cubes