[back] [prev] [next] [index] [root]
o := FLDin(name [, n]); o := FLDin(); o := FLDin(f [, n]);
file | f |
open for reading |
string | name |
filename |
order | o |
|
integer | b |
the number of fields to skip. If given, the number |
of fields is returned. |
kash> # Open a file for printing the output kash> outfile := Open("poly.tbl","w"); Filename: poly.tbl / Mode: w / Open (fid): 5 kash> # kash> p := 3; # start 3 kash> c := 3; # how many fields 3
kash> for j in [1..c] do > p:=NextPrime(p); > # > # Assign f and create the corresponding maximal order > # > f := Poly(Zx,[1,p,p,p]); > O := OrderMaximal(Order(f)); > # > # Compute the class group of o > # > clg := OrderClassGroup(O); > # > # check if the class group is trivial > # > if IsList(clg) then > Print ("field generated by ", f," has class number: ", clg[1],"\n"); > # print the field in the output file > FLDout(O, outfile); > fi; > od; field generated by x^3 + 5*x^2 + 5*x + 5 has class number: 1 field generated by x^3 + 7*x^2 + 7*x + 7 has class number: 3 field generated by x^3 + 11*x^2 + 11*x + 11 has class number: 6 kash> # closing the output file kash> Close(outfile); true
kash> # kash> # Open file for input. Use mode "R" (not "r") to loop kash> # over the whole file kash> # kash> infile := Open("poly.tbl", "R"); Filename: poly.tbl / Mode: R / Open (fid): 5 kash> # kash> # Read first order kash> o1 := FLDin(infile); F[1] | F[2] / / Q F [ 1] Given by transformation matrix F [ 2] x^3 + 5*x^2 + 5*x + 5 Discriminant: -200 Class Number 1 kash> OrderUnitsFund(o1); [ [0, 1, 2] ] kash> # kash> # Read second order kash> o2 := FLDin(infile); Generating polynomial: x^3 + 7*x^2 + 7*x + 7 Discriminant: -3724 Class Number 3 Class Group Structure C3 Cyclic Factors of the Class Group: <2, 2> kash> OrderUnitsFund(o2); [ [1, 1, 1] ] kash> # kash> # Read third order kash> o3 := FLDin(infile); Generating polynomial: x^3 + 11*x^2 + 11*x + 11 Discriminant: -28556 Class Number 6 Class Group Structure C6 Cyclic Factors of the Class Group: <10, 10> kash> OrderUnitsFund(o3); [ [1, 1, 1] ] kash> Close(infile); true
<- back[back] [prev] [next] [index] [root]