<?xml version="1.0" encoding="utf-8" standalone="no"?><?xml-stylesheet href="/mathmlc2p.xsl" type="text/xsl"?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>trinks_sigbased_gb</title>
</head>
<body>
<tt>
#<br/>
# jython examples for jas.<br/>
# $Id: trinks_sigbased_gb.py 4986 2014-11-17 23:03:07Z kredel $<br/>
#<br/>
<br/>
from java.lang import System, Integer<br/>
<br/>
from jas import PolyRing, ZZ, QQ, ZM<br/>
from jas import terminate, startLog<br/>
<br/>
#from basic_sigbased_gb import sigbased_gb<br/>
#from basic_sigbased_gb import ggv, ggv_first_implementation<br/>
#from basic_sigbased_gb import coeff_free_sigbased_gb<br/>
#from basic_sigbased_gb import arris_algorithm, min_size_mons<br/>
#from basic_sigbased_gb import f5, f5z<br/>
<br/>
#from staggered_linear_basis import staglinbasis<br/>
<br/>
<br/>
#r = PolyRing( QQ(), &quot;(B,S,T,Z,P,W)&quot;, PolyRing.lex );<br/>
#r = PolyRing( ZZ(), &quot;(B,S,T,Z,P,W)&quot;, PolyRing.lex );<br/>
r = PolyRing( ZM(32003), &quot;(B,S,T,Z,P,W)&quot;, PolyRing.lex );<br/>
#r = PolyRing( ZM(19), &quot;(B,S,T,Z,P,W)&quot;, PolyRing.lex );<br/>
print &quot;Ring: &quot; + str(r);<br/>
print;<br/>
<br/>
[one,B,S,T,Z,P,W] = r.gens();<br/>
<br/>
p1 = 45 * P + 35 * S - 165 * B - 36;<br/>
p2 = 35 * P + 40 * Z + 25 * T - 27 * S;<br/>
p3 = 15 * W + 25 * S * P + 30 * Z - 18 * T - 165 * B**2;<br/>
p4 = -9 * W + 15 * T * P + 20 * S * Z;<br/>
p5 = P * W + 2 * T * Z - 11 * B**3;<br/>
p6 = 99 * W - 11 * B * S + 3 * B**2;<br/>
p7 = 10000 * B**2 + 6600 * B + 2673;<br/>
<br/>
F = [p1,p2,p3,p4,p5,p6,p7];<br/>
#F = [p1,p2,p3,p4,p5,p6];<br/>
<br/>
f = r.ideal( list=F );<br/>
print &quot;Ideal: &quot; + str(f);<br/>
print;<br/>
<br/>
#startLog();<br/>
<br/>
rg = f.GB();<br/>
rg = f.GB();<br/>
if not rg.isGB():<br/>
    print &quot;seq Output:&quot;, rg;<br/>
    print;<br/>
<br/>
#-------------------<br/>
<br/>
sbgb = sigbased_gb();<br/>
arri = arris_algorithm();<br/>
arrm = min_size_mons();<br/>
ggv  = ggv();<br/>
ggv1 = ggv_first_implementation();<br/>
f5  = f5();<br/>
ff5 = f5z();<br/>
<br/>
if True:<br/>
    gg = staglinbasis(F);<br/>
    gg = staglinbasis(F);<br/>
    t = System.currentTimeMillis();<br/>
    gg = staglinbasis(F);<br/>
    t = System.currentTimeMillis() - t;<br/>
    print &quot;stag executed in &quot; + str(t) + &quot; milliseconds&quot;;<br/>
    if not r.ideal(list=gg).isGB():<br/>
        print &quot;stag Output:&quot; + str([ str(ggg) for ggg in gg]);<br/>
    print;<br/>
<br/>
if True:<br/>
    gg = sbgb.basis_sig(F);<br/>
    t = System.currentTimeMillis();<br/>
    gg = sbgb.basis_sig(F);<br/>
    t = System.currentTimeMillis() - t;<br/>
    print &quot;sbgb executed in &quot; + str(t) + &quot; milliseconds&quot;;<br/>
    if not r.ideal(list=gg).isGB():<br/>
        print &quot;sbgb Output:&quot; + str([ str(ggg) for ggg in gg]);<br/>
    print;<br/>
<br/>
if True:<br/>
    gg = ff5.basis_sig(F);<br/>
    t = System.currentTimeMillis();<br/>
    gg = ff5.basis_sig(F);<br/>
    t = System.currentTimeMillis() - t;<br/>
    print &quot;f5   executed in &quot; + str(t) + &quot; milliseconds&quot;;<br/>
    if not r.ideal(list=gg).isGB():<br/>
        print &quot;f5   Output:&quot; + str([ str(ggg) for ggg in gg]);<br/>
    print;<br/>
<br/>
if True:<br/>
    gg = ggv1.basis_sig(F);<br/>
    t = System.currentTimeMillis();<br/>
    gg = ggv1.basis_sig(F);<br/>
    t = System.currentTimeMillis() - t;<br/>
    print &quot;ggv  executed in &quot; + str(t) + &quot; milliseconds&quot;;<br/>
    if not r.ideal(list=gg).isGB():<br/>
        print &quot;ggv  Output:&quot; + str([ str(ggg) for ggg in gg]);<br/>
    print;<br/>
<br/>
if True:<br/>
    gg = arri.basis_sig(F);<br/>
    t = System.currentTimeMillis();<br/>
    gg = arri.basis_sig(F);<br/>
    t = System.currentTimeMillis() - t;<br/>
    print &quot;arri executed in &quot; + str(t) + &quot; milliseconds&quot;;<br/>
    if not r.ideal(list=gg).isGB():<br/>
        print &quot;arri Output:&quot; + str([ str(ggg) for ggg in gg]);<br/>
    print;<br/>
<br/>
## Output: for Z_32003 and Trinks 7<br/>
## sequential GB executed in 44 ms<br/>
## stag executed in 99 milliseconds<br/>
## sbgb executed in 1180 milliseconds<br/>
## f5   executed in 128 milliseconds<br/>
## ggv  executed in 110 milliseconds<br/>
## arri executed in 116 milliseconds<br/>
<br/>
## Output: for Z_32003 and Trinks 6<br/>
## sequential GB executed in 302 ms<br/>
## stag executed in 213 milliseconds<br/>
## sbgb executed in 28849 milliseconds<br/>
## f5   executed in 1248 milliseconds<br/>
## ggv  executed in 237 milliseconds<br/>
## arri executed in 410 milliseconds<br/>
<br/>
## Output: for Q and Trinks 7<br/>
## sequential GB executed in 104 ms<br/>
## stag executed in 223 milliseconds<br/>
## sbgb executed in 1155 milliseconds<br/>
## f5   executed in 226 milliseconds<br/>
## ggv  executed in 98 milliseconds<br/>
## arri executed in 111 milliseconds<br/>
<br/>
## Output: for Q and Trinks 6<br/>
## sequential GB executed in 779 ms<br/>
## stag executed in 196 milliseconds<br/>
## sbgb executed in 740980 milliseconds<br/>
## f5   executed in 1435 milliseconds<br/>
## ggv  executed in 717 milliseconds<br/>
## arri executed in 562 milliseconds<br/>
</tt>
</body>
</html>
