Rev 3265 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
!if $wims_read_parm!=slib_header
!goto proc
!endif
slib_title=Generates a random matrix
slib_parms=4\
2,number of rows\
2,number of columns\
2,coefficient range\
Z,coefficient ring: Z for the time being,Q,R,C,G (Gauss ring), n (n is an integer for Z/nZ)
slib_author=Gang Xiao
slib_out=the generated matrix
slib_example=3,2,5
!exit
:proc
!distribute items $wims_read_parm into slib_rows,slib_cols,slib_range,slib_ring
!default slib_ring=Z
!bound slib_rows between integer 1 and 30 default 2
!bound slib_cols between integer 1 and 30 default 2
!bound slib_range between integer 1 and 1000000 default 2
!if $slib_ring=Z
slib_ran1=(random(2*$slib_range+1)-$slib_range)
slib_out=!exec pari print(matrix($slib_rows,$slib_cols,x,y,$slib_ran1))
!exit
!endif