Rev 3333 | Rev 4158 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3333 | bpr | 1 | !if $wims_read_parm!=slib_header |
2 | !goto proc |
||
3 | !endif |
||
4 | slib_title=Insert a coefficient in a matrix |
||
5 | slib_parms=4\ |
||
3772 | bpr | 6 | ,matrix in wims form (inside brackets)\ |
7 | ,row\ |
||
8 | ,column\ |
||
9 | ,element to insert (no coma) |
||
3333 | bpr | 10 | |
11 | slib_author=Bernadette Perrin-Riou |
||
12 | slib_out=a new matrix with the element at the asked place |
||
13 | slib_comment=the place where to insert the element must be already fillout. |
||
14 | slib_example=[1,2;allo;mer],1,2,jeudi\ |
||
15 | [1,2;allo;],1,3,jeudi\ |
||
16 | [1,2;allo],4,3,jeudi |
||
17 | !exit |
||
18 | |||
19 | :proc |
||
20 | !distribute items $wims_read_parm into slib_matrix,slib_r,slib_c,slib_t |
||
21 | slib_matrix=!declosing $slib_matrix |
||
22 | |||
23 | slib_matrix1=!replace internal ; by $\ |
||
24 | $ in $slib_matrix |
||
25 | slib_cnt=!itemcnt $(slib_matrix[;1]) |
||
26 | !if $slib_r > $slib_cnt |
||
27 | !for slib_u=1 to $[$slib_r-$slib_cnt] |
||
28 | slib_matrix1=!append line vvvVVV to $slib_matrix1 |
||
29 | !next |
||
30 | !endif |
||
31 | slib_row=$(slib_matrix[$slib_r;]) |
||
32 | slib_row_cnt=!itemcnt $slib_row |
||
33 | !if $slib_c > $slib_row_cnt |
||
34 | slib_compl=!makelist vvvVVV for x = 1 to $[$slib_c-$slib_row_cnt] |
||
35 | slib_row=$slib_row,$slib_compl |
||
36 | !endif |
||
37 | |||
38 | slib_row=!replace internal item number $slib_c by $slib_t in $slib_row |
||
39 | slib_matrix1=!replace internal line number $slib_r by $slib_row in $slib_matrix1 |
||
40 | slib_matrix1=!replace internal vvvVVV by in $slib_matrix1 |
||
41 | slib_out=!lines2rows $slib_matrix1 |