예제 #1
0
 public SMModel(BitPackage classTable, int classFactor, BitPackage stateTable, int[] charLenTable, string name)
 {
     this.classTable   = classTable;
     this.classFactor  = classFactor;
     this.stateTable   = stateTable;
     this.charLenTable = charLenTable;
     this.name         = name;
 }
예제 #2
0
파일: SMModel.cs 프로젝트: shu2333/dnGrep
 public SMModel(BitPackage classTable, int classFactor,
     BitPackage stateTable, int[] charLenTable, String name)
 {
     this.classTable = classTable;
     this.classFactor = classFactor;
     this.stateTable = stateTable;
     this.charLenTable = charLenTable;
     this.name = name;
 }
예제 #3
0
        public void TestUnpack()
        {
            int[] data = new int[] {
                BitPackage.Pack4bits(0, 1, 2, 3, 4, 5, 6, 7),
                BitPackage.Pack4bits(8, 9, 10, 11, 12, 13, 14, 15)
            };

            BitPackage pkg = new BitPackage(
                    BitPackage.INDEX_SHIFT_4BITS,
                    BitPackage.SHIFT_MASK_4BITS,
                    BitPackage.BIT_SHIFT_4BITS,
                    BitPackage.UNIT_MASK_4BITS,
                    data);

            for (int i = 0; i < 16; i++) {
                int n = pkg.Unpack(i);
                Assert.AreEqual(n, i);
            }
        }
예제 #4
0
 public static int Pack4bits(int a, int b, int c, int d, int e, int f, int g, int h)
 {
     return(BitPackage.Pack8bits(b << 4 | a, d << 4 | c, f << 4 | e, h << 4 | g));
 }
예제 #5
0
 public static int Pack8bits(int a, int b, int c, int d)
 {
     return(BitPackage.Pack16bits(b << 8 | a, d << 8 | c));
 }