Sha256: 520701c8f405bb5c3a0e867ba96e09898813ef95646e2a875300a2a1432c7f81

Contents?: true

Size: 524 Bytes

Versions: 3

Compression:

Stored size: 524 Bytes

Contents

require "congruence_solver"
require "benchmark"
require_relative "./bench_tools.rb"

COEFFS = [-11, 0, 1, 3, 0, 5, 4, 180, 0, 10]
COMPOSITE_MOD = 4837012493
PRIME_MOD = 57081391

def bm_solve_congruence(coeffs, mod)
    puts "Solving #{polynomial_to_s(coeffs)} = 0 mod #{mod}"
    puts "Measurements:"
    Benchmark.bmbm do |bm|
      bm.report("C/lifting") do
        CongruenceSolver.lift(coeffs, mod)
      end
    end
    print "\n\n"
end

bm_solve_congruence(COEFFS,COMPOSITE_MOD)
bm_solve_congruence(COEFFS,PRIME_MOD)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
congruence_solver-0.5.2 bench/solve_congruence_bm.rb
congruence_solver-0.5.1 bench/solve_congruence_bm.rb
congruence_solver-0.5.0 bench/solve_congruence_bm.rb