aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-05-10 10:50:40 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2005-05-10 10:50:40 +0000
commit34d0baaee68b924cd6ece00ce7610d57c770993b (patch)
treeae136932ec744a41d80ee1f7832dd014be7973ea
parentac0c9b4402496a7a211552a2656fe4d628c905bf (diff)
improved version that can also handle non-square matrices
known bug: if #rows<#cols the pivoting matrix is uncorrectly resized, leading to zeroing out entire rows (which is plain wrong) svn path=/trunk/externals/iem/iemmatrix/; revision=2934
-rw-r--r--abs/mtx_spivot.pd79
1 files changed, 60 insertions, 19 deletions
diff --git a/abs/mtx_spivot.pd b/abs/mtx_spivot.pd
index a7d243b..6bd873a 100644
--- a/abs/mtx_spivot.pd
+++ b/abs/mtx_spivot.pd
@@ -1,23 +1,64 @@
-#N canvas 254 220 462 354 10;
-#X obj 154 166 t b a;
-#X obj 154 187 mtx;
-#X obj 154 208 mtx_*;
+#N canvas 835 313 564 462 10;
+#X obj 154 247 mtx;
+#X obj 154 338 mtx_*;
#X obj 115 78 inlet;
-#X obj 154 290 outlet;
-#X obj 230 291 outlet;
#X obj 115 115 t a a;
-#X obj 154 268 mtx_*;
-#X obj 154 238 t a a;
+#X obj 154 398 mtx_*;
+#X obj 154 368 t a a;
#X obj 115 144 mtx_pivot \$1;
-#X connect 0 0 1 0;
-#X connect 0 1 2 1;
-#X connect 1 0 2 0;
-#X connect 2 0 8 0;
+#X obj 154 420 outlet pivoted;
+#X obj 260 421 outlet pivoter;
+#X obj 154 196 t b a a;
+#N canvas 118 188 669 439 resizer 0;
+#X obj 322 204 mtx_size;
+#X obj 236 283 mtx_eye;
+#X obj 366 303 mtx_eye;
+#X obj 322 225 pack;
+#X obj 206 231 t a a;
+#X obj 206 263 mtx_resize;
+#X obj 236 323 mtx_-;
+#X obj 236 303 mtx_resize;
+#X obj 322 246 t l l l;
+#X text 138 30 what's going on here ?;
+#X obj 206 182 inlet A;
+#X obj 322 182 inlet B;
+#X obj 206 379 outlet C;
+#X text 153 52 a matrix A should be resized to the same size as a reference
+matrix B. the missing elements should be taken from the identity-matrix
+rather than from the zeros-matrix.;
+#X text 153 100 what we do is: resize A (with zeros) \, calculate the
+missing identity matrix (by subtracting a (zero-padded) resized I-matrix
+from a big I-matrix) and add them together;
+#X text 159 150 C=A+I(B)-I(A);
+#X obj 206 350 mtx_-;
+#X connect 0 0 3 0;
+#X connect 0 1 3 1;
+#X connect 1 0 7 0;
+#X connect 2 0 6 1;
+#X connect 3 0 8 0;
+#X connect 4 0 5 0;
+#X connect 4 1 1 0;
+#X connect 5 0 16 0;
+#X connect 6 0 16 1;
+#X connect 7 0 6 0;
+#X connect 8 0 5 1;
+#X connect 8 1 7 1;
+#X connect 8 2 2 0;
+#X connect 10 0 4 0;
+#X connect 11 0 0 0;
+#X connect 16 0 12 0;
+#X restore 154 274 pd resizer;
+#X connect 0 0 10 0;
+#X connect 1 0 5 0;
+#X connect 2 0 3 0;
#X connect 3 0 6 0;
-#X connect 6 0 9 0;
-#X connect 6 1 7 1;
-#X connect 7 0 4 0;
-#X connect 8 0 7 0;
-#X connect 8 1 5 0;
-#X connect 9 1 0 0;
-#X connect 9 2 1 1;
+#X connect 3 1 4 1;
+#X connect 4 0 7 0;
+#X connect 5 0 4 0;
+#X connect 5 1 8 0;
+#X connect 6 1 9 0;
+#X connect 6 2 0 1;
+#X connect 9 0 0 0;
+#X connect 9 1 1 1;
+#X connect 9 2 10 1;
+#X connect 10 0 1 0;