public void TestMethod2()
        {
            int Ns = 16;
            int Nd = 6;
            int R  = 70;

            int[, ,] m = new int[Ns, Ns, Nd];
            for (int i = 0; i < Nd; i++)
            {
                for (int j = 0; j < Ns; j++)
                {
                    for (int k = 0; k < Ns; k++)
                    {
                        if (k <= j)
                        {
                            m[k, j, i] = 1;
                        }
                    }
                }
            }

            BitArray b = new BitArray(Numeration.fullNumerationBlock(m));

            bool[] bits = new bool[b.Count];
            b.CopyTo(bits, 0);
            byte[] bitValues = bits.Select(bit => (byte)(bit ? 1 : 0)).ToArray();

            //System.Console.WriteLine(Numeration.fullNumerationBlock(m));
            System.Console.WriteLine("numBit");
            for (int i = 0; i < bitValues.GetLength(0); i++)
            {
                if (i % 16 == 0)
                {
                    System.Console.WriteLine();
                }
                if (i % (16 * 16) == 0)
                {
                    System.Console.WriteLine();
                }
                System.Console.Write(bitValues[i]);
            }
        }
        public void TestMethod1()
        {
            int Ns = 16;
            int Nd = 6;
            int R  = 70;

            int[,,] m = new int[Ns, Ns, Nd];
            for (int i = 0; i < Nd; i++)
            {
                for (int j = 0; j < Ns; j++)
                {
                    for (int k = 0; k < Ns; k++)
                    {
                        //m[k, j, i] = 1;// (k % 2 + j % 2 + i % 2) % 2;
                        if (k <= j)
                        {
                            m[k, j, i] = 1;
                        }
                    }
                }
            }
            System.Console.WriteLine(Numeration.numerizationBlock(m));
        }
Ejemplo n.º 3
0
 private void AssertEpeler(string attendu, long valeur)
 {
     Assert.AreEqual(attendu, Numeration.Epeler(valeur));
 }
Ejemplo n.º 4
0
 public void Epeler_0_RetourneZero()
 {
     Assert.AreEqual("zéro", Numeration.Epeler(0));
 }
Ejemplo n.º 5
0
        private void AssertEpeler(string attendu, long nombre, OptionNumeration options = 0)
        {
            Numeration test = new Numeration(options);

            Assert.AreEqual(attendu, test.Epeler(nombre));
        }
Ejemplo n.º 6
0
        public void SimpleTestNumerationMcc()
        {
            List <Minutia> twoMinutiae  = new List <Minutia>();
            Minutia        firstMinutia = new Minutia();

            firstMinutia.X     = 40;
            firstMinutia.Y     = 60;
            firstMinutia.Angle = 0;
            twoMinutiae.Add(firstMinutia);

            Minutia secondMinutia = new Minutia();

            secondMinutia.X     = 70;
            secondMinutia.Y     = 100;
            secondMinutia.Angle = Math.PI / 6;
            twoMinutiae.Add(secondMinutia);

            Dictionary <Minutia, Tuple <int[, , ], int[, , ]> > response = MCC.MCCMethod(twoMinutiae, 364, 256);

            for (int i = 0; i < response.Count; i++)
            {
                int[] valueN = Numeration.numerizationBlock(response[twoMinutiae[i]].Item1);
                int[] maskN  = Numeration.numerizationBlock(response[twoMinutiae[i]].Item2);
                for (int j = 0; j < maskN.GetLength(0); j++)
                {
                    //System.Console.Write(valueN[j] + " ");
                    BitArray b    = new BitArray(new int[] { maskN[j] });
                    bool[]   bits = new bool[b.Count];
                    b.CopyTo(bits, 0);

                    if (j % (maskN.Count() / 6) == 0)
                    {
                        //                 System.Console.Write(" j = " + j + "\n");
                    }

                    for (int k = 0; k < bits.GetLength(0); k++)
                    {
                        System.Console.Write(bits[k]? 1 : 0);
                        if (k == 15)
                        {
                            System.Console.Write(" i = " + i + "\n");
                        }
                    }
                    System.Console.Write(" j = " + j + "\n");
                }
                System.Console.WriteLine();
                System.Console.WriteLine();
                for (int j = 0; j < valueN.GetLength(0); j++)
                {
                    //System.Console.Write(valueN[j] + " ");
                    BitArray b    = new BitArray(new int[] { valueN[j] });
                    bool[]   bits = new bool[b.Count];
                    b.CopyTo(bits, 0);

                    if (j % (valueN.Count() / 6) == 0)
                    {
                        //               System.Console.Write(" j = " + j + "\n");
                    }

                    for (int k = 0; k < bits.GetLength(0); k++)
                    {
                        System.Console.Write(bits[k]? 1 : 0);
                        if (k == 15)
                        {
                            System.Console.Write(" i = " + i + "\n");
                        }
                    }
                    System.Console.Write(" j = " + j + "\n");
                }
                System.Console.WriteLine();
                System.Console.WriteLine();
                System.Console.WriteLine();
                System.Console.WriteLine();
            }
        }