Subversion Repositories wimsdev

Rev

Rev 20 | Rev 4158 | 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
4
slib_title=Generates a random matrix
5
slib_parms=4\
6
2,number of rows\
7
2,number of columns\
8
2,coefficient range\
9
Z,coefficient ring: Z for the time being,Q,R,C,G (Gauss ring), n (n is an integer for Z/nZ)
10
slib_author=Gang Xiao
11
slib_out=the generated matrix
12
slib_example=3,2,5
3265 bpr 13
slib_require=pari
20 reyssat 14
!exit
15
 
16
:proc
17
!distribute items $wims_read_parm into slib_rows,slib_cols,slib_range,slib_ring
18
!default slib_ring=Z
19
!bound slib_rows between integer 1 and 30 default 2
20
!bound slib_cols between integer 1 and 30 default 2
21
!bound slib_range between integer 1 and 1000000 default 2
22
 
23
!if $slib_ring=Z
24
 slib_ran1=(random(2*$slib_range+1)-$slib_range)
25
 slib_out=!exec pari print(matrix($slib_rows,$slib_cols,x,y,$slib_ran1))
26
 !exit
27
!endif
28