#
# jruby examples for jas.
# $Id: katsura.rb 3794 2011-10-09 17:39:11Z kredel $

require "examples/jas"

include_class "edu.jas.gb.Katsura";

# katsura examples

knum = 4
tnum = 2;

#r = Ring( "Mod 19 (B,S,T,Z,P,W) L" );
#r = Ring( "Mod 1152921504606846883 (B,S,T,Z,P,W) L" ); # 2^60-93
#r = Ring( "Quat(B,S,T,Z,P,W) L" );
#r = Ring( "Z(B,S,T,Z,P,W) L" );
#r = Ring( "C(B,S,T,Z,P,W) L" );
#r = Ring( "Rat(B,S,T,Z,P,W) L" );
#puts "Ring: " + str(r);
#puts;

k = Katsura.new(knum);
r = Ring.new( k.varList("Rat","G") );
#r = Ring.new( k.varList("Mod 19","G") );
#r = Ring.new( k.varList("Mod 32003","G") );
#no?#r = Ring.new( k.varList("Mod 1152921504606846883","G") );
puts "Ring: " + str(r);
puts;

ps = k.polyList();

f = r.ideal( ps );
puts "Ideal: " + str(f);
puts;

#puts "Range: " + Range.new(tnum,2,-1).to_s;
#puts "Range: " + (tnum...2).to_s;
#puts;

rg = f.parGB(tnum);
for th in tnum.downto(2) do 
   rg = f.parGB(th);
   #puts "par(#{th}) Output:" + rg.to_s;
   #puts;
end

rg = f.GB();
#puts "seq Output:", rg;
puts;


# rg = f.distGB(2);
#puts "dist Output:", rg;
#puts;

#f.distClient();


