From 0ed7a8b68dd73e2b0473b8127aeca99f3bac9061 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 1 Apr 2009 21:13:09 +0000 Subject: cleaned up grill externals - replaced with svn:externals to svn.grrrr.org/ext/trunk/ svn path=/trunk/; revision=10951 --- externals/grill/vasp/source/oppermute.h | 121 -------------------------------- 1 file changed, 121 deletions(-) delete mode 100644 externals/grill/vasp/source/oppermute.h (limited to 'externals/grill/vasp/source/oppermute.h') diff --git a/externals/grill/vasp/source/oppermute.h b/externals/grill/vasp/source/oppermute.h deleted file mode 100644 index 45221a1f..00000000 --- a/externals/grill/vasp/source/oppermute.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - -VASP modular - vector assembling signal processor / objects for Max/MSP and PD - -Copyright (c) 2002 Thomas Grill (xovo@gmx.net) -For information on usage and redistribution, and for a DISCLAIMER OF ALL -WARRANTIES, see the file, "license.txt," in this distribution. - -*/ - -#ifndef __VASP_OPPERMUTE_H -#define __VASP_OPPERMUTE_H - -#include "opparam.h" -#include "oploop.h" - -#define PERMTMPL -#define MAXPERMDIM 2 - -template -inline void permswap(T &a,T &b) { register T t = a; a = b; b = t; } - -#ifdef PERMTMPL -template -void permutation1(OpParam &p) -#else -template -void permutation1(OpParam &p,int (*origination)(int pos, int sz,OpParam &p)) -#endif -{ - T *ddt = p.rddt; - const I ds = p.rds; - const I sz = p.frames; - - if(ddt != p.rsdt) { - // not in place - const T *sdt = p.rsdt; - const I ss = p.rss; - I i; - _DE_LOOP(i,sz, ( ddt[origination(i,sz,p)*ds] = sdt[i*ss] ) ) - } - else { - // in place - // \todo try to come from both sides! - I i; - _D_LOOP(i,sz-1) - int cur = i; - do { cur = origination(cur,sz,p); } while(cur < i); - if(cur > i) { - // swap - permswap(ddt[cur*ds],ddt[i*ds]); - } - _E_LOOP - } -} - -#ifdef PERMTMPL -template -void permutation2(OpParam &p) -#else -template -void permutation2(OpParam &p,int (*origination)(int pos, int sz,OpParam &p)) -#endif -{ - T *rddt = p.rddt,*iddt = p.iddt; - const I rds = p.rds,ids = p.ids; - const I sz = p.frames; - bool rinpl = rddt == p.rsdt,iinpl = iddt == p.isdt; - - if(rinpl == iinpl) { - // re and im both in place - I i; - _D_LOOP(i,sz-1) - int cur = i; - do { cur = origination(cur,sz,p); } while(cur < i); - if(cur > i) { - // swap - permswap(rddt[cur*rds],rddt[i*rds]); - permswap(iddt[cur*ids],iddt[i*ids]); - } - _E_LOOP - } - else { - if(!rinpl) { - const T *sdt = p.rsdt; - const I ss = p.rss; - I i; - if(ss == 1 && rds == 1) - _DE_LOOP(i,sz, ( *(rddt++) = *(sdt++) ) ) - else - _DE_LOOP(i,sz, ( *rddt = *sdt,rddt += rds,sdt += ss ) ) - rddt = p.rddt; - } - else permutation1(p,origination); - - if(!iinpl) { - const T *sdt = p.isdt; - const I ss = p.iss; - I i; - if(ss == 1 && ids == 1) - _DE_LOOP(i,sz, ( *(iddt++) = *(sdt++) ) ) - else - _DE_LOOP(i,sz, ( *iddt = *sdt,iddt += ids,sdt += ss ) ) - iddt = p.iddt; - } - else { - permswap(p.rddt,p.iddt); permswap(p.rds,p.ids); - permutation1(p,origination); - permswap(p.rddt,p.iddt); permswap(p.rds,p.ids); - } - } -} - -#ifdef PERMTMPL -#define PERMUTATION(tp,dim,p,func) permutation ## dim (p) -#else -#define PERMUTATION(tp,dim,p,func) permutation ## dim (p,func) -#endif - -#endif - -- cgit v1.2.1