File: primary-decomp.rb

package info (click to toggle)
jas 2.7.200-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,732 kB
  • sloc: java: 164,370; python: 14,882; ruby: 14,509; xml: 583; makefile: 545; sh: 349
file content (50 lines) | stat: -rw-r--r-- 802 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#
# jruby examples for jas.
# $Id$
#

require "examples/jas"

# polynomial examples: ideal primary decomposition in char 0

r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex);
puts "Ring: " + str(r);
puts;

#automatic: one,x,y,z = r.gens();
puts one,x,y,z;

#exit();

f1 = (x**2 - 2)**2;
f2 = (y**2 - x)**2;
f3 = (z**2 - x); 

puts "f1 = " + str(f1);
puts "f2 = " + str(f2);
puts "f3 = " + str(f3);
#puts "f4 = " + str(f4);
puts;

F = r.ideal( "", list=[f1,f2,f3] );
#F = r.ideal( "", list=[f1,f3] );
#F = r.ideal( "", list=[f2,f3] );

puts "F = " + str(F);
puts;

startLog();

t = System.currentTimeMillis();
P = F.primaryDecomp();
t = System.currentTimeMillis() - t;
puts "P = " + str(P);
puts;
puts "decomp time = " + str(t) + " milliseconds";
puts;

puts "F = " + str(F);
puts;

#startLog();
terminate();