Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new bitmap by S-Step with a given item-bitmap.
        /// </summary>
        public Bitmap8 CreateNewBySStep(Bitmap8 itemBitmap)
        {
            // A new bitmap for S-Step will be create by ANDing transformed sequence-bitmap with item-bitmap.
            // During creating a new bitmap also counts the support for a new bitmap.
            var support     = 0;
            var newBitmaps  = new byte[_sequencesCount];
            var itemBitmaps = itemBitmap._bitmaps;

            for (var sid = 0; sid < _sequencesCount; ++sid)
            {
                if (_bitmaps[sid] == 0)
                {
                    continue;
                }

                var tid = DeBruijn.FirstSetBit(_bitmaps[sid]);

                if ((newBitmaps[sid] = (byte)(TransformedBitmap[tid] & itemBitmaps[sid])) == 0)
                {
                    continue;
                }

                ++support;
            }

            return(support > 0 ? new Bitmap8(newBitmaps, support) : null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new bitmap by I-Step with a given item-bitmap.
        /// </summary>
        public Bitmap8 CreateNewByIStep(Bitmap8 itemBitmap)
        {
            // A new bitmap for I-Step will be create by ANDing sequence-bitmap with item-bitmap.
            // During creating a new bitmap also counts the support for a new bitmap.
            var support     = 0;
            var newBitmaps  = new byte[_sequencesCount];
            var itemBitmaps = itemBitmap._bitmaps;

            for (var sid = 0; sid < _sequencesCount; ++sid)
            {
                if ((newBitmaps[sid] = (byte)(_bitmaps[sid] & itemBitmaps[sid])) == 0)
                {
                    continue;
                }

                ++support;
            }

            return(support > 0 ? new Bitmap8(newBitmaps, support) : null);
        }
    /// <summary>
    /// Creates a new bitmap by S-Step with a given item-bitmap. 
    /// </summary>
    public Bitmap8 CreateNewBySStep(Bitmap8 itemBitmap)
    {
      // A new bitmap for S-Step will be create by ANDing transformed sequence-bitmap with item-bitmap.
      // During creating a new bitmap also counts the support for a new bitmap.
      var support = 0;
      var newBitmaps = new byte[_sequencesCount];
      var itemBitmaps = itemBitmap._bitmaps;

      for (var sid = 0; sid < _sequencesCount; ++sid)
      {
        if (_bitmaps[sid] == 0) continue;

        var tid = DeBruijn.FirstSetBit(_bitmaps[sid]);

        if ((newBitmaps[sid] = (byte) (TransformedBitmap[tid] & itemBitmaps[sid])) == 0) continue;
        
        ++support;
      }

      return support > 0 ? new Bitmap8(newBitmaps, support) : null;
    }
    /// <summary>
    /// Creates a new bitmap by I-Step with a given item-bitmap. 
    /// </summary>
    public Bitmap8 CreateNewByIStep(Bitmap8 itemBitmap)
    {
      // A new bitmap for I-Step will be create by ANDing sequence-bitmap with item-bitmap.
      // During creating a new bitmap also counts the support for a new bitmap.
      var support = 0;
      var newBitmaps = new byte[_sequencesCount];
      var itemBitmaps = itemBitmap._bitmaps;

      for (var sid = 0; sid < _sequencesCount; ++sid)
      {
        if ((newBitmaps[sid] = (byte) (_bitmaps[sid] & itemBitmaps[sid])) == 0) continue;
        
        ++support;
      }

     return support > 0 ? new Bitmap8(newBitmaps, support) : null;
    }