From 5906c99acec28f3892e0571f6e731653fd6aab34 Mon Sep 17 00:00:00 2001 From: Franz Zotter Date: Wed, 9 Aug 2006 16:21:16 +0000 Subject: added some useful abstractions: ...rowcol... indexing vectors/matrices can be converted to row and column indexing vectors/matrices. mtx_find_rowcol ... finding nonzero row and column indices of a matrix mtx_mod.pd ... modulo operator using division and rounding. svn path=/trunk/externals/iem/iemmatrix/; revision=5539 --- abs/mtx_find_rowcol.pd | 19 +++++++++++++++++++ abs/mtx_index2rowcol.pd | 28 ++++++++++++++++++++++++++++ abs/mtx_mod.pd | 19 +++++++++++++++++++ abs/mtx_rowcol2index.pd | 21 +++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 abs/mtx_find_rowcol.pd create mode 100644 abs/mtx_index2rowcol.pd create mode 100644 abs/mtx_mod.pd create mode 100644 abs/mtx_rowcol2index.pd diff --git a/abs/mtx_find_rowcol.pd b/abs/mtx_find_rowcol.pd new file mode 100644 index 0000000..7c96e1e --- /dev/null +++ b/abs/mtx_find_rowcol.pd @@ -0,0 +1,19 @@ +#N canvas 0 0 450 300 10; +#X obj 141 13 inlet; +#X obj 141 212 outlet; +#X obj 141 35 t a a; +#X obj 171 56 mtx_size; +#X obj 141 76 mtx_find; +#X obj 248 212 outlet; +#X text 280 74 comment; +#X text 256 27 finds the non-zero; +#X text 260 58 column and row indices; +#X text 308 89 of a matrix; +#X obj 141 111 mtx_index2rowcol; +#X connect 0 0 2 0; +#X connect 2 0 4 0; +#X connect 2 1 3 0; +#X connect 3 1 10 1; +#X connect 4 0 10 0; +#X connect 10 0 1 0; +#X connect 10 1 5 0; diff --git a/abs/mtx_index2rowcol.pd b/abs/mtx_index2rowcol.pd new file mode 100644 index 0000000..0b685bc --- /dev/null +++ b/abs/mtx_index2rowcol.pd @@ -0,0 +1,28 @@ +#N canvas 304 424 484 300 10; +#X obj 141 13 inlet; +#X obj 141 212 outlet; +#X obj 141 122 t a a; +#X obj 141 167 mtx_int; +#X obj 208 211 outlet; +#X obj 141 190 mtx_+ 1; +#X obj 208 185 mtx_+ 1; +#X obj 141 100 mtx_- 1; +#X text 260 58 column and row indices; +#X obj 242 11 inlet; +#X text 285 10 columns; +#X text 255 40 calculates; +#X text 280 76 for a given index vector; +#X text 308 93 and given column size; +#X obj 208 146 mtx_mod \$1; +#X obj 141 146 mtx_./ \$1; +#X connect 0 0 7 0; +#X connect 2 0 15 0; +#X connect 2 1 14 0; +#X connect 3 0 5 0; +#X connect 5 0 1 0; +#X connect 6 0 4 0; +#X connect 7 0 2 0; +#X connect 9 0 15 1; +#X connect 9 0 14 1; +#X connect 14 0 6 0; +#X connect 15 0 3 0; diff --git a/abs/mtx_mod.pd b/abs/mtx_mod.pd new file mode 100644 index 0000000..940eb8f --- /dev/null +++ b/abs/mtx_mod.pd @@ -0,0 +1,19 @@ +#N canvas 0 0 450 300 10; +#X obj 162 18 inlet; +#X obj 162 217 outlet; +#X obj 240 18 inlet; +#X obj 162 69 mtx_./ \$1; +#X obj 162 93 t a a; +#X obj 200 115 mtx_int; +#X obj 162 141 mtx_-; +#X obj 162 164 mtx_* \$1; +#X text 48 9 matrix modulo; +#X connect 0 0 3 0; +#X connect 2 0 3 1; +#X connect 2 0 7 1; +#X connect 3 0 4 0; +#X connect 4 0 6 0; +#X connect 4 1 5 0; +#X connect 5 0 6 1; +#X connect 6 0 7 0; +#X connect 7 0 1 0; diff --git a/abs/mtx_rowcol2index.pd b/abs/mtx_rowcol2index.pd new file mode 100644 index 0000000..6eab201 --- /dev/null +++ b/abs/mtx_rowcol2index.pd @@ -0,0 +1,21 @@ +#N canvas 12 28 450 300 10; +#X obj 77 12 inlet; +#X obj 350 11 inlet; +#X text 293 10 columns; +#X text 118 13 row; +#X obj 146 13 inlet; +#X text 187 14 col; +#X obj 77 168 outlet; +#X obj 77 103 mtx_- 1; +#X obj 77 125 mtx_.* \$1; +#X obj 77 146 mtx_+; +#X text 270 98 calculates; +#X text 216 121 linear matrix indices; +#X text 223 145 from row and col indices; +#X text 232 169 and the column size; +#X connect 0 0 7 0; +#X connect 1 0 8 1; +#X connect 4 0 9 1; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 6 0; -- cgit v1.2.1