Mercurial > hg > octave-lyh
comparison liboctave/oct-cmplx.h @ 3775:13905c3a24af
[project @ 2001-02-06 01:56:59 by jwe]
author | jwe |
---|---|
date | Tue, 06 Feb 2001 01:57:06 +0000 |
parents | 5eef8a2294bd |
children | d0b8964b9d4b |
comparison
equal
deleted
inserted
replaced
3774:de61a7ba91f2 | 3775:13905c3a24af |
---|---|
21 */ | 21 */ |
22 | 22 |
23 #if !defined (octave_oct_cmplx_h) | 23 #if !defined (octave_oct_cmplx_h) |
24 #define octave_oct_cmplx_h 1 | 24 #define octave_oct_cmplx_h 1 |
25 | 25 |
26 // By using this file instead of <complex>, we can easily avoid buggy | |
27 // implementations of the standard complex data type (if needed). | |
28 | |
26 #include <complex> | 29 #include <complex> |
27 | 30 |
28 typedef std::complex<double> Complex; | 31 typedef std::complex<double> Complex; |
32 | |
33 #if defined (CXX_ISO_COMPLIANT_LIBRARY) | |
34 | |
35 // If namespaces don't work, we will end up with some infinite looping. | |
36 | |
37 inline double | |
38 real (const Complex& z) | |
39 { | |
40 return std::real (z); | |
41 } | |
42 | |
43 inline double | |
44 imag (const Complex& z) | |
45 { | |
46 return std::imag (z); | |
47 } | |
48 | |
49 inline double | |
50 abs (const Complex& z) | |
51 { | |
52 return std::abs (z); | |
53 } | |
54 | |
55 inline double | |
56 arg (const Complex& z) | |
57 { | |
58 return std::arg (z); | |
59 } | |
60 | |
61 inline double | |
62 norm (const Complex& z) | |
63 { | |
64 return std::norm (z); | |
65 } | |
66 | |
67 inline Complex | |
68 conj (const Complex& z) | |
69 { | |
70 return std::conj (z); | |
71 } | |
72 | |
73 inline Complex | |
74 polar (const double& x, const double& y); | |
75 | |
76 inline Complex | |
77 cos (const Complex& z) | |
78 { | |
79 return std::cos (z); | |
80 } | |
81 | |
82 inline Complex | |
83 cosh (const Complex& z) | |
84 { | |
85 return std::cosh (z); | |
86 } | |
87 | |
88 inline Complex | |
89 exp (const Complex& z) | |
90 { | |
91 return std::exp (z); | |
92 } | |
93 | |
94 inline Complex | |
95 log (const Complex& z) | |
96 { | |
97 return std::log (z); | |
98 } | |
99 | |
100 inline Complex | |
101 log10 (const Complex& z) | |
102 { | |
103 return std::log10 (z); | |
104 } | |
105 | |
106 inline Complex | |
107 pow (const Complex& z, int n) | |
108 { | |
109 return std::pow (z, n); | |
110 } | |
111 | |
112 inline Complex | |
113 pow (const Complex& z, const double& x) | |
114 { | |
115 return std::pow (z, x); | |
116 } | |
117 | |
118 inline Complex | |
119 pow (const Complex& z1, const Complex& z2) | |
120 { | |
121 return std::pow (z1, z2); | |
122 } | |
123 | |
124 inline Complex | |
125 pow (const double& x, const Complex& z) | |
126 { | |
127 return std::pow (x, z); | |
128 } | |
129 | |
130 inline Complex | |
131 sin (const Complex& z) | |
132 { | |
133 return std::sin (z); | |
134 } | |
135 | |
136 inline Complex | |
137 sinh (const Complex& z) | |
138 { | |
139 return std::sinh (z); | |
140 } | |
141 | |
142 inline Complex | |
143 sqrt (const Complex& z) | |
144 { | |
145 return std::sqrt (z); | |
146 } | |
147 | |
148 inline Complex | |
149 tan (const Complex& z) | |
150 { | |
151 return std::tan (z); | |
152 } | |
153 | |
154 inline Complex | |
155 tanh (const Complex& z) | |
156 { | |
157 return std::tanh (z); | |
158 } | |
159 | |
160 #endif | |
29 | 161 |
30 #endif | 162 #endif |
31 | 163 |
32 /* | 164 /* |
33 ;;; Local Variables: *** | 165 ;;; Local Variables: *** |