source: git/Tst/Short/libehv_s.tst @ 197c4e

spielwiese
Last change on this file since 197c4e was 75f460, checked in by Hans Schoenemann <hannes@…>, 9 years ago
format
  • Property mode set to 100644
File size: 1.5 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4LIB("ehv.lib");
5
6proc testRemoveReduntandComponents()
7{
8  ring rng = 0,(x,y),dp;
9  def L1 = list(list(std(ideal(x-1)),ideal(x-1)),list(std(ideal(x-1)),ideal(x-1)),list(std(ideal(y-2)),ideal(y-2)));
10  def L2 = list(list(std(ideal(x-1)),ideal(x-1)),list(std(ideal(y-2)),ideal(y-2)));
11  def LL1 = removeRedundantComponents(L1);
12  ASSUME(0, size(LL1)==2);
13  ASSUME(0, primDecsAreEquivalent( L1, L2 ) );
14
15  system("random", 1401092447);
16  ring rng2 = 23,(x, y, z), dp;
17  ideal I = 9*x*y^2-11*x*z^2, 11*x*y*z^2+4*x^2*z, -3*y^5+x*z-10*y*z;
18
19  list L1,L2, LL1;
20
21  def RI = std(radical(I));
22
23  L1 = primdecGTZ(RI);
24  L2 = primdecGTZ(RI);
25  LL1 = removeRedundantComponents(L1);
26  ASSUME(0, size(LL1)==6);
27  ASSUME(0, primDecsAreEquivalent( LL1, L1) );
28  ASSUME(0, primDecsAreEquivalent( L1 , L2 ) );
29}
30
31proc testPrimDecsAreEquivalent()
32{
33    ring rng = 0 ,x,dp;
34    list L1, L2;
35
36    // test1. different sizes
37    L1[1] = list( ideal(0), ideal(0)  );
38    ASSUME(0, 0 == primDecsAreEquivalent(L1,L2) );
39    // test2. same size, but different content
40    L2[1] = list( ideal(1), ideal(1)  );
41
42    ASSUME(0, 0 == primDecsAreEquivalent(L1,L2) );
43
44    // test3. equivalent content
45    L1[1] = list( ideal(0), ideal(0)  );
46    L1[2] = list( ideal(x), ideal(x)  );
47    L2[1] = list( ideal(x), ideal(x)  );
48    L2[2] = list( ideal(0), ideal(0)  );
49    ASSUME(0, 1 == primDecsAreEquivalent(L1,L2) );
50
51
52
53}
54
55testRemoveReduntandComponents();
56testPrimDecsAreEquivalent();
57
58tst_status(1); $;
59
Note: See TracBrowser for help on using the repository browser.