| [221] | 1 | #ifndef BZ_ARRAYCYCLE_CC | 
|---|
|  | 2 | #define BZ_ARRAYCYCLE_CC | 
|---|
|  | 3 |  | 
|---|
|  | 4 | #ifndef BZ_ARRAY_H | 
|---|
|  | 5 | #error <blitz/array/cycle.cc> must be included via <blitz/array.h> | 
|---|
|  | 6 | #endif | 
|---|
|  | 7 |  | 
|---|
|  | 8 | BZ_NAMESPACE(blitz) | 
|---|
|  | 9 |  | 
|---|
|  | 10 | template<class T_numtype, int N_rank> | 
|---|
|  | 11 | void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b) | 
|---|
|  | 12 | { | 
|---|
|  | 13 | Array<T_numtype, N_rank> tmp(a); | 
|---|
|  | 14 | a.reference(b); | 
|---|
|  | 15 | b.reference(tmp); | 
|---|
|  | 16 | } | 
|---|
|  | 17 |  | 
|---|
|  | 18 | template<class T_numtype, int N_rank> | 
|---|
|  | 19 | void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b, | 
|---|
|  | 20 | Array<T_numtype, N_rank>& c) | 
|---|
|  | 21 | { | 
|---|
|  | 22 | Array<T_numtype, N_rank> tmp(a); | 
|---|
|  | 23 | a.reference(b); | 
|---|
|  | 24 | b.reference(c); | 
|---|
|  | 25 | c.reference(tmp); | 
|---|
|  | 26 | } | 
|---|
|  | 27 |  | 
|---|
|  | 28 | template<class T_numtype, int N_rank> | 
|---|
|  | 29 | void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b, | 
|---|
|  | 30 | Array<T_numtype, N_rank>& c, Array<T_numtype, N_rank>& d) | 
|---|
|  | 31 | { | 
|---|
|  | 32 | Array<T_numtype, N_rank> tmp(a); | 
|---|
|  | 33 | a.reference(b); | 
|---|
|  | 34 | b.reference(c); | 
|---|
|  | 35 | c.reference(d); | 
|---|
|  | 36 | d.reference(tmp); | 
|---|
|  | 37 | } | 
|---|
|  | 38 |  | 
|---|
|  | 39 | template<class T_numtype, int N_rank> | 
|---|
|  | 40 | void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b, | 
|---|
|  | 41 | Array<T_numtype, N_rank>& c, Array<T_numtype, N_rank>& d, | 
|---|
|  | 42 | Array<T_numtype, N_rank>& e) | 
|---|
|  | 43 | { | 
|---|
|  | 44 | Array<T_numtype, N_rank> tmp(a); | 
|---|
|  | 45 | a.reference(b); | 
|---|
|  | 46 | b.reference(c); | 
|---|
|  | 47 | c.reference(d); | 
|---|
|  | 48 | d.reference(e); | 
|---|
|  | 49 | e.reference(tmp); | 
|---|
|  | 50 | } | 
|---|
|  | 51 |  | 
|---|
|  | 52 | BZ_NAMESPACE_END | 
|---|
|  | 53 |  | 
|---|
|  | 54 | #endif // BZ_ARRAYCYCLE_CC | 
|---|