@Test public void testInverseTransform() { int[] actual = SmallNumberTheoreticTransform.inverseTransform( new int[]{3, 7, 0, 5, 4}, 3, 11); int[] expect = {6, 0, 10, 7, 2}; assertArrayEquals(expect, actual); }
public static int[] inverseTransform(int[] invec, int root, int mod) { int[] outvec = transform(invec, reciprocal(root, mod), mod); int scaler = reciprocal(invec.length, mod); for (int i = 0; i < outvec.length; i++) outvec[i] = (int)((long)outvec[i] * scaler % mod); return outvec; }
SmallNumberTheoreticTransform { public static int[] inverseTransform(int[] invec, int root, int mod) { int[] outvec = transform(invec, reciprocal(root, mod), mod); int scaler = reciprocal(invec.length, mod); for (int i = 0; i < outvec.length; i++) outvec[i] = (int)((long)outvec[i] * scaler % mod); return outvec; } }
SmallNumberTheoreticTransform { public static int[] inverseTransform(int[] invec, int root, int mod) { int[] outvec = transform(invec, reciprocal(root, mod), mod); int scaler = reciprocal(invec.length, mod); for (int i = 0; i < outvec.length; i++) outvec[i] = (int)((long)outvec[i] * scaler % mod); return outvec; }  }
SmallNumberTheoreticTransform { public static int[] inverseTransform(int[] invec, int root, int mod) { int[] outvec = transform(invec, reciprocal(root, mod), mod); int scaler = reciprocal(invec.length, mod); for (int i = 0; i < outvec.length; i++) outvec[i] = (int)((long)outvec[i] * scaler % mod); return outvec; }  static int[] transform(int[] invec, int root, int mod); static int[] inverseTransform(int[] invec, int root, int mod); static void transformRadix2(int[] vector, int root, int mod); static int[] circularConvolve(int[] vec0, int[] vec1); static int findModulus(int vecLen, int minimum); static int findGenerator(int totient, int mod); static int findPrimitiveRoot(int degree, int totient, int mod); static boolean isGenerator(int val, int totient, int mod); static boolean isPrimitiveRoot(int val, int degree, int mod); static int reciprocal(int n, int mod); static List<Integer> uniquePrimeFactors(int n); static boolean isPrime(int n); static int pow(int x, int y, int mod); static int sqrt(int x); }
SmallNumberTheoreticTransform { public static int[] inverseTransform(int[] invec, int root, int mod) { int[] outvec = transform(invec, reciprocal(root, mod), mod); int scaler = reciprocal(invec.length, mod); for (int i = 0; i < outvec.length; i++) outvec[i] = (int)((long)outvec[i] * scaler % mod); return outvec; }  static int[] transform(int[] invec, int root, int mod); static int[] inverseTransform(int[] invec, int root, int mod); static void transformRadix2(int[] vector, int root, int mod); static int[] circularConvolve(int[] vec0, int[] vec1); static int findModulus(int vecLen, int minimum); static int findGenerator(int totient, int mod); static int findPrimitiveRoot(int degree, int totient, int mod); static boolean isGenerator(int val, int totient, int mod); static boolean isPrimitiveRoot(int val, int degree, int mod); static int reciprocal(int n, int mod); static List<Integer> uniquePrimeFactors(int n); static boolean isPrime(int n); static int pow(int x, int y, int mod); static int sqrt(int x);  }