#!/usr/bin/env ruby
require("gsl")

poly = GSL::Poly.new([-1, 0, 0, 0, 0, 1])
#p.set([2, 4, 6])
#p p.size
poly.print
#p p.eval(2)
ans = poly.solve
p ans
#p GSL::Poly.solve_cubic(5, 2, -3)

poly2 = GSL::Poly.new([-1, 0, 0, 0, 0, 1])
w = GSL::Poly::Workspace.new(6)
p Poly.complex_solve([-1, 0, 0, 0, 0, 1], w)
p Poly.complex_solve([-1, 0, 0, 0, 0, 1])
p Poly.complex_solve(-1, 0, 0, 0, 0, 1, w)
p Poly.complex_solve(-1, 0, 0, 0, 0, 1)

p poly.solve(w)

dd = Poly.dd_init(poly, poly2)
p dd.class
p dd.taylor(1).class

__END__
