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 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 |
||
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 | |||
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 |
||
25 | slib_ran1=(random($slib_range)+1)*(2*random(2)-1) |
||
26 | slib_out=!exec pari print(matrix($slib_rows,$slib_cols,x,y,$slib_ran1)) |
||
27 | !exit |
||
28 | !endif |
||
29 |