source: Sophya/trunk/SophyaExt/Blitz/blitz/array/cycle.cc@ 3641

Last change on this file since 3641 was 221, checked in by ansari, 26 years ago

Creation module DPC/Blitz (blitz 0.4) Reza 09/04/99

File size: 1.3 KB
Line 
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
8BZ_NAMESPACE(blitz)
9
10template<class T_numtype, int N_rank>
11void 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
18template<class T_numtype, int N_rank>
19void 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
28template<class T_numtype, int N_rank>
29void 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
39template<class T_numtype, int N_rank>
40void 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
52BZ_NAMESPACE_END
53
54#endif // BZ_ARRAYCYCLE_CC
Note: See TracBrowser for help on using the repository browser.