File: intersect.py

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 (59 lines) | stat: -rw-r--r-- 684 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
51
52
53
54
55
56
57
58
59
#
# jython examples for jas.
# $Id$
#

import sys;

from jas import Ring, PolyRing, QQ
from jas import startLog, terminate


# ideal intersection example

#r = Ring( "Rat(x,y,z) L" );
r = PolyRing( QQ(), "(x,y,z)", PolyRing.lex );
print "Ring: " + str(r);
print;

ps1 = """
(
 ( x - 1 ),
 ( y - 1 ),
 ( z - 1 )
)
""";

ps2 = """
(
 ( x - 2 ),
 ( y - 3 ),
 ( z - 3 )
)
""";

F1 = r.ideal( ps1 );
#print "Ideal: " + str(F1);
#print;

F2 = r.ideal( ps2 );
#print "Ideal: " + str(F2);
#print;

#startLog();

rg1 = F1.GB();
print "rg1 = ", rg1;
print;

rg2 = F2.GB();
print "rg2 = ", rg2;
print;

#startLog();

ig = F1.intersect(F2);
print "rg1 intersect rg2 = ", ig;
print;

terminate();