From 3c1d6bd4f73e370464c537f9a3368752bd44bdf0 Mon Sep 17 00:00:00 2001 From: Franz Zotter Date: Tue, 22 Jun 2010 06:23:15 +0000 Subject: added [mtx_cumprod] and [mtx_polyval] to evaluate polynomials svn path=/trunk/externals/iem/iemmatrix/; revision=13685 --- abs/mtx_polyval-help.pd | 14 ++++++ abs/mtx_polyval.pd | 122 ++++++++++++++++++++++-------------------------- 2 files changed, 70 insertions(+), 66 deletions(-) create mode 100644 abs/mtx_polyval-help.pd (limited to 'abs') diff --git a/abs/mtx_polyval-help.pd b/abs/mtx_polyval-help.pd new file mode 100644 index 0000000..9a6ead3 --- /dev/null +++ b/abs/mtx_polyval-help.pd @@ -0,0 +1,14 @@ +#N canvas 0 0 514 300 10; +#X obj 47 142 mtx_polyval; +#X msg 122 100 matrix 1 5 1 -2 3 2 1; +#X msg 43 73 matrix 1 3 0 1 2; +#X obj 47 174 mtx_print; +#X text 185 152 evaluate polynomial; +#X text 181 178 1*x^4 -2*x^3 +3*x^2 +2*x^1 +1*x^0; +#X text 45 13 [mtx_polyval] evaluates polynomial with given coefficients +; +#X text 94 33 at given values for x; +#X text 252 241 Franz Zotter \, 2010; +#X connect 0 0 3 0; +#X connect 1 0 0 1; +#X connect 2 0 0 0; diff --git a/abs/mtx_polyval.pd b/abs/mtx_polyval.pd index d63045d..69c719b 100644 --- a/abs/mtx_polyval.pd +++ b/abs/mtx_polyval.pd @@ -1,74 +1,64 @@ -#N canvas 96 236 810 668 10; +#N canvas 0 326 645 532 10; #X obj 50 32 inlet; #X obj 310 34 inlet; #X text 354 32 coeffs; #X text 94 32 values; #X obj 50 60 mtx_:; -#X obj 310 64 t a a; -#X obj 342 86 mtx_size; -#X msg 123 52 matrix 1 2 1 2; -#X obj 273 547 mtx; -#X obj 82 112 mtx_size; -#X obj 272 245 pack f 4; -#X obj 53 358 mtx; -#X obj 53 379 mtx_.*; -#X obj 103 379 t a; -#X msg 92 316 1 \$1; -#X obj 92 337 mtx_ones; -#X obj 53 231 until; -#X obj 53 273 f; -#X obj 82 273 + 1; -#X obj 115 437 list split 3; -#X obj 155 459 list prepend; -#X msg 236 437 row \$1; -#X obj 155 480 list trim; -#X msg 272 268 size \$1 \$2; -#X obj 92 357 t a a b; -#X msg 148 357 1; -#X obj 53 293 t b f; -#X msg 71 252 2; -#X obj 53 210 t f b; -#X obj 53 188 - 1; -#X obj 53 169 f 2; -#X obj 50 86 t b a; -#X obj 286 588 mtx_print; +#X obj 310 56 t a a; +#X obj 342 78 mtx_size; +#X obj 82 160 mtx_repmat 1 1; +#X obj 82 135 spigot; +#X obj 121 113 > 1; +#X obj 50 115 t a a; +#X obj 177 117 - 1; +#X obj 50 184 mtx_size; +#X obj 50 227 mtx_ones; +#X obj 106 261 spigot; +#X obj 50 261 spigot; +#X obj 116 226 == 1; +#X obj 50 389 mtx_*; +#X msg 50 205 \$1 1; +#X msg 177 137 1 \$1; +#X obj 50 87 mtx_transpose; +#X obj 106 280 mtx_concat row; +#X obj 310 156 mtx_transpose; +#X obj 50 427 outlet; +#X text 181 319 powers of x:; +#X text 192 335 [x1^0 x1^1 x1^2 ...; +#X text 197 350 x2^0 x2^1 x2^2 ...; +#X text 199 365 x3^0 x3^1 x3^2 ...; +#X text 320 198 coefficients of polynomials; +#X text 315 240 a1 b1 c1 d1 ...; +#X text 309 223 [a0 b0 c0 d0 ...; +#X text 315 255 a2 b3 c3 d3 ...; +#X obj 50 319 mtx_cumprod row; +#X obj 310 128 mtx_reverse col; #X connect 0 0 4 0; #X connect 1 0 5 0; -#X connect 4 0 31 0; +#X connect 4 0 20 0; +#X connect 5 0 33 0; #X connect 5 1 6 0; -#X connect 6 1 10 1; -#X connect 6 1 30 1; -#X connect 7 0 4 0; -#X connect 8 0 32 0; -#X connect 9 1 10 0; -#X connect 9 1 14 0; -#X connect 10 0 23 0; -#X connect 11 0 12 0; -#X connect 12 0 13 0; -#X connect 13 0 12 1; -#X connect 13 0 19 0; -#X connect 14 0 15 0; -#X connect 15 0 24 0; -#X connect 16 0 17 0; -#X connect 17 0 18 0; -#X connect 17 0 26 0; -#X connect 18 0 17 1; -#X connect 19 1 20 0; -#X connect 20 0 22 0; -#X connect 21 0 20 1; -#X connect 22 0 8 0; -#X connect 23 0 8 0; -#X connect 24 0 12 1; -#X connect 24 1 19 0; -#X connect 24 2 25 0; -#X connect 25 0 21 0; -#X connect 26 0 11 0; -#X connect 26 1 21 0; -#X connect 27 0 17 1; -#X connect 28 0 16 0; -#X connect 28 1 27 0; -#X connect 29 0 28 0; -#X connect 30 0 29 0; -#X connect 31 0 29 0; -#X connect 31 1 9 0; -#X connect 31 1 11 1; +#X connect 6 1 9 0; +#X connect 6 1 11 0; +#X connect 6 1 16 0; +#X connect 7 0 21 1; +#X connect 8 0 7 0; +#X connect 9 0 8 1; +#X connect 9 0 14 1; +#X connect 10 0 12 0; +#X connect 10 1 8 0; +#X connect 11 0 19 0; +#X connect 12 0 18 0; +#X connect 13 0 14 0; +#X connect 13 0 15 0; +#X connect 14 0 21 0; +#X connect 15 0 32 0; +#X connect 16 0 15 1; +#X connect 17 0 23 0; +#X connect 18 0 13 0; +#X connect 19 0 7 1; +#X connect 20 0 10 0; +#X connect 21 0 32 0; +#X connect 22 0 17 1; +#X connect 32 0 17 0; +#X connect 33 0 22 0; -- cgit v1.2.1