Rev 4349 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !if $wims_read_parm!=slib_header |
2 | !goto proc |
||
3 | !endif |
||
4349 | bpr | 4 | slib_author=Gang, XIAO |
4158 | bpr | 5 | |
20 | reyssat | 6 | slib_example= 3,6 |
3265 | bpr | 7 | slib_require=pari |
20 | reyssat | 8 | !exit |
9 | |||
10 | :proc |
||
11 | !distribute items $wims_read_parm into slib_size,slib_range,slib_ring |
||
12 | !default slib_ring=Z |
||
13 | !bound slib_size between integer 2 and 20 default 2 |
||
14 | !bound slib_range between integer 1 and 1000000 default 2 |
||
15 | |||
16 | !if $slib_ring=Z |
||
17 | slib_sh1=!shuffle $slib_size |
||
18 | slib_sh2=!shuffle $slib_size |
||
19 | slib_ran1=(random(2*$slib_range)*(2*random(2)-1)) |
||
20 | slib_ran2=(random($slib_range)*(4*random(2)-2)) |
||
21 | slib_ran3=(random($slib_range)*(4*random(2)-2)+2*random(2)-1) |
||
22 | slib_coef=if(x==y,$slib_ran3,if(x>y,$slib_ran2,$slib_ran1)) |
||
23 | slib_M1=vecextract(matrix($slib_size,$slib_size,x,y,$slib_coef),[$slib_sh1],[$slib_sh2]) |
||
24 | slib_M2=matrix($slib_size,$slib_size,x,y,$slib_ran1) |
||
25 | slib_out=!exec pari M2=$slib_M2;if(matdet(M2)<>0,print(M2),print($slib_M1)) |
||
26 | !exit |
||
27 | !endif |