Exemple #1
0
        static void Transform(int n, long m, long w, bool result)
        {
            var ntt = new NTT102(n, m, w);
            var f1  = Enumerable.Range(3, 5).Select(v => (long)v).ToArray();
            var f_  = ntt.Transform(f1, false);
            var f2  = ntt.Transform(f_, true).Resize(f1.Length);

            if (result)
            {
                CollectionAssert.AreEqual(f1, f2);
            }
            else
            {
                CollectionAssert.AreNotEqual(f1, f2);
            }
        }
        public void Transform_NTT102()
        {
            var ntt = new NTT102(n, true);

            Test(f => ntt.Transform(f, false), f => ntt.Transform(f, true));
        }