Subversion Repositories wimsdev

Rev

Rev 4349 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4349 Rev 13585
Line 1... Line 1...
1
!if $wims_read_parm!=slib_header
1
!if $wims_read_parm!=slib_header
2
 !goto proc
2
  !goto proc
3
!endif
3
!endif
4
 
4
 
5
slib_author=Gang, XIAO
5
slib_author=Gang, XIAO
6
 
6
 
7
slib_example=3, 5
7
slib_example=3, 5
Line 13... Line 13...
13
!default slib_ring=Z
13
!default slib_ring=Z
14
!bound slib_size between integer 2 and 20 default 2
14
!bound slib_size between integer 2 and 20 default 2
15
!bound slib_range between integer 1 and 1000000 default 2
15
!bound slib_range between integer 1 and 1000000 default 2
16
 
16
 
17
!if $slib_ring=Z
17
!if $slib_ring=Z
18
 slib_sh1=!shuffle $slib_size
18
  slib_sh1=!shuffle $slib_size
19
 slib_sh2=!shuffle $slib_size
19
  slib_sh2=!shuffle $slib_size
20
 slib_ran1=(random($slib_range)*(2*random(2)-1))
20
  slib_ran1=(random($slib_range)*(2*random(2)-1))
21
 slib_ran2=(2*random(2)-1)
21
  slib_ran2=(2*random(2)-1)
22
 slib_coefu=if(x==y,$slib_ran2,if(x>y,0,$slib_ran1))
22
  slib_coefu=if(x==y,$slib_ran2,if(x>y,0,$slib_ran1))
23
 slib_coefd=if(x==y,$slib_ran2,if(x<y,0,$slib_ran1))
23
  slib_coefd=if(x==y,$slib_ran2,if(x<y,0,$slib_ran1))
24
 slib_triu=matrix($slib_size,$slib_size,x,y,$slib_coefu)
24
  slib_triu=matrix($slib_size,$slib_size,x,y,$slib_coefu)
25
 slib_trid=vecextract(matrix($slib_size,$slib_size,x,y,$slib_coefd),[$slib_sh1],[$slib_sh2])
25
  slib_trid=vecextract(matrix($slib_size,$slib_size,x,y,$slib_coefd),[$slib_sh1],[$slib_sh2])
26
 slib_out=!exec pari print($slib_triu*$slib_trid)
26
  slib_out=!exec pari print($slib_triu*$slib_trid)
27
 !exit
27
  !exit
28
!endif
28
!endif
29
 
29