This directory contains benchmarks for the two algorithms used by Factorization command, and the three algorithms implemented in qPoly for computing the quaternionic resultant.

To run the two benchmarks type execute the script run_benchmarks.sh. It will execute both benchmarks and produce to CSV (comma separetd values) files with the timing of the  algorithms in distinct columns. 

The factorization benchmark produces a CSV file with the following columns:
 - num. of factors - number of irreducible divisors of the center-free polynomial 
                     being factored
 - orig. time - the average time of the original algorithm described in [K] 
                (executed when the parameter Nice is False)
 - new time - the average time of the improved algorithm (called when Nice is
              set to True)
The file factorization_benchmark.magma can be customized by changing the constants at the top of the file
  NUM_OF_POLYS  - the number of tests executed for each number of factors
  MIN_DEGREE, MAX_DEGREE - bounds for the degrees of factors
  MIN_FACTORS, MAX_FACTORS, STEP_FACTORS - the tests are executed for NUM_OF_POLYS
        polynomials each with n factors, where n goes from MIN_FACTORS to MAX_FACTORS
        with step STEP_FACTORS
  SIZE 0 bound for the sizes of coefficients
  
The resultant_benchamrk.magma for each *sums* of degrees, which varies from MIN_DEGREE to MAX_DEGREE with step STEP_DEGREE, generates NUM_OF_POLYS pairs of random quaternionic polynomials. It then computes the resultants for each pair and outputs the average computation times for the three algorithms for each sum of degree. It outputs a CSV file with the following four columns:
 - d - sum of the degrees of two polynomials,
 - Sylvester - total time of computing the resultants using Sylvester matrices,
 - companion - total time of computing the resultants using companion matrices,
 - Euclid - total time of computing the resultants using Euclidean algorithm.

The resultant_benchamrk.magma can be customized in the same way as factorization_benchmark.
 
 
References:
[K] Koprowski, Przemysław. Factorization and root-finding for polynomials over division quaternion algebras. Proceedings of the International Symposium on Symbolic & Algebraic Computation (ISSAC 2023), 417--424, ACM, New York
