root/trunk/jps2ps/pps/addm.pps
| Revision 4, 400 bytes (checked in by jms, 8 months ago) |
|---|
| Line | |
|---|---|
| 1 | |
| 2 | %% syntaxe : A B addm --> A+B (nouvelle matrice) |
| 3 | /addm { |
| 4 | 9 dict begin |
| 5 | /B exch def |
| 6 | /A exch def |
| 7 | %% B dimmatrix /n' exch def /m' exch def |
| 8 | A dimmatrix /n exch def /m exch def |
| 9 | /M m n newmatrix def |
| 10 | /i 0 def |
| 11 | m { |
| 12 | /j 0 def |
| 13 | n { |
| 14 | M i j |
| 15 | A i j get_ij B i j get_ij add |
| 16 | put_ij |
| 17 | /j j 1 add store |
| 18 | } repeat |
| 19 | /i i 1 add store |
| 20 | } repeat |
| 21 | M |
| 22 | end |
| 23 | } def |
Note: See TracBrowser for help on using the browser.
