Line | |
---|
1 | // Special functions for complex arrays
|
---|
2 |
|
---|
3 | #ifndef BZ_ARRAYCOMPLEX_CC
|
---|
4 | #define BZ_ARRAYCOMPLEX_CC
|
---|
5 |
|
---|
6 | #ifndef BZ_ARRAY_H
|
---|
7 | #error <blitz/array/complex.cc> must be included via <blitz/array/array.h>
|
---|
8 | #endif
|
---|
9 |
|
---|
10 | BZ_NAMESPACE(blitz)
|
---|
11 |
|
---|
12 | #ifdef BZ_HAVE_COMPLEX
|
---|
13 |
|
---|
14 | template<class T_numtype, int N_rank>
|
---|
15 | inline Array<T_numtype, N_rank> real(Array<complex<T_numtype>,N_rank>& A)
|
---|
16 | {
|
---|
17 | return A.extractComponent(T_numtype(), 0, 2);
|
---|
18 | }
|
---|
19 |
|
---|
20 | template<class T_numtype, int N_rank>
|
---|
21 | inline Array<T_numtype, N_rank> imag(Array<complex<T_numtype>,N_rank>& A)
|
---|
22 | {
|
---|
23 | return A.extractComponent(T_numtype(), 1, 2);
|
---|
24 | }
|
---|
25 |
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | BZ_NAMESPACE_END
|
---|
29 |
|
---|
30 | #endif // BZ_ARRAYCOMPLEX_CC
|
---|
31 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.