source: Sophya/trunk/SophyaExt/Blitz/blitz/array/complex.cc@ 221

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

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

File size: 634 bytes
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
10BZ_NAMESPACE(blitz)
11
12#ifdef BZ_HAVE_COMPLEX
13
14template<class T_numtype, int N_rank>
15inline Array<T_numtype, N_rank> real(Array<complex<T_numtype>,N_rank>& A)
16{
17 return A.extractComponent(T_numtype(), 0, 2);
18}
19
20template<class T_numtype, int N_rank>
21inline 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
28BZ_NAMESPACE_END
29
30#endif // BZ_ARRAYCOMPLEX_CC
31
Note: See TracBrowser for help on using the repository browser.