Rev 3265 | Go to most recent revision | Details | 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 with non-zero coefficients |
||
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,6,5 |
||
13 | !exit |
||
14 | |||
15 | :proc |
||
16 | !distribute items $wims_read_parm into slib_rows,slib_cols,slib_range,slib_ring |
||
17 | |||
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($slib_range)+1)*(2*random(2)-1) |
||
25 | slib_out=!exec pari print(matrix($slib_rows,$slib_cols,x,y,$slib_ran1)) |
||
26 | !exit |
||
27 | !endif |
||
28 |