abc/src/misc/mvc/mvcUtils.c
/**Function*************************************************************

  Synopsis    [Copies a column from the old cover to the new cover.]

  Description [Copies the column (iColOld) of the old cover (pCoverOld)
  into the column (iColNew) of the new cover (pCoverNew). Assumes that 
  the number of cubes is the same in both covers. Makes no assuptions 
  about the current contents of the column in the new cover.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Copies a column from the old cover to the new cover.]

Description [Copies the column (iColOld) of the old cover (pCoverOld)
into the column (iColNew) of the new cover (pCoverNew). Assumes that
the number of cubes is the same in both covers. Makes no assuptions
about the current contents of the column in the new cover.]




Function Synopsis [ Copies a column from the old cover to the new cover . ] Description [ Copies the column ( iColOld ) of the old cover ( pCoverOld ) into the column ( iColNew ) of the new cover ( pCoverNew ) . Assumes that the number of cubes is the same in both covers . Makes no assuptions about the current contents of the column in the new cover . ]
void Mvc_CoverCopyColumn( Mvc_Cover_t * pCoverOld, Mvc_Cover_t * pCoverNew, 
                         int iColOld, int iColNew )
{
    Mvc_Cube_t * pCubeOld, * pCubeNew;
    int iWordOld, iWordNew, iBitOld, iBitNew;
    assert( Mvc_CoverReadCubeNum(pCoverOld) == Mvc_CoverReadCubeNum(pCoverNew) );
    iWordOld = Mvc_CubeWhichWord(iColOld);
    iBitOld  = Mvc_CubeWhichBit(iColOld);
    iWordNew = Mvc_CubeWhichWord(iColNew);
    iBitNew  = Mvc_CubeWhichBit(iColNew);
    pCubeNew = Mvc_CoverReadCubeHead(pCoverNew);
    Mvc_CoverForEachCube( pCoverOld, pCubeOld )
    {
        if ( pCubeOld->pData[iWordOld] & (1<<iBitOld) )
            pCubeNew->pData[iWordNew] |= (1<<iBitNew);
        else
            pCubeNew->pData[iWordNew] &= ~(1<<iBitNew);  
        pCubeNew = Mvc_CubeReadNext( pCubeNew );
    }
}
void Mvc_CoverCopyColumn ( Mvc_Cover_t * pCoverOld , Mvc_Cover_t * pCoverNew , int iColOld , int iColNew ) { Mvc_Cube_t * pCubeOld , * pCubeNew ; int iWordOld , iWordNew , iBitOld , iBitNew ; assert ( Mvc_CoverReadCubeNum ( pCoverOld ) == Mvc_CoverReadCubeNum ( pCoverNew ) ) ; iWordOld = Mvc_CubeWhichWord ( iColOld ) ; iBitOld = Mvc_CubeWhichBit ( iColOld ) ; iWordNew = Mvc_CubeWhichWord ( iColNew ) ; iBitNew = Mvc_CubeWhichBit ( iColNew ) ; pCubeNew = Mvc_CoverReadCubeHead ( pCoverNew ) ; Mvc_CoverForEachCube ( pCoverOld , pCubeOld ) { if ( pCubeOld -> pData [ iWordOld ] & ( 1 << iBitOld ) ) pCubeNew -> pData [ iWordNew ] |= ( 1 << iBitNew ) ; else pCubeNew -> pData [ iWordNew ] &= ~ ( 1 << iBitNew ) ; pCubeNew = Mvc_CubeReadNext ( pCubeNew ) ; } }
Function
Synopsis    [Copies a column from the old cover to the new cover.]
Function Synopsis [ Copies a column from the old cover to the new cover . ]
// get the place of the old and new columns // go through the cubes of both covers // added by wjiang