Subversion Repositories wimsdev

Rev

Rev 4158 | Rev 7692 | 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=4,6,5,random\
7
4,6,5,u\
8
4,6,5,d
3265 bpr 9
slib_require=pari
20 reyssat 10
!exit
11
 
12
:proc
13
!distribute items $wims_read_parm into slib_rows,slib_cols,slib_range,slib_o,slib_ring
14
slib_o=!lower $slib_o
15
slib_o=!nospace $slib_o
16
slib_o=!char 1 of $slib_o
17
slib_r=!randitem d,u
18
!bound slib_o within d,u default $slib_r
19
!default slib_ring=Z
20
!bound slib_rows between integer 1 and 30 default 2
21
!bound slib_cols between integer 1 and 30 default 2
22
!bound slib_range between integer 1 and 1000000 default 2
23
 
24
!if $slib_ring=Z
25
 slib_ran1=(random(2*$slib_range+1)-$slib_range)
26
 slib_ran2=(random($slib_range)+1)*(2*random(2)-1)
27
!endif
28
 
29
!if $slib_o=u
30
 slib_comp=x>y
31
!else
32
 slib_comp=x<y
33
!endif
34
 
35
slib_coef=if(x==y,$slib_ran2,if($slib_comp,0,$slib_ran1))
36
slib_out=!exec pari print(matrix($slib_rows,$slib_cols,x,y,$slib_coef))
37