author | Jan Vrany <jan.vrany@labware.com> |
Wed, 03 Feb 2021 11:52:30 +0000 | |
branch | jv |
changeset 25410 | c91ea94445d1 |
parent 21242 | 19fabe339f8b |
permissions | -rw-r--r-- |
3637 | 1 |
" |
2 |
This is a Manchester Goodie. It is distributed freely on condition |
|
3 |
that you observe these conditions in respect of the whole Goodie, and on |
|
4 |
any significant part of it which is separately transmitted or stored: |
|
5287
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
5 |
* You must ensure that every copy includes this notice, and that |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
6 |
source and author(s) of the material are acknowledged. |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
7 |
* These conditions must be imposed on anyone who receives a copy. |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
8 |
* The material shall not be used for commercial gain without the prior |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
9 |
written consent of the author(s). |
3637 | 10 |
|
13548 | 11 |
For more information about the Manchester Goodies Library (from which |
3637 | 12 |
this file was distributed) send e-mail: |
5287
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
13 |
To: goodies-lib@cs.man.ac.uk |
13548 | 14 |
Subject: help |
3637 | 15 |
|
16 |
This is an additional goody-class, which is NOT covered by the |
|
17 |
ST/X license. It has been packaged with the ST/X distribution to |
|
18 |
make your live easier instead. NO WARRANTY. |
|
19 |
" |
|
13548 | 20 |
"{ Package: 'stx:libbasic' }" |
6500 | 21 |
|
18836 | 22 |
"{ NameSpace: Smalltalk }" |
23 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
24 |
ArithmeticValue subclass:#Complex |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
25 |
instanceVariableNames:'real imaginary' |
7355 | 26 |
classVariableNames:'ComplexOne ComplexZero' |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
27 |
poolDictionaries:'' |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
28 |
category:'Magnitude-Numbers' |
265 | 29 |
! |
30 |
||
3637 | 31 |
!Complex class methodsFor:'documentation'! |
32 |
||
33 |
copyright |
|
34 |
" |
|
35 |
This is a Manchester Goodie. It is distributed freely on condition |
|
36 |
that you observe these conditions in respect of the whole Goodie, and on |
|
37 |
any significant part of it which is separately transmitted or stored: |
|
5287
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
38 |
* You must ensure that every copy includes this notice, and that |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
39 |
source and author(s) of the material are acknowledged. |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
40 |
* These conditions must be imposed on anyone who receives a copy. |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
41 |
* The material shall not be used for commercial gain without the prior |
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
42 |
written consent of the author(s). |
3637 | 43 |
|
13548 | 44 |
For more information about the Manchester Goodies Library (from which |
3637 | 45 |
this file was distributed) send e-mail: |
5287
b3b0d0e3ce98
package-definitions fixed/updated
Claus Gittinger <cg@exept.de>
parents:
3637
diff
changeset
|
46 |
To: goodies-lib@cs.man.ac.uk |
13548 | 47 |
Subject: help |
3637 | 48 |
|
49 |
This is an additional goody-class, which is NOT covered by the |
|
50 |
ST/X license. It has been packaged with the ST/X distribution to |
|
51 |
make your live easier instead. NO WARRANTY. |
|
52 |
" |
|
53 |
! |
|
54 |
||
55 |
documentation |
|
56 |
" |
|
13548 | 57 |
This class implements complex numbers. |
58 |
A complex number has real and imaginary parts which must be manipulated simultaneously |
|
7355 | 59 |
in any numeric processing. |
60 |
Complex numbers can be used in many of the same places that regular numbers |
|
61 |
can be used with one major exception of comparisons, since complex numbers cannot |
|
13548 | 62 |
be directly compared for size |
7355 | 63 |
(except through lengths of vectors (see absolute value)). |
265 | 64 |
|
7355 | 65 |
[Instance variables:] |
66 |
real <Number> the part of the number which can be expressed as a Real number |
|
67 |
imaginary <Number> the part of the number which, in terms of how the number behaves, |
|
13548 | 68 |
has been multiplied by 'i' (-1 sqrt) |
265 | 69 |
|
7355 | 70 |
[Author:] |
13548 | 71 |
Kurt Hebel (hebel@uinova.cerl.uiuc.edu) |
72 |
minor changes and double dispatching code by cg. |
|
3637 | 73 |
" |
6500 | 74 |
! |
75 |
||
7355 | 76 |
examples |
6500 | 77 |
" |
78 |
(5 % 7) real |
|
79 |
(5 % 7) imaginary |
|
80 |
(5 % 7) = 5 |
|
13548 | 81 |
(5 % 0) = 5 |
82 |
(5.0 % 0) = 5 |
|
7221 | 83 |
|
13548 | 84 |
(1 % 0) + (2 % 0) |
85 |
(1 % 0) + (0 % 2) |
|
7221 | 86 |
(1 % 0) + (2 % 3) |
87 |
||
13548 | 88 |
(1 % 0) * (2 % 0) |
89 |
(1 % 0) * (0 % 2) |
|
7221 | 90 |
(1 % 0) * (2 % 3) |
7355 | 91 |
|
92 |
(1 % 2) + 2 |
|
93 |
(1 % 2) * 2 |
|
13548 | 94 |
2 + (1 % 2) |
95 |
2 * (1 % 2) |
|
7355 | 96 |
|
6500 | 97 |
" |
3637 | 98 |
! ! |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
99 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
100 |
!Complex class methodsFor:'instance creation'! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
101 |
|
9128 | 102 |
abs:aNumber1 arg:aNumber2 |
103 |
|real imaginary| |
|
104 |
||
105 |
real := aNumber1 * aNumber2 cos. |
|
106 |
imaginary := aNumber1 * aNumber2 sin. |
|
107 |
^ real + imaginary i |
|
108 |
! |
|
109 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
110 |
fromReal: aNumber |
7355 | 111 |
"Create a new complex number from the given real number." |
112 |
||
113 |
^ self basicNew setReal: aNumber setImaginary: 0 |
|
114 |
! |
|
115 |
||
116 |
imaginary: v |
|
117 |
"Create a new complex number with 0 as real and given imaginary parts. |
|
118 |
If the imaginary part is zero, return the real part of the number." |
|
119 |
||
120 |
v = 0 ifTrue: [^ 0]. |
|
121 |
^ self basicNew setReal: 0 setImaginary: v |
|
122 |
! |
|
123 |
||
124 |
real: aNumber |
|
125 |
"Create a new complex number from the given real number." |
|
126 |
||
127 |
^ self basicNew setReal: aNumber setImaginary: 0 |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
128 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
129 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
130 |
real: u imaginary: v |
7355 | 131 |
"Create a new complex number with the given real and imaginary parts. If the |
132 |
imaginary part is zero, return the real part of the number." |
|
133 |
||
134 |
v = 0 ifTrue: [^ u]. |
|
135 |
^ self basicNew setReal: u setImaginary: v |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
136 |
! ! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
137 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
138 |
!Complex class methodsFor:'constants access'! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
139 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
140 |
unity |
7355 | 141 |
"Answer the value which allows, for any given arithmetic value, the following to be true: |
13548 | 142 |
aNumber * aNumber class unity = aNumber |
7355 | 143 |
This must be true regardless of how a given subclass chooses to define #*" |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
144 |
|
7355 | 145 |
ComplexOne isNil ifTrue:[ |
13548 | 146 |
ComplexOne := self fromReal: 1 |
7355 | 147 |
]. |
148 |
^ ComplexOne |
|
265 | 149 |
! |
150 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
151 |
zero |
7355 | 152 |
"Answer the value which allows, for any given arithmetic value, the following to be true: |
13548 | 153 |
aNumber + aNumber class zero = aNumber |
7355 | 154 |
This must be true regardless of how a given subclass chooses to define #+" |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
155 |
|
7355 | 156 |
ComplexZero isNil ifTrue:[ |
13548 | 157 |
ComplexZero := self fromReal: 0 |
7355 | 158 |
]. |
159 |
^ ComplexZero |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
160 |
! ! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
161 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
162 |
!Complex class methodsFor:'exception handling'! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
163 |
|
7404 | 164 |
trapImaginary:aBlock |
165 |
"evaluate aBlock; if any DomainError occurs inside, with respect to square roots, |
|
166 |
convert the root to a complex root and proceed. |
|
167 |
This allows for regular (failing) code to transparently convert to complex." |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
168 |
|
7404 | 169 |
|send| |
170 |
||
171 |
^ ImaginaryResultError handle: [:ex | |
|
13548 | 172 |
|selector| |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
173 |
|
13548 | 174 |
send := ex parameter. |
175 |
selector := send selector. |
|
176 |
(selector = #sqrt or: [selector = #sqrtTruncated]) ifTrue: [ |
|
177 |
send receiver: send receiver asComplex. |
|
178 |
ex proceedWith: send value |
|
179 |
] ifFalse: [ |
|
180 |
ex reject |
|
181 |
] |
|
7404 | 182 |
] do: aBlock |
183 |
||
184 |
" |
|
13548 | 185 |
Complex trapImaginary: [-2 sqrt] |
7404 | 186 |
" |
187 |
||
188 |
"failing code: |
|
13548 | 189 |
|a| |
7404 | 190 |
|
13548 | 191 |
a := -2. |
192 |
(a sqrt + 5) * 17. |
|
7404 | 193 |
" |
194 |
"complex code: |
|
13548 | 195 |
|a| |
7404 | 196 |
|
13548 | 197 |
Complex trapImaginary:[ |
198 |
a := -2. |
|
199 |
(a sqrt + 5) * 2. |
|
200 |
] |
|
7404 | 201 |
" |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
202 |
! ! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
203 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
204 |
!Complex methodsFor:'accessing'! |
265 | 205 |
|
206 |
imaginary |
|
7355 | 207 |
"Return the imaginary part of the complex number." |
208 |
||
209 |
^ imaginary |
|
210 |
! |
|
211 |
||
212 |
imaginaryPart |
|
213 |
"Return the imaginary part of the complex number. |
|
214 |
An alias for imaginary (for compatibility with other complex implementations)" |
|
215 |
||
216 |
^ imaginary |
|
265 | 217 |
! |
218 |
||
219 |
real |
|
7355 | 220 |
"Return the real part of the complex number." |
221 |
||
222 |
^ real |
|
223 |
! |
|
224 |
||
225 |
realPart |
|
226 |
"Return the real part of the complex number. |
|
227 |
An alias for real (for compatibility with other complex implementations)" |
|
228 |
||
229 |
^ real |
|
265 | 230 |
! ! |
231 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
232 |
!Complex methodsFor:'arithmetic'! |
265 | 233 |
|
13548 | 234 |
* aNumber |
7355 | 235 |
"Return the product of the receiver and the argument." |
265 | 236 |
|
7355 | 237 |
"/ | u v r i | |
238 |
"/ |
|
239 |
"/ aNumber isComplex ifTrue:[ |
|
240 |
"/ u := aNumber real. |
|
241 |
"/ v := aNumber imaginary. |
|
242 |
"/ r := (real * u) - (imaginary * v). |
|
243 |
"/ i := (real * v) + (imaginary * u). |
|
244 |
"/ i = 0 ifTrue:[ ^ r ]. |
|
245 |
"/ ^ Complex real:r imaginary:i |
|
246 |
"/ ]. |
|
13548 | 247 |
^ aNumber productFromComplex:self. |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
248 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
249 |
"Modified: / 8.7.1998 / 12:12:37 / cg" |
265 | 250 |
! |
251 |
||
13548 | 252 |
+ aNumber |
7355 | 253 |
"Return the sum of the receiver and the argument." |
265 | 254 |
|
7355 | 255 |
"/ | r i | |
256 |
"/ |
|
257 |
"/ aNumber isComplex ifTrue: [ |
|
258 |
"/ r := aNumber real + real. |
|
259 |
"/ i := aNumber imaginary + imaginary. |
|
260 |
"/ i = 0 ifTrue:[ ^ r ]. |
|
261 |
"/ ^ Complex real:r imaginary:i |
|
262 |
"/ ]. |
|
13548 | 263 |
^ aNumber sumFromComplex:self. |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
264 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
265 |
"Modified: / 8.7.1998 / 12:15:42 / cg" |
265 | 266 |
! |
267 |
||
268 |
- aNumber |
|
7355 | 269 |
"Return the difference of the receiver and the argument." |
265 | 270 |
|
7355 | 271 |
"/ | r i | |
272 |
"/ |
|
273 |
"/ aNumber isComplex ifTrue: [ |
|
274 |
"/ r := real - aNumber real. |
|
275 |
"/ i := imaginary - aNumber imaginary. |
|
276 |
"/ i = 0 ifTrue:[ ^ r ]. |
|
277 |
"/ ^ Complex real:r imaginary:i. |
|
278 |
"/ ]. |
|
13548 | 279 |
^ aNumber differenceFromComplex:self. |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
280 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
281 |
"Modified: / 8.7.1998 / 12:15:38 / cg" |
265 | 282 |
! |
283 |
||
13548 | 284 |
/ aNumber |
7355 | 285 |
"Return the quotient of the receiver and the argument." |
265 | 286 |
|
7355 | 287 |
"/ | denom u v r i | |
288 |
"/ |
|
13548 | 289 |
"/ aNumber isComplex ifTrue:[ |
7355 | 290 |
"/ u := aNumber real. |
291 |
"/ v := aNumber imaginary. |
|
292 |
"/ denom := u * u + (v * v). |
|
293 |
"/ r := u * real + (v * imaginary) / denom. |
|
294 |
"/ i := u * imaginary - (v * real) / denom. |
|
295 |
"/ i = 0 ifTrue:[ ^ r ]. |
|
296 |
"/ ^ Complex real:r imaginary:i |
|
297 |
"/ ]. |
|
13548 | 298 |
^ aNumber quotientFromComplex:self. |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
299 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
300 |
"Modified: / 8.7.1998 / 12:15:34 / cg" |
265 | 301 |
! |
302 |
||
303 |
abs |
|
7355 | 304 |
"Return the magnitude (or absolute value) of the complex number |
20408 | 305 |
(that's the distance from the origin in the complex plane)." |
265 | 306 |
|
7355 | 307 |
^ (real * real + (imaginary * imaginary)) sqrt |
308 |
||
309 |
" |
|
310 |
(1 % 1) abs |
|
311 |
" |
|
265 | 312 |
! |
313 |
||
314 |
conjugated |
|
7355 | 315 |
"Return the complex conjugate of this complex number |
316 |
(i.e. with imaginary part negated)." |
|
317 |
||
16449 | 318 |
^ self class |
319 |
real: real |
|
320 |
imaginary: imaginary negated |
|
7355 | 321 |
! |
322 |
||
323 |
modulus |
|
324 |
| absReal absImag multiplicand quotient | |
|
325 |
||
326 |
absReal := real abs. |
|
327 |
absImag := imaginary abs. |
|
328 |
||
13548 | 329 |
absReal >= absImag ifTrue: [ |
330 |
multiplicand := absReal. |
|
331 |
quotient := imaginary / real |
|
332 |
] ifFalse: [ |
|
333 |
multiplicand := absImag. |
|
334 |
quotient := real / imaginary |
|
7355 | 335 |
]. |
336 |
^ multiplicand * ((1 + (quotient * quotient)) sqrt) |
|
337 |
! |
|
338 |
||
339 |
negated |
|
340 |
"return a new complex with both real and imaginary parts negated" |
|
341 |
||
16449 | 342 |
^ self class |
343 |
real: real negated |
|
344 |
imaginary: imaginary negated |
|
265 | 345 |
! ! |
346 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
347 |
!Complex methodsFor:'coercing'! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
348 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
349 |
coerce: aNumber |
18836 | 350 |
"convert the argument aNumber into an instance of the receiver's class and return it." |
351 |
||
7355 | 352 |
^ aNumber asComplex |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
353 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
354 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
355 |
generality |
7355 | 356 |
^ 150 |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
357 |
! ! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
358 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
359 |
!Complex methodsFor:'comparing'! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
360 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
361 |
< aNumber |
7355 | 362 |
"raises an error - complex numbers are not well ordered" |
363 |
||
364 |
^ Number |
|
13548 | 365 |
raise: #unorderedSignal |
366 |
receiver: self |
|
367 |
selector: #< |
|
368 |
arg: aNumber |
|
369 |
errorString: 'Complex numbers are not well ordered' |
|
7355 | 370 |
|
371 |
" |
|
372 |
1 < (2 % 2) |
|
373 |
(2 % 2) < 1 |
|
374 |
" |
|
6500 | 375 |
! |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
376 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
377 |
= aNumber |
7355 | 378 |
"return true, if the argument represents the same numeric value |
7471 | 379 |
as the receiver, false otherwise." |
7355 | 380 |
|
13548 | 381 |
^ aNumber equalFromComplex:self |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
382 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
383 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
384 |
hash |
7355 | 385 |
"Hash is implemented because equals is implemented." |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
386 |
|
7377 | 387 |
^ (real hash) bitXor:(imaginary hash bitShift:16) |
388 |
||
389 |
" |
|
13548 | 390 |
(1+0i) hash |
7377 | 391 |
(1+1i) hash |
392 |
" |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
393 |
! ! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
394 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
395 |
!Complex methodsFor:'converting'! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
396 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
397 |
asComplex |
7355 | 398 |
"I am a complex - so return the receiver" |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
399 |
|
7355 | 400 |
^ self |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
401 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
402 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
403 |
asFloat |
7355 | 404 |
imaginary = 0 ifTrue: [^ real asFloat]. |
405 |
^ Number |
|
13548 | 406 |
raise: #coercionErrorSignal |
407 |
receiver: self |
|
408 |
selector: #asFloat |
|
409 |
errorString: 'Can''t coerce an instance of Complex to a Float' |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
410 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
411 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
412 |
asInteger |
7355 | 413 |
imaginary = 0 ifTrue: [^real asInteger]. |
414 |
^ Number |
|
13548 | 415 |
raise: #coercionErrorSignal |
416 |
receiver: self |
|
417 |
selector: #asInteger |
|
418 |
errorString: 'Can''t coerce an instance of Complex to an Integer' |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
419 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
420 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
421 |
asPoint |
7355 | 422 |
"Return the complex number as a point." |
423 |
||
424 |
^ real @ imaginary |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
425 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
426 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
427 |
reduceGeneralityIfPossible |
13548 | 428 |
"Answer the receiver transformed to a lower generality, if such a |
429 |
transformation is possible without losing information. |
|
7355 | 430 |
If not, answer the receiver" |
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
431 |
|
7355 | 432 |
imaginary isZero |
13548 | 433 |
ifTrue: [^ real] |
434 |
ifFalse: [^ self] |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
435 |
! ! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
436 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
437 |
!Complex methodsFor:'double dispatching'! |
265 | 438 |
|
9128 | 439 |
differenceFromComplex:aComplex |
440 |
"Return the difference of the argument, aComplex and the receiver." |
|
441 |
||
442 |
| r i | |
|
443 |
||
444 |
r := aComplex real - real. |
|
445 |
i := aComplex imaginary - imaginary. |
|
446 |
i = 0 ifTrue:[ ^ r ]. |
|
16449 | 447 |
^ self class real:r imaginary:i. |
9128 | 448 |
! |
449 |
||
20740 | 450 |
differenceFromFixedPoint: aFixedPoint |
21110 | 451 |
"Return the difference of the argument, aFixedPoint and the receiver." |
452 |
||
20740 | 453 |
^ aFixedPoint asComplex - self |
454 |
! |
|
455 |
||
7355 | 456 |
differenceFromFloat:aFloat |
457 |
"Return the difference of the argument, aFloat and the receiver." |
|
458 |
||
459 |
"/ ^ aFloat asComplex - self |
|
460 |
||
461 |
| r | |
|
265 | 462 |
|
7355 | 463 |
r := aFloat - real. |
464 |
imaginary = 0 ifTrue:[ ^ r ]. |
|
16449 | 465 |
^ self class real:r imaginary:imaginary negated |
7355 | 466 |
|
467 |
" |
|
13548 | 468 |
(1 % 1) - 1.0 |
469 |
1.0 - (1 % 1) |
|
7355 | 470 |
" |
265 | 471 |
! |
472 |
||
7355 | 473 |
differenceFromFraction: aFraction |
21110 | 474 |
"Return the difference of the argument, aFraction and the receiver." |
475 |
||
7355 | 476 |
^ aFraction asComplex - self |
477 |
! |
|
478 |
||
479 |
differenceFromInteger: anInteger |
|
21110 | 480 |
"Return the difference of the argument, anInteger and the receiver." |
481 |
||
7355 | 482 |
^ anInteger asComplex - self |
265 | 483 |
! |
484 |
||
7355 | 485 |
equalFromComplex:aComplex |
486 |
^ (aComplex real = real) and:[aComplex imaginary = imaginary] |
|
265 | 487 |
! |
488 |
||
7355 | 489 |
equalFromFloat:aFloat |
490 |
imaginary = 0 ifFalse:[^ false]. |
|
491 |
^ real = aFloat |
|
265 | 492 |
! |
493 |
||
13548 | 494 |
productFromComplex:aComplex |
9128 | 495 |
"Return the product of the receiver and the argument, aComplex." |
496 |
||
497 |
| u v r i | |
|
498 |
||
499 |
u := aComplex real. |
|
500 |
v := aComplex imaginary. |
|
501 |
r := (real * u) - (imaginary * v). |
|
502 |
i := (real * v) + (imaginary * u). |
|
503 |
i = 0 ifTrue:[ ^ r ]. |
|
16449 | 504 |
^ self class real:r imaginary:i |
9128 | 505 |
! |
506 |
||
20740 | 507 |
productFromFixedPoint: aFixedPoint |
21110 | 508 |
"Return the product of the receiver and the argument, aFixedPoint." |
509 |
||
20740 | 510 |
^ aFixedPoint asComplex * self |
511 |
! |
|
512 |
||
7355 | 513 |
productFromFloat: aFloat |
514 |
"Return the product of the receiver and the argument, aFloat." |
|
515 |
||
516 |
"/ ^ aFloat asComplex * self |
|
517 |
||
518 |
| u r i | |
|
519 |
||
520 |
u := aFloat. |
|
521 |
r := (real * aFloat). |
|
522 |
i := (imaginary * aFloat). |
|
523 |
i = 0 ifTrue:[ ^ r ]. |
|
16449 | 524 |
^ self class real:r imaginary:i |
7355 | 525 |
|
526 |
" |
|
13548 | 527 |
(1 % 1) * 2.0 |
528 |
(1 % 1) * 0.0 |
|
7355 | 529 |
2.0 * (1 % 1) |
530 |
" |
|
265 | 531 |
! |
532 |
||
7355 | 533 |
productFromFraction: aFraction |
21110 | 534 |
"Return the product of the receiver and the argument, aFraction." |
535 |
||
7355 | 536 |
^ aFraction asComplex * self |
265 | 537 |
! |
538 |
||
7355 | 539 |
productFromInteger: anInteger |
21110 | 540 |
"Return the product of the receiver and the argument, anInteger." |
541 |
||
7355 | 542 |
^ anInteger asComplex * self |
543 |
! |
|
544 |
||
13548 | 545 |
quotientFromComplex:aComplex |
9128 | 546 |
"Return the quotient of the argument, aComplex and the receiver." |
547 |
||
548 |
| denom nr ni r i | |
|
549 |
||
550 |
nr := aComplex real. |
|
551 |
ni := aComplex imaginary. |
|
552 |
denom := real * real + (imaginary * imaginary). |
|
16449 | 553 |
r := (real * nr + (imaginary * ni)) / denom. |
554 |
i := (real * ni - (imaginary * nr)) / denom. |
|
9128 | 555 |
i = 0 ifTrue:[ ^ r ]. |
16449 | 556 |
^ self class real:r imaginary:i |
9128 | 557 |
|
558 |
"/ is the stuff below better ? |
|
13548 | 559 |
"/ "Implement complex division (a + ib) / (c + id). |
9128 | 560 |
"/ Due to double dispatch, in this routine |
561 |
"/ self = (c + id) and aComplex = (a + ib)." |
|
562 |
"/ |
|
563 |
"/ | quotient denominator | |
|
564 |
"/ |
|
565 |
"/ self realPart abs >= (self imaginaryPart abs) |
|
13548 | 566 |
"/ ifTrue: [ |
9128 | 567 |
"/ quotient := self imaginaryPart / self realPart. |
568 |
"/ denominator := self realPart + (self imaginaryPart * quotient). |
|
13548 | 569 |
"/ ^ Complex |
9128 | 570 |
"/ real: (aComplex realPart + (aComplex imaginaryPart * quotient)) / denominator |
571 |
"/ imaginary: (aComplex imaginaryPart - (aComplex realPart * quotient)) / denominator ] |
|
13548 | 572 |
"/ ifFalse: [ |
9128 | 573 |
"/ quotient := self realPart / self imaginaryPart. |
574 |
"/ denominator := (self realPart * quotient) + self imaginaryPart. |
|
13548 | 575 |
"/ ^ Complex |
9128 | 576 |
"/ real: ((aComplex realPart * quotient) + aComplex imaginaryPart) / denominator |
577 |
"/ imaginary: ((aComplex imaginaryPart * quotient) - aComplex realPart) / denominator ] |
|
578 |
! |
|
579 |
||
20740 | 580 |
quotientFromFixedPoint:aFixedPoint |
581 |
"Return the quotient of the argument, aFixedPoint and the receiver." |
|
582 |
||
583 |
^ aFixedPoint asComplex / self |
|
584 |
! |
|
585 |
||
7442 | 586 |
quotientFromFloat:aFloat |
587 |
"Return the quotient of the argument, aFloat and the receiver." |
|
588 |
||
7355 | 589 |
^ aFloat asComplex / self |
265 | 590 |
! |
591 |
||
7442 | 592 |
quotientFromFraction:aFraction |
593 |
"Return the quotient of the argument, aFraction and the receiver." |
|
594 |
||
7355 | 595 |
^ aFraction asComplex / self |
596 |
! |
|
597 |
||
7442 | 598 |
quotientFromInteger:anInteger |
599 |
"Return the quotient of the argument, anInteger and the receiver." |
|
600 |
||
7355 | 601 |
^ anInteger asComplex / self |
265 | 602 |
! |
603 |
||
13548 | 604 |
sumFromComplex:aComplex |
9128 | 605 |
"Return the sum of the receiver and the argument, aComplex." |
606 |
||
607 |
| r i | |
|
608 |
||
609 |
r := aComplex real + real. |
|
610 |
i := aComplex imaginary + imaginary. |
|
611 |
i = 0 ifTrue:[ ^ r ]. |
|
16449 | 612 |
^ self class real:r imaginary:i |
9128 | 613 |
! |
614 |
||
20740 | 615 |
sumFromFixedPoint: aFixedPoint |
21110 | 616 |
"Return the sum of the receiver and the argument, aFixedPoint." |
617 |
||
20740 | 618 |
^ aFixedPoint asComplex + self |
619 |
! |
|
620 |
||
7355 | 621 |
sumFromFloat: aFloat |
622 |
"Return the sum of the receiver and the argument, aFloat." |
|
623 |
||
624 |
"/ ^ aFloat asComplex + self |
|
625 |
||
626 |
| r | |
|
627 |
||
628 |
r := aFloat + real. |
|
629 |
imaginary = 0 ifTrue:[ ^ r ]. |
|
16449 | 630 |
^ self class real:r imaginary:imaginary |
7355 | 631 |
|
632 |
" |
|
13548 | 633 |
(1 % 1) + 1.0 |
634 |
1.0 + (1 % 1) |
|
7355 | 635 |
" |
265 | 636 |
! |
637 |
||
7355 | 638 |
sumFromFraction: aFraction |
21110 | 639 |
"Return the sum of the receiver and the argument, aFraction." |
640 |
||
7355 | 641 |
^ aFraction asComplex + self |
265 | 642 |
! |
643 |
||
7355 | 644 |
sumFromInteger: anInteger |
21110 | 645 |
"Return the sum of the receiver and the argument, anInteger." |
646 |
||
7355 | 647 |
^ anInteger asComplex + self |
265 | 648 |
! ! |
649 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
650 |
!Complex methodsFor:'mathematical functions'! |
265 | 651 |
|
652 |
angle |
|
7355 | 653 |
"Return the radian angle for this Complex number." |
265 | 654 |
|
7355 | 655 |
real < 0 ifTrue: [ |
13548 | 656 |
imaginary < 0 ifTrue: [ |
657 |
^ (imaginary / real) arcTan - Float pi |
|
658 |
]. |
|
659 |
^ Float pi + (imaginary / real) arcTan |
|
7355 | 660 |
]. |
661 |
^ (imaginary / real) arcTan |
|
662 |
||
663 |
" |
|
664 |
(1 % 1) angle radiansToDegrees |
|
665 |
" |
|
265 | 666 |
! |
667 |
||
668 |
exp |
|
7355 | 669 |
"Return the complex exponential of the receiver." |
265 | 670 |
|
7355 | 671 |
^ (imaginary cos % imaginary sin) * real exp |
265 | 672 |
! |
673 |
||
674 |
sqrt |
|
7355 | 675 |
"Return the square root of the receiver" |
676 |
||
677 |
| w quotient absReal absImag | |
|
678 |
||
13548 | 679 |
((real = 0) and: [ imaginary = 0 ]) ifTrue: [ |
16449 | 680 |
^ self class zero |
7355 | 681 |
]. |
682 |
absReal := real abs. |
|
683 |
absImag := imaginary abs. |
|
684 |
||
13548 | 685 |
absReal >= absImag ifTrue:[ |
16449 | 686 |
quotient := imaginary / real. |
687 |
w := (absReal sqrt) * (((1 + (1 + (quotient * quotient)) sqrt) / 2) sqrt) |
|
13548 | 688 |
] ifFalse: [ |
16449 | 689 |
quotient := real / imaginary. |
690 |
w := (absImag sqrt) * (((quotient abs + (1 + (quotient * quotient)) sqrt) / 2) sqrt) |
|
7355 | 691 |
]. |
265 | 692 |
|
13548 | 693 |
real >= 0 ifTrue:[ |
16449 | 694 |
^ self class real: w imaginary: (imaginary / (2 * w)) |
7355 | 695 |
]. |
13548 | 696 |
imaginary >= 0 ifTrue: [ |
16449 | 697 |
^ self class real: absImag / (2 * w) imaginary: w |
7355 | 698 |
]. |
16449 | 699 |
^ self class real: absImag / (2 * w) imaginary: -1 * w |
7355 | 700 |
! |
701 |
||
702 |
sqrt_bad |
|
703 |
"Return the square root of the receiver" |
|
265 | 704 |
|
7355 | 705 |
| u v | |
706 |
||
707 |
(imaginary = 0 and: [real >= 0]) ifTrue: [^ real sqrt]. |
|
16449 | 708 |
v := ((self abs - real) / 2) sqrt. |
7355 | 709 |
u := imaginary / 2 / v. |
16449 | 710 |
^ self class real: u imaginary: v |
7355 | 711 |
|
712 |
" |
|
13548 | 713 |
-4 asComplex sqrt |
714 |
4 asComplex sqrt |
|
7355 | 715 |
" |
716 |
" |
|
13548 | 717 |
-4 asComplex sqrt squared |
7355 | 718 |
" |
265 | 719 |
! ! |
720 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
721 |
!Complex methodsFor:'printing'! |
265 | 722 |
|
16742 | 723 |
displayOn: aGCOrStream |
724 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
|
725 |
"/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
|
726 |
(aGCOrStream isStream) ifFalse:[ |
|
727 |
^ super displayOn:aGCOrStream |
|
728 |
]. |
|
729 |
aGCOrStream nextPut: $(. |
|
730 |
self realPart printOn: aGCOrStream. |
|
7355 | 731 |
self imaginaryPart >= 0 |
16742 | 732 |
ifTrue: [ aGCOrStream nextPut: $+ ] |
733 |
ifFalse: [ aGCOrStream nextPut: $- ]. |
|
734 |
self imaginaryPart abs printOn: aGCOrStream. |
|
735 |
aGCOrStream nextPutAll: 'i)' |
|
7355 | 736 |
|
737 |
" |
|
738 |
Complex real:1 imaginary:1 |
|
739 |
" |
|
740 |
! |
|
741 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
742 |
printOn: aStream |
7355 | 743 |
aStream nextPut: $(. |
744 |
real storeOn: aStream. |
|
745 |
aStream nextPutAll: '%'. |
|
746 |
imaginary storeOn: aStream. |
|
747 |
aStream nextPut: $). |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
748 |
! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
749 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
750 |
printString |
7355 | 751 |
^ '(' , real printString, '%', imaginary printString, ')' |
265 | 752 |
! |
753 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
754 |
storeOn: aStream |
7355 | 755 |
self printOn:aStream |
265 | 756 |
! ! |
757 |
||
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
758 |
!Complex methodsFor:'private'! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
759 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
760 |
setReal: u setImaginary: v |
7355 | 761 |
real := u. |
762 |
imaginary := v. |
|
3633
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
763 |
! ! |
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
764 |
|
89f1f31527f4
avoid a send if the result of an arithmetic op
Claus Gittinger <cg@exept.de>
parents:
1944
diff
changeset
|
765 |
!Complex methodsFor:'testing'! |
265 | 766 |
|
767 |
isComplex |
|
7355 | 768 |
"Answer whether the receiver has an imaginary part |
769 |
(i.e. if it is a complex number). Always true here." |
|
265 | 770 |
|
7355 | 771 |
^ true |
265 | 772 |
! |
773 |
||
774 |
isReal |
|
7355 | 775 |
"Return true if this Complex number has a zero imaginary part." |
776 |
||
777 |
^ imaginary = 0 |
|
265 | 778 |
! |
779 |
||
780 |
isZero |
|
13548 | 781 |
"Answer whether 'self = self class zero'. |
7355 | 782 |
We can't use #= because #= is defined in terms of #isZero" |
265 | 783 |
|
7355 | 784 |
^real isZero and: [imaginary isZero] |
265 | 785 |
! |
786 |
||
787 |
sign |
|
7471 | 788 |
"return a new complex, consisting of the signs of the real and imaginary parts. |
789 |
Q: is this a good thing to do ?" |
|
265 | 790 |
|
16449 | 791 |
^ self class real: real sign imaginary: imaginary sign |
7355 | 792 |
! ! |
793 |
||
794 |
!Complex methodsFor:'truncation & rounding'! |
|
795 |
||
796 |
ceiling |
|
797 |
"blocked: complex numbers have no ceiling" |
|
798 |
||
799 |
^ self shouldNotImplement |
|
800 |
! |
|
801 |
||
802 |
floor |
|
803 |
"blocked: complex numbers have no floor" |
|
804 |
||
805 |
^ self shouldNotImplement |
|
265 | 806 |
! ! |
807 |
||
3637 | 808 |
!Complex class methodsFor:'documentation'! |
809 |
||
810 |
version |
|
18836 | 811 |
^ '$Header$' |
3637 | 812 |
! ! |
16449 | 813 |