diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-19 04:36:44 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-03-19 04:36:44 +0000 |
commit | 6a2cccf403ac6045d987eb771b5ac904a33b122a (patch) | |
tree | 7a53ad5250738c0258c59995a4312685fbcf6689 /externals/grill/vasp | |
parent | 6b266723cb82ec38bfc0a1681bddf42e0eac8096 (diff) |
""
svn path=/trunk/; revision=482
Diffstat (limited to 'externals/grill/vasp')
-rw-r--r-- | externals/grill/vasp/changes.txt | 1 | ||||
-rwxr-xr-x | externals/grill/vasp/max/vasp.cconv | bin | 0 -> 409 bytes | |||
-rwxr-xr-x | externals/grill/vasp/max/vasp.conv | 34 | ||||
-rw-r--r-- | externals/grill/vasp/pd-ex/convolve.pd | 136 | ||||
-rw-r--r-- | externals/grill/vasp/pd/vasp.cconv.pd | 28 | ||||
-rw-r--r-- | externals/grill/vasp/pd/vasp.conv.pd | 42 | ||||
-rw-r--r-- | externals/grill/vasp/source/buflib.cpp | 2 | ||||
-rw-r--r-- | externals/grill/vasp/source/main.cpp | 2 | ||||
-rw-r--r-- | externals/grill/vasp/source/obj_size.cpp | 8 | ||||
-rw-r--r-- | externals/grill/vasp/source/opdefs.h | 64 | ||||
-rw-r--r-- | externals/grill/vasp/source/opfuns.h | 5 | ||||
-rwxr-xr-x | externals/grill/vasp/source/oploop.h | 20 | ||||
-rw-r--r-- | externals/grill/vasp/source/vasp.cpp | 12 | ||||
-rw-r--r-- | externals/grill/vasp/source/vasp.h | 8 | ||||
-rw-r--r-- | externals/grill/vasp/source/vbuffer.h | 6 | ||||
-rw-r--r-- | externals/grill/vasp/vasp.cw | bin | 231740 -> 229946 bytes |
16 files changed, 267 insertions, 101 deletions
diff --git a/externals/grill/vasp/changes.txt b/externals/grill/vasp/changes.txt index 23e0f917..3838fa63 100644 --- a/externals/grill/vasp/changes.txt +++ b/externals/grill/vasp/changes.txt @@ -5,6 +5,7 @@ Version history: - FIX: bug for binary operations of complex vasps - ADD: implemented (factor-4) loop unrolling for vector calculation loops - CHANGE: completely restructured vector optimization and introduced multi-dimensional multi-layered functionality +- ADD: attribute "zero" of vasp.size variants (default: true) - whether new samples shall be zeroed 0.1.2: - FIX: bug in vasp.frames* ... wrong argument diff --git a/externals/grill/vasp/max/vasp.cconv b/externals/grill/vasp/max/vasp.cconv Binary files differnew file mode 100755 index 00000000..5b5c2c39 --- /dev/null +++ b/externals/grill/vasp/max/vasp.cconv diff --git a/externals/grill/vasp/max/vasp.conv b/externals/grill/vasp/max/vasp.conv index 0d101377..f7ecd744 100755 --- a/externals/grill/vasp/max/vasp.conv +++ b/externals/grill/vasp/max/vasp.conv @@ -1,30 +1,16 @@ max v2; #N vpatcher 30 70 430 370; -#P newex 53 224 52 196617 vasp.c!fft; -#P newex 134 130 62 196617 vasp.sync 2; -#P newex 150 103 45 196617 vasp.= 0; -#P newex 151 79 43 196617 vasp.im; -#P newex 133 157 49 196617 vasp.cfft; -#P newex 54 198 44 196617 vasp.c*; -#P newex 54 131 62 196617 vasp.sync 2; -#P newex 70 104 45 196617 vasp.= 0; -#P newex 71 80 43 196617 vasp.im; -#P newex 53 158 49 196617 vasp.cfft; +#P newex 53 224 53 196617 vasp.r!fft; +#P newex 133 157 50 196617 vasp.rfft; +#P newex 54 198 40 196617 vasp.*; +#P newex 55 159 50 196617 vasp.rfft; #P outlet 52 252 15 0; #P inlet 140 51 15 0; #P inlet 54 51 15 0; -#P connect 12 0 2 0; -#P connect 6 0 3 0; -#P connect 7 0 12 0; -#P connect 0 0 6 0; -#P connect 3 0 7 0; -#P connect 4 0 5 0; -#P connect 0 0 4 0; -#P connect 8 0 7 1; -#P connect 5 0 6 1; -#P connect 11 0 8 0; -#P connect 1 0 11 0; -#P connect 9 0 10 0; -#P connect 1 0 9 0; -#P connect 10 0 11 1; +#P connect 6 0 2 0; +#P connect 4 0 6 0; +#P connect 3 0 4 0; +#P connect 0 0 3 0; +#P connect 5 0 4 1; +#P connect 1 0 5 0; #P pop; diff --git a/externals/grill/vasp/pd-ex/convolve.pd b/externals/grill/vasp/pd-ex/convolve.pd new file mode 100644 index 00000000..1194e33d --- /dev/null +++ b/externals/grill/vasp/pd-ex/convolve.pd @@ -0,0 +1,136 @@ +#N canvas 292 80 638 415 12;
+#X obj 60 241 bng 50 250 50 0 start_bang empty start 0 -6 128 8 -24198
+-1 -1;
+#X text 15 77 load/save/play etc.;
+#X obj 179 125 nbx 8 16 0 1e+008 0 0 len_src empty empty 0 -8 128 12
+-225271 -1 -1 4e+006 256;
+#X text 275 137 (defines the size of the result);
+#X obj 177 179 nbx 8 16 0 1e+008 0 0 len_arg empty empty 0 -8 128 12
+-225271 -1 -1 89000 256;
+#X obj 32 122 wedit buf_src;
+#X obj 30 176 wedit buf_arg;
+#X obj 33 350 wedit buf_res;
+#X text 122 255 start convolution;
+#X obj 177 356 bng 15 250 50 0 empty empty empty 0 -6 0 8 -258699 -1
+-1;
+#X obj 201 357 nbx 8 16 0 1e+008 0 0 len_arg empty empty 0 -8 128 12
+-261689 -1 -1 4e+006 256;
+#X obj 11 10 cnv 15 600 50 empty empty convolve 10 22 0 24 -260818
+-1 0;
+#X text 202 41 http://www.parasitaere-kapazitaeten.net;
+#X text 203 10 fft-based convolution \, (C)2003 Thomas Grill;
+#X text 203 25 needs vasp and wedit;
+#X text 32 329 result buffer;
+#X text 31 102 source buffer;
+#X text 29 157 argument buffer;
+#X text 278 124 length of source (samples);
+#X text 276 178 length of argument (samples);
+#N canvas 0 0 464 314 do 0;
+#X obj 29 215 vasp.u;
+#N canvas 406 75 430 580 convolve 0;
+#X obj 29 195 vasp.!;
+#X obj 107 280 vasp.conv;
+#X obj 107 311 t a a;
+#X obj 185 344 vasp.f?;
+#X obj 188 372 t b f;
+#X obj 108 482 vasp.->;
+#X obj 195 140 vasp.!;
+#X obj 102 170 vasp.f?;
+#X obj 29 131 t a b a;
+#X obj 194 111 vasp;
+#X obj 28 106 vasp;
+#N canvas 0 0 458 308 sf 0;
+#X obj 39 178 outlet;
+#X obj 38 43 inlet;
+#X obj 41 79 vasp.s;
+#X obj 120 43 inlet;
+#X obj 39 118 vasp.f;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 2 1;
+#X connect 3 0 4 1;
+#X connect 4 0 0 0;
+#X restore 194 211 pd sf;
+#N canvas 0 0 452 302 sf 0;
+#X obj 39 178 outlet;
+#X obj 38 43 inlet;
+#X obj 41 79 vasp.s;
+#X obj 120 43 inlet;
+#X obj 39 118 vasp.f;
+#X connect 1 0 2 0;
+#X connect 2 0 4 0;
+#X connect 3 0 2 1;
+#X connect 3 0 4 1;
+#X connect 4 0 0 0;
+#X restore 187 437 pd sf;
+#X obj 107 406 vasp.opt;
+#X obj 210 405 vasp;
+#X obj 26 46 inlet;
+#X obj 132 51 inlet;
+#X obj 221 50 inlet;
+#X obj 313 50 inlet;
+#X obj 107 538 outlet;
+#X text 26 15 bang;
+#X text 126 21 src1;
+#X text 218 20 src2;
+#X text 313 22 dst;
+#X text 10 217 copy to temp;
+#X text 192 158 copy to temp;
+#X text 164 537 dst;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 2 0 13 0;
+#X connect 2 1 3 0;
+#X connect 3 0 4 0;
+#X connect 4 0 14 0;
+#X connect 4 1 12 1;
+#X connect 5 1 19 0;
+#X connect 6 0 11 0;
+#X connect 7 0 11 1;
+#X connect 8 0 0 0;
+#X connect 8 1 9 0;
+#X connect 8 2 7 0;
+#X connect 9 0 6 0;
+#X connect 10 0 8 0;
+#X connect 11 0 1 1;
+#X connect 12 0 5 1;
+#X connect 13 0 5 0;
+#X connect 14 0 12 0;
+#X connect 15 0 10 0;
+#X connect 16 0 10 1;
+#X connect 17 0 9 1;
+#X connect 18 0 14 1;
+#X restore 28 186 pd convolve;
+#X obj 26 52 t b b;
+#X obj 43 127 vasp.f;
+#X msg 43 94 vasp buf_src;
+#X msg 154 93 vasp buf_arg;
+#X msg 267 92 vasp buf_res;
+#X obj 306 220 table buf_src 10;
+#X obj 307 242 table buf_arg 10;
+#X obj 307 264 table buf_res 10;
+#X obj 26 23 r start_bang;
+#X obj 143 21 r len_src;
+#X obj 229 24 r len_arg;
+#X obj 153 126 vasp.f;
+#X obj 27 278 outlet;
+#X obj 29 251 vasp.f?;
+#X text 85 215 update buffer;
+#X connect 0 0 15 0;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X connect 2 1 4 0;
+#X connect 2 1 5 0;
+#X connect 2 1 6 0;
+#X connect 3 0 1 1;
+#X connect 4 0 3 0;
+#X connect 5 0 13 0;
+#X connect 6 0 1 3;
+#X connect 10 0 2 0;
+#X connect 11 0 3 1;
+#X connect 12 0 13 1;
+#X connect 13 0 1 2;
+#X connect 15 0 14 0;
+#X restore 177 324 pd do;
+#X connect 20 0 9 0;
+#X connect 20 0 10 0;
diff --git a/externals/grill/vasp/pd/vasp.cconv.pd b/externals/grill/vasp/pd/vasp.cconv.pd new file mode 100644 index 00000000..62cbb795 --- /dev/null +++ b/externals/grill/vasp/pd/vasp.cconv.pd @@ -0,0 +1,28 @@ +#N canvas 30 70 408 308 12;
+#X obj 53 224 vasp.c!fft;
+#X obj 162 131 vasp.sync 2;
+#X obj 178 104 vasp.= 0;
+#X obj 179 80 vasp.im;
+#X obj 161 158 vasp.cfft;
+#X obj 54 198 vasp.c*;
+#X obj 54 131 vasp.sync 2;
+#X obj 70 104 vasp.= 0;
+#X obj 71 80 vasp.im;
+#X obj 53 158 vasp.cfft;
+#X obj 54 51 inlet;
+#X obj 168 52 inlet;
+#X obj 52 252 outlet;
+#X connect 0 0 12 0;
+#X connect 1 0 4 0;
+#X connect 2 0 1 1;
+#X connect 3 0 2 0;
+#X connect 4 0 5 1;
+#X connect 5 0 0 0;
+#X connect 6 0 9 0;
+#X connect 7 0 6 1;
+#X connect 8 0 7 0;
+#X connect 9 0 5 0;
+#X connect 10 0 6 0;
+#X connect 10 0 8 0;
+#X connect 11 0 1 0;
+#X connect 11 0 3 0;
diff --git a/externals/grill/vasp/pd/vasp.conv.pd b/externals/grill/vasp/pd/vasp.conv.pd index 93390159..24d3c35e 100644 --- a/externals/grill/vasp/pd/vasp.conv.pd +++ b/externals/grill/vasp/pd/vasp.conv.pd @@ -1,28 +1,14 @@ -#N canvas 30 70 406 306 12; -#X obj 53 224 vasp.c!fft; -#X obj 162 131 vasp.sync 2; -#X obj 178 104 vasp.= 0; -#X obj 179 80 vasp.im; -#X obj 161 158 vasp.cfft; -#X obj 54 198 vasp.c*; -#X obj 54 131 vasp.sync 2; -#X obj 70 104 vasp.= 0; -#X obj 71 80 vasp.im; -#X obj 53 158 vasp.cfft; -#X obj 54 51 inlet; -#X obj 168 52 inlet; -#X obj 52 252 outlet; -#X connect 0 0 12 0; -#X connect 1 0 4 0; -#X connect 2 0 1 1; -#X connect 3 0 2 0; -#X connect 4 0 5 1; -#X connect 5 0 0 0; -#X connect 6 0 9 0; -#X connect 7 0 6 1; -#X connect 8 0 7 0; -#X connect 9 0 5 0; -#X connect 10 0 6 0; -#X connect 10 0 8 0; -#X connect 11 0 1 0; -#X connect 11 0 3 0; +#N canvas 30 70 408 308 12;
+#X obj 54 51 inlet;
+#X obj 165 52 inlet;
+#X obj 50 193 outlet;
+#X obj 51 99 vasp.rfft;
+#X obj 159 99 vasp.rfft;
+#X obj 52 139 vasp.*;
+#X obj 51 165 vasp.r!fft;
+#X connect 0 0 3 0;
+#X connect 1 0 4 0;
+#X connect 3 0 5 0;
+#X connect 4 0 5 1;
+#X connect 5 0 6 0;
+#X connect 6 0 2 0;
diff --git a/externals/grill/vasp/source/buflib.cpp b/externals/grill/vasp/source/buflib.cpp index 3b92d1e9..d4a6338e 100644 --- a/externals/grill/vasp/source/buflib.cpp +++ b/externals/grill/vasp/source/buflib.cpp @@ -297,6 +297,6 @@ VSymbol ImmBuf::Symbol() const { return entry->sym; } I ImmBuf::Frames() const { return entry->len; } -V ImmBuf::Frames(I fr,BL keep) { entry = BufLib::Resize(entry,fr,keep); } +V ImmBuf::Frames(I fr,BL keep,BL zero) { entry = BufLib::Resize(entry,fr,keep,zero); } S *ImmBuf::Data() { return entry->data; } diff --git a/externals/grill/vasp/source/main.cpp b/externals/grill/vasp/source/main.cpp index 5f63895a..f1cbee10 100644 --- a/externals/grill/vasp/source/main.cpp +++ b/externals/grill/vasp/source/main.cpp @@ -12,7 +12,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "classes.h" -const C *VASP_VERSION = "0.1.3pre1"; +const C *VASP_VERSION = "0.1.3pre3"; #include "opfuns.h" diff --git a/externals/grill/vasp/source/obj_size.cpp b/externals/grill/vasp/source/obj_size.cpp index d8245471..6c2eba4b 100644 --- a/externals/grill/vasp/source/obj_size.cpp +++ b/externals/grill/vasp/source/obj_size.cpp @@ -34,7 +34,7 @@ class vasp_size: public: vasp_size(I argc,t_atom *argv,BL abs = true): - size(0),sets(false),keep(true) + size(0),sets(false),keep(true),zero(true) { if(argc >= 1 && CanbeFloat(argv[0])) m_arg(GetAFloat(argv[0])); @@ -52,6 +52,7 @@ public: { FLEXT_CADDMETHOD(c,1,m_arg); FLEXT_CADDATTR_VAR1(c,"keep",keep); + FLEXT_CADDATTR_VAR1(c,"zero",zero); } virtual V m_arg(F s) @@ -63,20 +64,21 @@ public: virtual Vasp *x_work() { Vasp *ret = new Vasp(ref); - if(sets) ret->Size(size,keep); + if(sets) ret->Size(size,keep,zero); return ret; } virtual V m_help() { post("%s - Set the size of the vector buffers",thisName()); } protected: I size; - BL sets,keep; + BL sets,keep,zero; private: FLEXT_CALLBACK_F(m_arg); FLEXT_CALLSET_I(m_arg); FLEXT_ATTRGET_I(size); FLEXT_ATTRVAR_B(keep); + FLEXT_ATTRVAR_B(zero); }; FLEXT_LIB_V("vasp, vasp.size vasp.s",vasp_size) diff --git a/externals/grill/vasp/source/opdefs.h b/externals/grill/vasp/source/opdefs.h index 8d7d522c..71774db6 100644 --- a/externals/grill/vasp/source/opdefs.h +++ b/externals/grill/vasp/source/opdefs.h @@ -313,13 +313,6 @@ template<class T,class ARG,class OP> BL V__cop(ARG p,register const S *sr,regist return true; } -template<class T,class CL> inline BL _D__run(OpParam &p) { return V__run<T,CL>(p.rsdt,p.rss,p.rddt,p.rds,p.frames); } -template<class T,class CL> inline BL _D__cun(OpParam &p) { return V__cun<T,CL>(p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames); } -template<class T,class CL> inline BL _D__rbin(OpParam &p) { return _F__rbin<T,CL>(p); } -template<class T,class CL> inline BL _D__cbin(OpParam &p) { return _F__cbin<T,CL>(p); } -template<class T,class CL> inline BL _D__rop(OpParam &p) { return V__rop<T,OpParam &,CL>(p,p.rsdt,p.rss,p.rddt,p.rds,p.frames); } -template<class T,class CL> inline BL _D__cop(OpParam &p) { return V__cop<T,OpParam &,CL>(p,p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames); } - template<class T> BL _d__run(V fun(T &v,T a),OpParam &p) { @@ -423,21 +416,54 @@ template<class T> BL _d__cop(V fun(T &rv,T &iv,T ra,T ia,OpParam &p),OpParam &p) } +/* +template<class T,class CL> inline BL _D__run(OpParam &p) { return V__run<T,CL>(p.rsdt,p.rss,p.rddt,p.rds,p.frames); } +template<class T,class CL> inline BL _D__cun(OpParam &p) { return V__cun<T,CL>(p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames); } +template<class T,class CL> inline BL _D__rbin(OpParam &p) { return _F__rbin<T,CL>(p); } +template<class T,class CL> inline BL _D__cbin(OpParam &p) { return _F__cbin<T,CL>(p); } +template<class T,class CL> inline BL _D__rop(OpParam &p) { return V__rop<T,OpParam &,CL>(p,p.rsdt,p.rss,p.rddt,p.rds,p.frames); } +template<class T,class CL> inline BL _D__cop(OpParam &p) { return V__cop<T,OpParam &,CL>(p,p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames); } #ifdef VASP_COMPACT - template<class T,class CL> inline BL D__run(OpParam &p) { return _d__run<T>(CL::run,p); } - template<class T,class CL> inline BL D__cun(OpParam &p) { return _d__cun<T>(CL::cun,p); } - template<class T,class CL> inline BL D__rbin(OpParam &p) { return _d__rbin<T>(CL::rbin,p); } - template<class T,class CL> inline BL D__cbin(OpParam &p) { return _d__cbin<T>(CL::cbin,p); } - template<class T,class CL> inline BL D__rop(OpParam &p) { return _d__rop<T>(CL::rop,p); } - template<class T,class CL> inline BL D__cop(OpParam &p) { return _d__cop<T>(CL::cop,p); } + template<class T,class CL> BL D__run(OpParam &p) { return _d__run<T>(CL::run,p); } + template<class T,class CL> BL D__cun(OpParam &p) { return _d__cun<T>(CL::cun,p); } + template<class T,class CL> BL D__rbin(OpParam &p) { return _d__rbin<T>(CL::rbin,p); } + template<class T,class CL> BL D__cbin(OpParam &p) { return _d__cbin<T>(CL::cbin,p); } + template<class T,class CL> BL D__rop(OpParam &p) { return _d__rop<T>(CL::rop,p); } + template<class T,class CL> BL D__cop(OpParam &p) { return _d__cop<T>(CL::cop,p); } +#else + template<class T,class CL> BL D__run(OpParam &p) { return CL::run_opt()?_D__run<T,CL>(p):_d__run<T>(CL::run,p); } + template<class T,class CL> BL D__cun(OpParam &p) { return CL::cun_opt()?_D__cun<T,CL>(p):_d__cun<T>(CL::cun,p); } + template<class T,class CL> BL D__rbin(OpParam &p) { return CL::rbin_opt()?_D__rbin<T,CL>(p):_d__rbin<T>(CL::rbin,p); } + template<class T,class CL> BL D__cbin(OpParam &p) { return CL::cbin_opt()?_D__cbin<T,CL>(p):_d__cbin<T>(CL::cbin,p); } + template<class T,class CL> BL D__rop(OpParam &p) { return CL::rop_opt()?_D__rop<T,CL>(p):_d__rop<T>(CL::rop,p); } + template<class T,class CL> BL D__cop(OpParam &p) { return CL::cop_opt()?_D__cop<T,CL>(p):_d__cop<T>(CL::cop,p); } +#endif +*/ + +// MSVC 6 can't handle optimization here!! (silently produces wrong code!!!) + +#define _D__run(T,CL,p) V__run<T,CL>(p.rsdt,p.rss,p.rddt,p.rds,p.frames) +#define _D__cun(T,CL,p) V__cun<T,CL>(p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames) +#define _D__rbin(T,CL,p) _F__rbin<T,CL>(p) +#define _D__cbin(T,CL,p) _F__cbin<T,CL>(p) +#define _D__rop(T,CL,p) V__rop<T,OpParam &,CL>(p,p.rsdt,p.rss,p.rddt,p.rds,p.frames) +#define _D__cop(T,CL,p) V__cop<T,OpParam &,CL>(p,p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames) + +#if defined(VASP_COMPACT) || (defined(_MSC_VER) && _MSC_VER <= 1200) + #define D__run(T,CL,p) _d__run<T>(CL::run,p) + #define D__cun(T,CL,p) _d__cun<T>(CL::cun,p) + #define D__rbin(T,CL,p) _d__rbin<T>(CL::rbin,p) + #define D__cbin(T,CL,p) _d__cbin<T>(CL::cbin,p) + #define D__rop(T,CL,p) _d__rop<T>(CL::rop,p) + #define D__cop(T,CL,p) _d__cop<T>(CL::cop,p) #else - template<class T,class CL> inline BL D__run(OpParam &p) { return CL::run_opt()?_D__run<T,CL>(p):_d__run<T>(CL::run,p); } - template<class T,class CL> inline BL D__cun(OpParam &p) { return CL::cun_opt()?_D__cun<T,CL>(p):_d__cun<T>(CL::cun,p); } - template<class T,class CL> inline BL D__rbin(OpParam &p) { return CL::rbin_opt()?_D__rbin<T,CL>(p):_d__rbin<T>(CL::rbin,p); } - template<class T,class CL> inline BL D__cbin(OpParam &p) { return CL::cbin_opt()?_D__cbin<T,CL>(p):_d__cbin<T>(CL::cbin,p); } - template<class T,class CL> inline BL D__rop(OpParam &p) { return CL::rop_opt()?_D__rop<T,CL>(p):_d__rop<T>(CL::rop,p); } - template<class T,class CL> inline BL D__cop(OpParam &p) { return CL::cop_opt()?_D__cop<T,CL>(p):_d__cop<T>(CL::cop,p); } + #define D__run(T,CL,p) ( CL::run_opt()?_D__run(T,CL,p):_d__run<T>(CL::run,p) ) + #define D__cun(T,CL,p) ( CL::cun_opt()?_D__cun(T,CL,p):_d__cun<T>(CL::cun,p) ) + #define D__rbin(T,CL,p) ( CL::rbin_opt()?_D__rbin(T,CL,p):_d__rbin<T>(CL::rbin,p) ) + #define D__cbin(T,CL,p) ( CL::cbin_opt()?_D__cbin(T,CL,p):_d__cbin<T>(CL::cbin,p) ) + #define D__rop(T,CL,p) ( CL::rop_opt()?_D__rop(T,CL,p):_d__rop<T>(CL::rop,p) ) + #define D__cop(T,CL,p) ( CL::cop_opt()?_D__cop(T,CL,p):_d__cop<T>(CL::cop,p) ) #endif diff --git a/externals/grill/vasp/source/opfuns.h b/externals/grill/vasp/source/opfuns.h index 2228641d..3a14eb95 100644 --- a/externals/grill/vasp/source/opfuns.h +++ b/externals/grill/vasp/source/opfuns.h @@ -121,7 +121,7 @@ namespace VecOp { template<class T> class f_sqr { public: static I run_opt() { return 3; } - static V run(T &v,T a) { v = a*a; } + static V run(T &v,T a) { v = a*a; post("sq"); } static I cun_opt() { return 1; } static V cun(T &rv,T &iv,T ra,T ia) { rv = ra*ra-ia*ia; iv = ra*ia*2; } }; @@ -449,8 +449,9 @@ namespace VecOp { } + #define DEFOP(T,FUN,OP,KIND) \ -namespace VecOp { inline BL FUN(OpParam &p) { return D__##KIND<T,f_##OP<T> >(p); } } +namespace VecOp { inline BL FUN(OpParam &p) { return D__##KIND(T,f_##OP<T>,p); } } #define DEFVEC_R(T,OP) \ diff --git a/externals/grill/vasp/source/oploop.h b/externals/grill/vasp/source/oploop.h index 603cd7ce..9518edf1 100755 --- a/externals/grill/vasp/source/oploop.h +++ b/externals/grill/vasp/source/oploop.h @@ -67,11 +67,11 @@ WARRANTIES, see the file, "license.txt," in this distribution. #define _DE_LOOP(VAR,LEN,BODY) { \ for(VAR = 0; VAR < LEN; flext_base::ThrYield()) { \ register const I __m__ = _D_MIN(LEN,VAR+_D_BLOCK); \ - for(; VAR <= __m__-4; VAR += 4) { \ - BODY; \ - BODY; \ - BODY; \ - BODY; \ + for(; VAR <= __m__-4; ) { \ + BODY; ++VAR; \ + BODY; ++VAR; \ + BODY; ++VAR; \ + BODY; ++VAR; \ } \ for(; VAR < __m__; ++VAR) { \ BODY; \ @@ -82,11 +82,11 @@ WARRANTIES, see the file, "license.txt," in this distribution. #else #define _DE_LOOP(VAR,LEN,BODY) { \ - for(VAR = 0; VAR <= LEN-4; VAR += 4) { \ - BODY; \ - BODY; \ - BODY; \ - BODY; \ + for(VAR = 0; VAR <= LEN-4; ) { \ + BODY; ++VAR; \ + BODY; ++VAR; \ + BODY; ++VAR; \ + BODY; ++VAR; \ } \ for(; VAR < LEN; ++VAR) { \ BODY; \ diff --git a/externals/grill/vasp/source/vasp.cpp b/externals/grill/vasp/source/vasp.cpp index 66bffccb..09ecb8ff 100644 --- a/externals/grill/vasp/source/vasp.cpp +++ b/externals/grill/vasp/source/vasp.cpp @@ -281,37 +281,37 @@ V Vasp::Channel(I c) } -V Vasp::Size(I s,BL keep) +V Vasp::Size(I s,BL keep,BL zero) { for(I i = 0; i < Vectors(); ++i) { VBuffer *buf = Buffer(i); if(buf) { - buf->Frames(s,keep); + buf->Frames(s,keep,zero); delete buf; } } } -V Vasp::SizeD(I sd,BL keep) +V Vasp::SizeD(I sd,BL keep,BL zero) { for(I i = 0; i < Vectors(); ++i) { VBuffer *buf = Buffer(i); if(buf) { I s = buf->Frames()+sd; - buf->Frames(s >= 0?s:0,keep); + buf->Frames(s >= 0?s:0,keep,zero); delete buf; } } } -V Vasp::SizeM(R f,BL keep) +V Vasp::SizeM(R f,BL keep,BL zero) { for(I i = 0; i < Vectors(); ++i) { VBuffer *buf = Buffer(i); if(buf) { I s = (I)(buf->Frames()*f); - buf->Frames(s >= 0?s:0,keep); + buf->Frames(s >= 0?s:0,keep,zero); delete buf; } } diff --git a/externals/grill/vasp/source/vasp.h b/externals/grill/vasp/source/vasp.h index 3f76b5bd..ed63846f 100644 --- a/externals/grill/vasp/source/vasp.h +++ b/externals/grill/vasp/source/vasp.h @@ -78,13 +78,13 @@ public: V FramesR(R f) { if(f) FramesM(1./f); else Frames(0); } // set buffer sizes - V Size(I fr,BL keep = true); + V Size(I fr,BL keep = true,BL zero = true); // set frame count differentially - V SizeD(I frd,BL keep = true); + V SizeD(I frd,BL keep = true,BL zero = true); // set frame count - V SizeM(R f,BL keep = true); + V SizeM(R f,BL keep = true,BL zero = true); // set frame count - V SizeR(R f,BL keep = true) { if(f) SizeM(1./f,keep); else Size(0,false); } + V SizeR(R f,BL keep = true,BL zero = true) { if(f) SizeM(1./f,keep,zero); else Size(0,false); } // actual length of the vasp (in frames) I ChkFrames() const; diff --git a/externals/grill/vasp/source/vbuffer.h b/externals/grill/vasp/source/vbuffer.h index 01a57af0..e616ad1c 100644 --- a/externals/grill/vasp/source/vbuffer.h +++ b/externals/grill/vasp/source/vbuffer.h @@ -47,7 +47,7 @@ public: virtual BL Ok() const = 0; virtual I Frames() const = 0; - virtual V Frames(I fr,BL keep) = 0; + virtual V Frames(I fr,BL keep,BL zero) = 0; virtual I Channels() const = 0; virtual S *Data() = 0; @@ -91,7 +91,7 @@ public: SysBuf &Set(const VSymbol &s,I chn = 0,I len = -1,I offs = 0); virtual I Frames() const { return buf.Frames(); } - virtual V Frames(I fr,BL keep) { buf.Frames(fr,keep); } + virtual V Frames(I fr,BL keep,BL zero) { buf.Frames(fr,keep,zero); } virtual I Channels() const { return buf.Channels(); } virtual S *Data() { return buf.Data(); } @@ -115,7 +115,7 @@ public: virtual VSymbol Symbol() const; virtual I Frames() const; - virtual V Frames(I fr,BL keep); + virtual V Frames(I fr,BL keep,BL zero); virtual I Channels() const { return 1; } virtual S *Data(); diff --git a/externals/grill/vasp/vasp.cw b/externals/grill/vasp/vasp.cw Binary files differindex 1601dbcb..0463eb2d 100644 --- a/externals/grill/vasp/vasp.cw +++ b/externals/grill/vasp/vasp.cw |