test/Tools/isac/Knowledge/gcd_poly_ml.sml
changeset 60354 716dd4a05cc8
parent 60353 a186d46f9917
child 60507 b125dcf14489
equal deleted inserted replaced
60353:a186d46f9917 60354:716dd4a05cc8
    21 "----------- fun next_prime_not_dvd ---------------------";
    21 "----------- fun next_prime_not_dvd ---------------------";
    22 "----------- fun lcoeff_up ------------------------------";
    22 "----------- fun lcoeff_up ------------------------------";
    23 "----------- fun deg_up ---------------------------------";
    23 "----------- fun deg_up ---------------------------------";
    24 "----------- fun drop_lc0_up ----------------------------";
    24 "----------- fun drop_lc0_up ----------------------------";
    25 "----------- fun normalise ------------------------------";
    25 "----------- fun normalise ------------------------------";
    26 (* order until here: (GCD_Poly_FP =) GCD_Poly = gcd_poly *)
    26 (* order until here: (GCD_Poly_FP =) GCD_Poly_OLD = gcd_poly *)
    27 "----------- fun %* -------------------------------------";
    27 "----------- fun %* -------------------------------------";
    28 "----------- fun %/ -------------------------------------";
    28 "----------- fun %/ -------------------------------------";
    29 "----------- fun %-% ------------------------------------";
    29 "----------- fun %-% ------------------------------------";
    30 "----------- fun %|% ------------------------------------";
    30 "----------- fun %|% ------------------------------------";
    31 (*"----------- fun %+% ------------------------------------";*)
    31 (*"----------- fun %+% ------------------------------------";*)
   996 val (n (* = 162*), 
   996 val (n (* = 162*), 
   997      q (* = [29, ~33, ~18, 54]*), 
   997      q (* = [29, ~33, ~18, 54]*), 
   998      r (* = [317, 295]*)) = p1 %*/% p2;
   998      r (* = [317, 295]*)) = p1 %*/% p2;
   999 if (p1 %* n) = ((q %*% p2) %+% r) then () else error "fun %*/% changed 1";
   999 if (p1 %* n) = ((q %*% p2) %+% r) then () else error "fun %*/% changed 1";
  1000 
  1000 
  1001 (* demo in GCD_Poly *)
  1001 (* demo in GCD_Poly_OLD *)
  1002 val p1 = [2, 2, 2, 2, 2];
  1002 val p1 = [2, 2, 2, 2, 2];
  1003 val p2 = [1, 2, 3];
  1003 val p2 = [1, 2, 3];
  1004 val (n (* = 27*), 
  1004 val (n (* = 27*), 
  1005      q (* = [8, 6, 18]*), 
  1005      q (* = [8, 6, 18]*), 
  1006      r (* = [46, 32]*)) = p1 %*/% p2;
  1006      r (* = [46, 32]*)) = p1 %*/% p2;