[Gridflow-cvs] [svn] commit: r5884 - in /trunk: doc/moulinette.tcl doc/numop.pd src/number.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sat Jul 31 18:55:46 EDT 2010


Author: matju
Date: Sat Jul 31 18:55:46 2010
New Revision: 5884

Log:
added numop "/exp"

Modified:
    trunk/doc/moulinette.tcl
    trunk/doc/numop.pd
    trunk/src/number.cxx

Modified: trunk/doc/moulinette.tcl
==============================================================================
--- trunk/doc/moulinette.tcl (original)
+++ trunk/doc/moulinette.tcl Sat Jul 31 18:55:46 2010
@@ -106,7 +106,8 @@
 op {cos*} { B * cos(A) in centidegrees } {--} {waves, rotations}
 op {atan} { arctan(A/B) in centidegrees } {--} {find angle to origin; (part of polar transform)} 28
 op {tanh*} { B * tanh(A) in centidegrees } {smooth clipping} {smooth clipping (of individual points); neural sigmoid, fuzzy logic} 28
-op {log*} { B * log(A) (in base e) }
+op {log*} { B * log(A) in base e }
+op {/exp} { exp(A / B) in base e }
 op {gamma} { floor(pow(a/256.0,256.0/b)*256.0) } {gamma correction}
 op {**} { A**B, that is, A raised to power B } {gamma correction}
 op {abs-} { absolute value of (A-B) }

Modified: trunk/doc/numop.pd
==============================================================================
--- trunk/doc/numop.pd (original)
+++ trunk/doc/numop.pd Sat Jul 31 18:55:46 2010
@@ -160,182 +160,186 @@
 #X text 676 759 smooth clipping (of individual points) \;  neural sigmoid \,  fuzzy logic;
 #X obj 0 791 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
 #X msg 10 791 op log*;
-#X text 96 787  B * log(A) (in base e) ;
+#X text 96 787  B * log(A) in base e ;
 #X obj 0 810 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 810 op gamma;
-#X text 96 806  floor(pow(a/256.0 \, 256.0/b)*256.0) ;
-#X text 446 806 gamma correction;
+#X msg 10 810 op /exp;
+#X text 96 806  exp(A / B) in base e ;
 #X obj 0 829 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 829 op **;
-#X text 96 825  A**B \,  that is \,  A raised to power B ;
+#X msg 10 829 op gamma;
+#X text 96 825  floor(pow(a/256.0 \, 256.0/b)*256.0) ;
 #X text 446 825 gamma correction;
 #X obj 0 848 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 848 op abs-;
-#X text 96 844  absolute value of (A-B) ;
+#X msg 10 848 op **;
+#X text 96 844  A**B \,  that is \,  A raised to power B ;
+#X text 446 844 gamma correction;
 #X obj 0 867 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 867 op rand;
-#X text 96 863  randomly produces a non-negative number below A ;
+#X msg 10 867 op abs-;
+#X text 96 863  absolute value of (A-B) ;
 #X obj 0 886 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 886 op sqrt;
-#X text 96 882  square root of A \,  rounded downwards ;
+#X msg 10 886 op rand;
+#X text 96 882  randomly produces a non-negative number below A ;
 #X obj 0 905 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 905 op sq-;
-#X text 96 901  (A-B) times (A-B) ;
+#X msg 10 905 op sqrt;
+#X text 96 901  square root of A \,  rounded downwards ;
 #X obj 0 924 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 924 op avg;
-#X text 96 920  (A+B)/2 ;
+#X msg 10 924 op sq-;
+#X text 96 920  (A-B) times (A-B) ;
 #X obj 0 943 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 943 op hypot;
-#X text 96 939  distance function: square root of (A*A+B*B) ;
-#X obj 0 962 cnv 15 906 26 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 962 op clip+;
-#X text 96 958  like A+B but overflow causes clipping instead of wrapping around ;
-#X obj 0 990 cnv 15 906 26 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 990 op clip-;
-#X text 96 986  like A-B but overflow causes clipping instead of wrapping around ;
-#X obj 0 1018 cnv 15 906 26 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1018 op erf*;
-#X text 96 1014  integral of e^(-x*x) dx ... (coming soon \;  what ought to be the scaling factor?) ;
-#X obj 0 1046 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1046 op weight;
-#X text 96 1042  number of "1" bits in an integer;
+#X msg 10 943 op avg;
+#X text 96 939  (A+B)/2 ;
+#X obj 0 962 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
+#X msg 10 962 op hypot;
+#X text 96 958  distance function: square root of (A*A+B*B) ;
+#X obj 0 981 cnv 15 906 26 empty empty empty 20 12 0 14 -233280 -66577 0;
+#X msg 10 981 op clip+;
+#X text 96 977  like A+B but overflow causes clipping instead of wrapping around ;
+#X obj 0 1009 cnv 15 906 26 empty empty empty 20 12 0 14 -249792 -66577 0;
+#X msg 10 1009 op clip-;
+#X text 96 1005  like A-B but overflow causes clipping instead of wrapping around ;
+#X obj 0 1037 cnv 15 906 26 empty empty empty 20 12 0 14 -233280 -66577 0;
+#X msg 10 1037 op erf*;
+#X text 96 1033  integral of e^(-x*x) dx ... (coming soon \;  what ought to be the scaling factor?) ;
 #X obj 0 1065 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1065 op sin;
-#X text 96 1061 sin(A-B) in radians \,  float only;
+#X msg 10 1065 op weight;
+#X text 96 1061  number of "1" bits in an integer;
 #X obj 0 1084 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1084 op cos;
-#X text 96 1080 cos(A-B) in radians \,  float only;
+#X msg 10 1084 op sin;
+#X text 96 1080 sin(A-B) in radians \,  float only;
 #X obj 0 1103 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1103 op atan2;
-#X text 96 1099 atan2(A \, B) in radians \,  float only;
+#X msg 10 1103 op cos;
+#X text 96 1099 cos(A-B) in radians \,  float only;
 #X obj 0 1122 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1122 op tanh;
-#X text 96 1118 tanh(A-B) in radians \,  float only;
+#X msg 10 1122 op atan2;
+#X text 96 1118 atan2(A \, B) in radians \,  float only;
 #X obj 0 1141 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1141 op exp;
-#X text 96 1137 exp(A-B) in radians \,  float only;
+#X msg 10 1141 op tanh;
+#X text 96 1137 tanh(A-B) in radians \,  float only;
 #X obj 0 1160 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1160 op log;
-#X text 96 1156 log(A-B) in radians \,  float only;
-#X obj 0 1195 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1195 op C.*    ;
-#X text 96 1191 A*B;
+#X msg 10 1160 op exp;
+#X text 96 1156 exp(A-B) in radians \,  float only;
+#X obj 0 1179 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
+#X msg 10 1179 op log;
+#X text 96 1175 log(A-B) in radians \,  float only;
 #X obj 0 1214 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1214 op C.*conj;
-#X text 96 1210 A*conj(B);
+#X msg 10 1214 op C.*    ;
+#X text 96 1210 A*B;
 #X obj 0 1233 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1233 op C./    ;
-#X text 96 1229 A/B;
+#X msg 10 1233 op C.*conj;
+#X text 96 1229 A*conj(B);
 #X obj 0 1252 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1252 op C./conj;
-#X text 96 1248 A/conj(B);
+#X msg 10 1252 op C./    ;
+#X text 96 1248 A/B;
 #X obj 0 1271 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1271 op C.sq-  ;
-#X text 96 1267 (A-B)*(A-B);
+#X msg 10 1271 op C./conj;
+#X text 96 1267 A/conj(B);
 #X obj 0 1290 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1290 op C.abs- ;
-#X text 96 1286 abs(A-B);
+#X msg 10 1290 op C.sq-  ;
+#X text 96 1286 (A-B)*(A-B);
 #X obj 0 1309 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1309 op C.sin  ;
-#X text 96 1305 sin(A-B);
+#X msg 10 1309 op C.abs- ;
+#X text 96 1305 abs(A-B);
 #X obj 0 1328 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1328 op C.cos  ;
-#X text 96 1324 cos(A-B);
+#X msg 10 1328 op C.sin  ;
+#X text 96 1324 sin(A-B);
 #X obj 0 1347 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1347 op C.tanh ;
-#X text 96 1343 tanh(A-B);
+#X msg 10 1347 op C.cos  ;
+#X text 96 1343 cos(A-B);
 #X obj 0 1366 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1366 op C.exp  ;
-#X text 96 1362 exp(A-B);
+#X msg 10 1366 op C.tanh ;
+#X text 96 1362 tanh(A-B);
 #X obj 0 1385 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1385 op C.log  ;
-#X text 96 1381 log(A-B);
-#X obj 0 1420 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
-#X msg 10 1420 op c2p;
-#X text 96 1416 hypot \, atan two-in-one;
+#X msg 10 1385 op C.exp  ;
+#X text 96 1381 exp(A-B);
+#X obj 0 1404 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
+#X msg 10 1404 op C.log  ;
+#X text 96 1400 log(A-B);
 #X obj 0 1439 cnv 15 906 17 empty empty empty 20 12 0 14 -249792 -66577 0;
-#X msg 10 1439 op p2c;
-#X text 96 1435 cos* \, sin* two-in-one;
-#X obj 10 1468 outlet;
-#X connect 7 0 257 0;
-#X connect 12 0 257 0;
-#X connect 17 0 257 0;
-#X connect 22 0 257 0;
-#X connect 27 0 257 0;
-#X connect 32 0 257 0;
-#X connect 37 0 257 0;
-#X connect 42 0 257 0;
-#X connect 47 0 257 0;
-#X connect 52 0 257 0;
-#X connect 55 0 257 0;
-#X connect 58 0 257 0;
-#X connect 63 0 257 0;
-#X connect 66 0 257 0;
-#X connect 69 0 257 0;
-#X connect 72 0 257 0;
-#X connect 75 0 257 0;
-#X connect 78 0 257 0;
-#X connect 83 0 257 0;
-#X connect 88 0 257 0;
-#X connect 93 0 257 0;
-#X connect 98 0 257 0;
-#X connect 103 0 257 0;
-#X connect 106 0 257 0;
-#X connect 109 0 257 0;
-#X connect 114 0 257 0;
-#X connect 119 0 257 0;
-#X connect 122 0 257 0;
-#X connect 125 0 257 0;
-#X connect 128 0 257 0;
-#X connect 131 0 257 0;
-#X connect 134 0 257 0;
-#X connect 137 0 257 0;
-#X connect 140 0 257 0;
-#X connect 145 0 257 0;
-#X connect 150 0 257 0;
-#X connect 155 0 257 0;
-#X connect 160 0 257 0;
-#X connect 163 0 257 0;
-#X connect 167 0 257 0;
-#X connect 171 0 257 0;
-#X connect 174 0 257 0;
-#X connect 177 0 257 0;
-#X connect 180 0 257 0;
-#X connect 183 0 257 0;
-#X connect 186 0 257 0;
-#X connect 189 0 257 0;
-#X connect 192 0 257 0;
-#X connect 195 0 257 0;
-#X connect 198 0 257 0;
-#X connect 201 0 257 0;
-#X connect 204 0 257 0;
-#X connect 207 0 257 0;
-#X connect 210 0 257 0;
-#X connect 213 0 257 0;
-#X connect 216 0 257 0;
-#X connect 219 0 257 0;
-#X connect 222 0 257 0;
-#X connect 225 0 257 0;
-#X connect 228 0 257 0;
-#X connect 231 0 257 0;
-#X connect 234 0 257 0;
-#X connect 237 0 257 0;
-#X connect 240 0 257 0;
-#X connect 243 0 257 0;
-#X connect 246 0 257 0;
-#X connect 249 0 257 0;
-#X connect 252 0 257 0;
-#X connect 255 0 257 0;
-#X obj 95 30 cnv 0 0 1488 empty empty empty -1 12 0 14 0 -66577 0;
-#X obj 445 30 cnv 0 0 1488 empty empty empty -1 12 0 14 0 -66577 0;
-#X obj 675 30 cnv 0 0 1488 empty empty empty -1 12 0 14 0 -66577 0;
+#X msg 10 1439 op c2p;
+#X text 96 1435 hypot \, atan two-in-one;
+#X obj 0 1458 cnv 15 906 17 empty empty empty 20 12 0 14 -233280 -66577 0;
+#X msg 10 1458 op p2c;
+#X text 96 1454 cos* \, sin* two-in-one;
+#X obj 10 1487 outlet;
+#X connect 7 0 260 0;
+#X connect 12 0 260 0;
+#X connect 17 0 260 0;
+#X connect 22 0 260 0;
+#X connect 27 0 260 0;
+#X connect 32 0 260 0;
+#X connect 37 0 260 0;
+#X connect 42 0 260 0;
+#X connect 47 0 260 0;
+#X connect 52 0 260 0;
+#X connect 55 0 260 0;
+#X connect 58 0 260 0;
+#X connect 63 0 260 0;
+#X connect 66 0 260 0;
+#X connect 69 0 260 0;
+#X connect 72 0 260 0;
+#X connect 75 0 260 0;
+#X connect 78 0 260 0;
+#X connect 83 0 260 0;
+#X connect 88 0 260 0;
+#X connect 93 0 260 0;
+#X connect 98 0 260 0;
+#X connect 103 0 260 0;
+#X connect 106 0 260 0;
+#X connect 109 0 260 0;
+#X connect 114 0 260 0;
+#X connect 119 0 260 0;
+#X connect 122 0 260 0;
+#X connect 125 0 260 0;
+#X connect 128 0 260 0;
+#X connect 131 0 260 0;
+#X connect 134 0 260 0;
+#X connect 137 0 260 0;
+#X connect 140 0 260 0;
+#X connect 145 0 260 0;
+#X connect 150 0 260 0;
+#X connect 155 0 260 0;
+#X connect 160 0 260 0;
+#X connect 163 0 260 0;
+#X connect 166 0 260 0;
+#X connect 170 0 260 0;
+#X connect 174 0 260 0;
+#X connect 177 0 260 0;
+#X connect 180 0 260 0;
+#X connect 183 0 260 0;
+#X connect 186 0 260 0;
+#X connect 189 0 260 0;
+#X connect 192 0 260 0;
+#X connect 195 0 260 0;
+#X connect 198 0 260 0;
+#X connect 201 0 260 0;
+#X connect 204 0 260 0;
+#X connect 207 0 260 0;
+#X connect 210 0 260 0;
+#X connect 213 0 260 0;
+#X connect 216 0 260 0;
+#X connect 219 0 260 0;
+#X connect 222 0 260 0;
+#X connect 225 0 260 0;
+#X connect 228 0 260 0;
+#X connect 231 0 260 0;
+#X connect 234 0 260 0;
+#X connect 237 0 260 0;
+#X connect 240 0 260 0;
+#X connect 243 0 260 0;
+#X connect 246 0 260 0;
+#X connect 249 0 260 0;
+#X connect 252 0 260 0;
+#X connect 255 0 260 0;
+#X connect 258 0 260 0;
+#X obj 95 30 cnv 0 0 1507 empty empty empty -1 12 0 14 0 -66577 0;
+#X obj 445 30 cnv 0 0 1507 empty empty empty -1 12 0 14 0 -66577 0;
+#X obj 675 30 cnv 0 0 1507 empty empty empty -1 12 0 14 0 -66577 0;
 #X obj 0 54 cnv 15 906 14 empty empty empty 20 12 0 14 -248881 -66577 0;
 #X text 10 52 numops;
-#X obj 0 1179 cnv 15 906 14 empty empty empty 20 12 0 14 -248881 -66577 0;
-#X text 10 1177 vecops for complex numbers;
-#X obj 0 1404 cnv 15 906 14 empty empty empty 20 12 0 14 -248881 -66577 0;
-#X text 10 1402 vecops for other things;
-#X text 10 1488 
+#X obj 0 1198 cnv 15 906 14 empty empty empty 20 12 0 14 -248881 -66577 0;
+#X text 10 1196 vecops for complex numbers;
+#X obj 0 1423 cnv 15 906 14 empty empty empty 20 12 0 14 -248881 -66577 0;
+#X text 10 1421 vecops for other things;
+#X text 10 1507 
 	note: a centidegree is 0.01 degree. There are 36000 centidegrees in a circle.
         Some angle operators use centidegrees \,  while some others use radians. To
         convert degrees into centidegrees \,  multiply by 100.

Modified: trunk/src/number.cxx
==============================================================================
--- trunk/src/number.cxx (original)
+++ trunk/src/number.cxx Sat Jul 31 18:55:46 2010
@@ -226,6 +226,7 @@
 DEF_OP(gamma, b<=0 ? (T)0 : (T)(0+floor(pow((float64)a/256.0,256.0/(float64)b)*256.0)), 0, false, false) // "RN=256"
 DEF_OPF(pow, ipow(a,b), pow(a,b), 0, false, false) // "RN=1"
 DEF_OP(logmul, a==0 ? (T)0 : (T)((float64)b * log((float64)gf_abs(a))), 0, false, false) // "RA=0"
+DEF_OP(divexp, (T)exp((float64)a/(float64)b),0,false,false)
 // 0.8
 DEF_OPF(clipadd, clipadd(a,b), a+b, 0, x==0, false)
 DEF_OPF(clipsub, clipsub(a,b), a-b, 0, side==at_right && x==0, false)
@@ -362,6 +363,7 @@
 	DECL_OP_NOFOLD(gamma,  "gamma", 0),
 	DECL_OP_NOFOLD(pow,    "**", 0),
 	DECL_OP_NOFOLD(logmul, "log*", 0),
+	DECL_OP_NOFOLD(divexp, "/exp", 0),
 // 0.8
 	DECL_OP(clipadd,"clip+", OP_ASSOC|OP_COMM),
 	DECL_OP(clipsub,"clip-", 0),



More information about the Gridflow-cvs mailing list