Schönhage-strassen algorithm

Schönhage-strassen algorithm is a fast Fourier transform large integer multiplication algorithm published in 1971

Introduction :

Inspired with https://www.geeksforgeeks.org/java-program-to-implement-the-schonhage-strassen-algorithm-for-multiplication-of-two-numbers/

// Java program to implement Schonhage-Strassen's
import java.io.*;

class SchonhageStrassens {
	static int[] convolutionLineaire;
	static long a, b;
	static int longueur;

	static int compterDigits(long num)
	{
		int count = 0;
		while (num > 0) {
			num /= 10;
			count++;
		}
		return count;
	}

	static void schonhageStrassenMultiplication()
	{
		findconvolutionLineaire();
		performCarry();
	}


	static void findconvolutionLineaire()
	{
		int aDigits = compterDigits(a);
		int bDigits = compterDigits(b);
		long temp = a;
		longueur = aDigits + bDigits - 1;
		convolutionLineaire = new int[longueur];
		for (int i = 0; i < aDigits; i++, b /= 10) {
			a = temp;
			for (int j = 0; j < bDigits; j++, a /= 10) {
				convolutionLineaire[i + j]
					+= (b % 10) * (a % 10);
			}
		}
		System.out.print(« La convolution linéaire est  [ ");
		for (int i = longueur - 1; i >= 0; i--) {
			System.out.print(convolutionLineaire[i] + " ");
		}
		System.out.println("]");
	}

	static void performCarry()
	{
		long product = 0;
		int carry = 0, base = 1;
		for (int i = 0; i < longueur; i++) {
			convolutionLineaire[i] += carry;
			product
				= product
				+ (base * (convolutionLineaire[i] % 10));
			carry = convolutionLineaire[i] / 10;
			base *= 10;
		}
		System.out.println("\nLa multiplication est: " + product);
	}

	public static void main(String[] args)
	{
		a = 32455;
		b = 1432;
		schonhageStrassenMultiplication();
	}
}

Schönhage-strassen algorithm is a fast Fourier transform large integer multiplication algorithm with high efficiency. Convergence and Fourier transforms are available in C++ as well, which are built on top of the R.R framework. For these reasons Convergence:

Schönhage-strassen algorithm

Compute the final result from a series for a sum and compare it with the previous one. For all elements in a series equal to or greater than 2^e it gives the first true result. Saver:

Compare the sum of the two inputs against eachother using the sieve that allows the sum of the input and the next one against the last.

For any two points, combine two or more points to achieve a maximum result. Compare a series with two inputs: This technique yields a maximum result if both inputs are the same value. The output series from each of these two points has the same meaning. Saver in R uses all the possible factors.

Schönhage-strassen algorithm

Computing a final logarithm of an input sequence: A sum of two logarithms can be computed using multiple inputs.

Computing a logarithm of an input value: The input value is always positive (i.e. it has an output value of 1 if the input sequence has not been written); this value is then transformed into the final output value.

External links :

https://fr.wikipedia.org/wiki/Microsoft_Excel

https://fr.wikipedia.org/wiki/Microsoft_Office

Internal links– Schönhage-strassen algorithm

https://128mots.com/index.php/category/python/ https://128mots.com/index.php/2021/04/29/dataframe-to-csv-how-to-export-pandas-dataframe/embed/#?secret=Ja9rmsreAV https://128mots.com/index.php/2021/04/29/dataframe-to-csv-how-to-export-pandas-dataframe/ https://128mots.com/index.php/2021/05/14/who-can-deploy-a-blockchain-with-skale/embed/#?secret=SZmy8tSjqy https://128mots.com/index.php/2021/05/14/who-can-deploy-a-blockchain-with-skale/

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée.