Subversion Repositories wimsdev

Rev

Rev 4349 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!if $wims_read_parm!=slib_header
13585 bpr 2
  !goto proc
20 reyssat 3
!endif
4349 bpr 4
slib_author=Gang, XIAO
4158 bpr 5
 
20 reyssat 6
slib_example=4,2,5,random\
7
4,2,5,u\
8
4,2,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 u,d
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
13585 bpr 25
  slib_ran1=(random(2*$slib_range+1)-$slib_range)
20 reyssat 26
!endif
27
 
28
!if $slib_o=u
13585 bpr 29
  slib_comp=x>y
20 reyssat 30
!else
13585 bpr 31
  slib_comp=x<y
20 reyssat 32
!endif
33
 
34
slib_coef=if($slib_comp,0,$slib_ran1)
35
slib_out=!exec pari print(matrix($slib_rows,$slib_cols,x,y,$slib_coef))