source: XMLIO_V2/external/include/blitz/array/cycle.cc @ 80

Last change on this file since 80 was 80, checked in by ymipsl, 14 years ago

ajout lib externe

File size: 2.3 KB
Line 
1/***************************************************************************
2 * blitz/array/cycle.cc  Cycle arrays for time-stepping of PDEs.
3 *
4 * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * Suggestions:          blitz-dev@oonumerics.org
17 * Bugs:                 blitz-bugs@oonumerics.org
18 *
19 * For more information, please see the Blitz++ Home Page:
20 *    http://oonumerics.org/blitz/
21 *
22 ****************************************************************************/
23#ifndef BZ_ARRAYCYCLE_CC
24#define BZ_ARRAYCYCLE_CC
25
26#ifndef BZ_ARRAY_H
27 #error <blitz/array/cycle.cc> must be included via <blitz/array.h>
28#endif
29
30BZ_NAMESPACE(blitz)
31
32template<typename T_numtype, int N_rank>
33void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b)
34{
35    Array<T_numtype, N_rank> tmp(a);
36    a.reference(b);
37    b.reference(tmp);
38}
39
40template<typename T_numtype, int N_rank>
41void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b,
42    Array<T_numtype, N_rank>& c)
43{
44    Array<T_numtype, N_rank> tmp(a);
45    a.reference(b);
46    b.reference(c);
47    c.reference(tmp);
48}
49
50template<typename T_numtype, int N_rank>
51void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b,
52    Array<T_numtype, N_rank>& c, Array<T_numtype, N_rank>& d)
53{
54    Array<T_numtype, N_rank> tmp(a);
55    a.reference(b);
56    b.reference(c);
57    c.reference(d);
58    d.reference(tmp);
59}
60
61template<typename T_numtype, int N_rank>
62void cycleArrays(Array<T_numtype, N_rank>& a, Array<T_numtype, N_rank>& b,
63    Array<T_numtype, N_rank>& c, Array<T_numtype, N_rank>& d,
64    Array<T_numtype, N_rank>& e)
65{
66    Array<T_numtype, N_rank> tmp(a);
67    a.reference(b);
68    b.reference(c);
69    c.reference(d);
70    d.reference(e);
71    e.reference(tmp);
72}
73
74BZ_NAMESPACE_END
75
76#endif // BZ_ARRAYCYCLE_CC
Note: See TracBrowser for help on using the repository browser.