SttopARI.TXT*Perl脚本,用于从STD格式转换为PARI格式,以获得关于格子数据库的信息,请参见:索引文件缩写我们建议你下载这个文件,把它复制到一个名为StdopaRier.Perl的新文件中,然后删除所有的行,包括“剪切1”,在这里删除“剪切2”一行,然后在它之后的所有内容,o使文件可执行。/Ur/bin/Perl·StdoprAR.Perl perl脚本,以从标准库文件中创建GRAM矩阵的可读版本,最后修改FEB 32 1997(如果$ARGV)!= 0){{死亡〉用法:STDopaRial.Pell Fiel.STD> OUT,然后启动GP,然后键入\ReOUT“}”检查文件名结束。$AGV(0)=~/\.STD $/){“死亡”文件名不以.STD结尾。}检查文件是否存在(如果)!-F$ARGV〔0〕{骰子“$ARVV〔0〕不存在!”{开式格子文件(1美元)〉开式(格子,$AGV〔0〕);(0)=中性,1种方法刚读“^ %g”,“2”表示读取Gram矩阵“$”状态=“0”;②设置空格表以保存克矩阵“@列表”=();) { chop; # delete newline at end $_ =~ s/^ *//; # delete leading blanks @line = split; # break up into a list if ( $#line < 0 ) {next } # skip if empty line if ($line[0] =~ /^%/) { $state = "0" } #reset state to 0 if find % if ($line[0] =~ /^%GRAM$/) { # look for line beginning %GRAM $state = "1"; # sets state to 1, getting ready # for reading dimensions on next line next; } if ($state =~ "1") { $d1 = $line[0]; # state = 1, # so read dimensions of array $d2 = $line[1]; $state = "2"; # and set state to 2 next; } if ($state =~ "2" && $line[0] !~ /^%/) { # reading Gram matrix $t1 = $#line; # get no of entries on the current line # add then to gram matrix push( @gramlist, @line) } } # print in PARI format, calling the gram matrix "m" # print LHS print("m=[\\\n"); ### case 1, Gram matrix given in square form: if ( $d1 == $d2 ) # square Gram matrix { # start bracket 1 $at = 0; # print row i (but not the last one) for ($i = 0; $i < $d1 - 1; $i = $i + 1) { # print element j (but not the last one) for ($j = 0; $j < $d1 - 1; $j = $j + 1) { print($gramlist[$at],",\\\n"); $at = $at + 1; }; # print last elt in row print($gramlist[$at],";\\\n"); $at = $at + 1; } # print last row $i = $d1 - 1; # print element j (but not the last one) for ($j = 0; $j < $d1 - 1; $j = $j + 1) { print($gramlist[$at],",\\\n"); $at = $at + 1; }; # print last elt in row print($gramlist[$at],"];\n");{ }端括号1×2,以三角形式给出的革兰氏矩阵{{起始括号2〉打印行i($i=0;$i<$d1;$i=$i+1){列列列列列列j j=0)。打印($GracList[$at),\\n n);(a)在逗号后面,除非在行的末尾,如果行的末尾,打印“;”或“];(如果$j<d1-1){打印(“\\\n”);} elsif($i<d1-1){打印(“;\\n”);} {打印(“”;\n));} }打印元素j=i+1。i为($j=0;$j <=$i;$j= $j+ 1){$$ AT=$i *($i + 1)/ 2 +$J$d1-1 for ($j = $i + 1; $j < $d1 ; $j = $j + 1) { $at = $j * ($j + 1)/2 + $i; print($gramlist[$at],"\\\n"); # follow it by a comma unless at end of line # if at end of row, print ";" or "];" if ($j < $d1 - 1 ) {print(",\\\n"); } elsif ($i < $d1 - 1) {print(";\\\n");} else {print("];\n");} }; }; } # end bracket 2 # produce print statements for PARI to say what to do next # template is: # print("pprint(\"\\\\hi\")\n"); print("pprint(\"\\\\Now do:\")\n"); print("pprint(\"\\\\d=det2(m) to get det\")\n"); ---------- cut 2 here -------