diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2006-09-01 06:37:35 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2006-09-01 06:37:35 +0000 |
commit | eca7acd6b06cb0f4f5d2262fd1f43fdda77fca6e (patch) | |
tree | 007ff11255a18641cd149c995772d7ebf2dacafc /abs | |
parent | 562e333d2dd3ee41bd5791c2a03b321b42e4149c (diff) |
inversion with pivoting (more stable)
svn path=/trunk/externals/iem/iemmatrix/; revision=5815
Diffstat (limited to 'abs')
-rw-r--r-- | abs/mtx_pinverse-help.pd | 51 | ||||
-rw-r--r-- | abs/mtx_pinverse.pd | 30 |
2 files changed, 81 insertions, 0 deletions
diff --git a/abs/mtx_pinverse-help.pd b/abs/mtx_pinverse-help.pd new file mode 100644 index 0000000..158e908 --- /dev/null +++ b/abs/mtx_pinverse-help.pd @@ -0,0 +1,51 @@ +#N canvas 366 49 705 646 10; +#X text 347 472 updated for; +#X obj 435 472 iemmatrix 0.2; +#X obj 484 498 matrix; +#X text 354 497 see also help for; +#X text 243 142 singular; +#X text 245 107 regular; +#X text 246 158 regular; +#X text 247 168 but badly conditioned; +#X text 154 533 A*inv(A)=inv(A)*A=I; +#X text 248 221 pseudoinverse: P1=inv(A'*A)*A'; +#X text 247 269 pseudoinverse: P2=A'*inv(A*A'); +#X text 245 553 P1*A=I; +#X text 245 573 A*P2=I; +#X obj 92 199 mtx 3; +#X msg 112 164 1 2 3 2 4 4 3 4 5; +#X msg 92 108 1 2 4 2 3 4 3 4 5; +#X obj 92 472 mtx_print inverse; +#X obj 92 300 t a a; +#X obj 134 300 mtx_print original; +#X obj 153 219 mtx_rand 4 3; +#X msg 153 198 bang; +#X msg 153 248 bang; +#X obj 153 269 mtx_rand 3 4; +#X obj 182 348 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 199 359 instability detected!; +#X obj 92 348 mtx_pinverse; +#X text 45 16 mtx_pinverse:: get the inverse of a matrix (with pivoting) +; +#X text 44 49 mtx_pinverse calculates the inverse of a square-matrix. +For inverting rectangle matrices \, use [mtx_inverse] or [mtx_pseudoinverse] +; +#X msg 103 140 1 2 3 2 3 4 0 0 0; +#X text 194 385 due to pivoting \, [mtx_pinverse] will handle badly +conditioned matrices better than [mtx_inverse] \, however it will also +detect less (real) instabilities than [mtx_inverse]; +#X obj 485 524 mtx_inverse; +#X obj 485 548 mtx_pseudoinverse; +#X connect 13 0 17 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X connect 17 0 25 0; +#X connect 17 1 18 0; +#X connect 19 0 17 0; +#X connect 20 0 19 0; +#X connect 21 0 22 0; +#X connect 22 0 17 0; +#X connect 25 0 16 0; +#X connect 25 1 23 0; +#X connect 28 0 13 0; diff --git a/abs/mtx_pinverse.pd b/abs/mtx_pinverse.pd new file mode 100644 index 0000000..810e865 --- /dev/null +++ b/abs/mtx_pinverse.pd @@ -0,0 +1,30 @@ +#N canvas 0 0 630 350 10; +#X obj 44 102 inlet; +#X obj 44 132 mtx_pivot; +#X obj 44 154 mtx_inverse; +#X obj 74 200 mtx_*; +#X obj 44 221 mtx_*; +#X obj 44 198 mtx; +#X obj 44 176 t b a; +#X obj 44 264 outlet; +#X obj 116 264 outlet; +#X text 109 22 matrix inversion with pivoting; +#X text 107 56 pivoting makes the inversion of badly conditioned matrices +more stable.; +#X text 158 105 it also stabilizes the inversion of singular matrices +(not so good) and is more expensive; +#X text 188 202 for license-details see LICENSE.txt that must come +with iemmatrix.; +#X text 188 181 (c) 2006 by IOhannes m zmoelnig \, IEM KUG \, graz +austria; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 3 1; +#X connect 1 2 5 1; +#X connect 2 0 6 0; +#X connect 2 1 8 0; +#X connect 3 0 4 1; +#X connect 4 0 7 0; +#X connect 5 0 4 0; +#X connect 6 0 5 0; +#X connect 6 1 3 0; |