Example #1
0
        public void PowerTest()
        {
            ModulusMatrix matrix = new ModulusMatrix(2, 2);

            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < 2; j++)
                {
                    matrix[i, j] = new ModulusNumber((uint)(i * 2 + j));
                }
            }

            ModulusMatrix manualMatrix = matrix * matrix * matrix;
            ModulusMatrix powerMatrix  = ModulusMatrix.Power(matrix, 3);

            Assert.IsTrue(manualMatrix == powerMatrix);
        }
Example #2
0
        public void F100_10e12()
        {
            ModulusNumber result = Program.F(100, BigInteger.Pow(10, 12));

            Assert.AreEqual <ulong>(635147632, result.Value);
        }
Example #3
0
        public void F10000_10000()
        {
            ModulusNumber result = Program.F(10000, 10000);

            Assert.AreEqual <ulong>(749784357, result.Value);
        }
Example #4
0
        public void F10e12_100()
        {
            ModulusNumber result = Program.F(BigInteger.Pow(10, 12), 100);

            Assert.AreEqual <ulong>(364553235, result.Value);
        }
Example #5
0
        public void F100_100()
        {
            ModulusNumber result = Program.F(100, 100);

            Assert.AreEqual <ulong>(841913936, result.Value);
        }
Example #6
0
        public void F10_13()
        {
            ModulusNumber result = Program.F(10, 13);

            Assert.AreEqual <ulong>(37959702514 % ModulusNumber.Mod, result.Value);
        }
Example #7
0
        public void F13_10()
        {
            ModulusNumber result = Program.F(13, 10);

            Assert.AreEqual <ulong>(3729050610636 % ModulusNumber.Mod, result.Value);
        }
Example #8
0
        public void F10_3()
        {
            ModulusNumber result = Program.F(10, 3);

            Assert.AreEqual <ulong>(28479, result.Value);
        }
Example #9
0
        public void F4_2()
        {
            ModulusNumber result = Program.F(4, 2);

            Assert.AreEqual <ulong>(10, result.Value);
        }