Skip to content

Commit 6eb4692

Browse files
authored
Merge pull request #292 from jecisc/cut-dependency-from-Core-to-Complex
Cut dependency from Core to Complex.
2 parents 95f6f9a + b2e0e55 commit 6eb4692

File tree

5 files changed

+37
-20
lines changed

5 files changed

+37
-20
lines changed

src/Math-Complex/PMVector.extension.st

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,11 @@ Extension { #name : #PMVector }
44
PMVector >> adaptToComplex: rcvr andSend: selector [
55
^ self collect: [ :ea | rcvr perform: selector with: ea ]
66
]
7+
8+
{ #category : #'*Math-Complex' }
9+
PMVector >> isReal [
10+
11+
"Answer true if all values of the vector are real numbers"
12+
13+
^ self allSatisfy: [ :each | each isRealNumber ]
14+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"
2+
Please describe the package using the class comment of the included manifest class. The manifest class also includes other additional metadata for the package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser
3+
"
4+
Class {
5+
#name : #ManifestMathCore,
6+
#superclass : #PackageManifest,
7+
#category : #'Math-Core-Manifest'
8+
}
9+
10+
{ #category : #'meta-data - dependency analyser' }
11+
ManifestMathCore class >> manuallyResolvedDependencies [
12+
^ #(#'Transcript-Core' #'Math-Operations-Extensions')
13+
]

src/Math-Core/PMVector.class.st

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,6 @@ PMVector >> householder [
214214
^Array with: b with: v
215215
]
216216

217-
{ #category : #testing }
218-
PMVector >> isReal [
219-
"Answer true if all values of the vector are real numbers"
220-
^ self allSatisfy: [ :each | each isRealNumber ].
221-
]
222-
223217
{ #category : #testing }
224218
PMVector >> isZero [
225219
^ self allSatisfy: [ :element | element = 0 ]

src/Math-Tests-Complex/PMComplexNumberTest.class.st

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,22 @@ PMComplexNumberTest >> testIsRealNumberOnReal [
438438
self assert: 0.5 isRealNumber
439439
]
440440

441+
{ #category : #tests }
442+
PMComplexNumberTest >> testIsRealOnComplexVector [
443+
444+
| vector |
445+
vector := { 1. 4. -2. (0.5 + 3 i) } asPMVector.
446+
self deny: vector isReal
447+
]
448+
449+
{ #category : #tests }
450+
PMComplexNumberTest >> testIsRealOnRealVector [
451+
452+
| vector |
453+
vector := #( 1 4 -2 0.5 ) asPMVector.
454+
self assert: vector isReal
455+
]
456+
441457
{ #category : #'testing - mathematical functions' }
442458
PMComplexNumberTest >> testLn [
443459
self assert: (Float e + 0 i) ln equals: Float e ln "See Bug 1815 on Mantis"

src/Math-Tests-Core/PMVectorTest.class.st

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,6 @@ PMVectorTest >> testHouseholder [
8484
assert: (w at: 2) asArray equals: #(1.0 -1.6180158992689828).
8585
]
8686

87-
{ #category : #tests }
88-
PMVectorTest >> testIsRealOnComplexVector [
89-
| vector |
90-
vector := { 1 . 4 . -2 . 0.5 + 3i } asPMVector.
91-
self deny: vector isReal.
92-
]
93-
94-
{ #category : #tests }
95-
PMVectorTest >> testIsRealOnRealVector [
96-
| vector |
97-
vector := #(1 4 -2 0.5) asPMVector.
98-
self assert: vector isReal.
99-
]
100-
10187
{ #category : #tests }
10288
PMVectorTest >> testLessThan [
10389
| vec vecCopy |

0 commit comments

Comments
 (0)