Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Math-Complex/PMVector.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ Extension { #name : #PMVector }
PMVector >> adaptToComplex: rcvr andSend: selector [
^ self collect: [ :ea | rcvr perform: selector with: ea ]
]

{ #category : #'*Math-Complex' }
PMVector >> isReal [

"Answer true if all values of the vector are real numbers"

^ self allSatisfy: [ :each | each isRealNumber ]
]
13 changes: 13 additions & 0 deletions src/Math-Core/ManifestMathCore.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"
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
"
Class {
#name : #ManifestMathCore,
#superclass : #PackageManifest,
#category : #'Math-Core-Manifest'
}

{ #category : #'meta-data - dependency analyser' }
ManifestMathCore class >> manuallyResolvedDependencies [
^ #(#'Transcript-Core' #'Math-Operations-Extensions')
]
6 changes: 0 additions & 6 deletions src/Math-Core/PMVector.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ PMVector >> householder [
^Array with: b with: v
]

{ #category : #testing }
PMVector >> isReal [
"Answer true if all values of the vector are real numbers"
^ self allSatisfy: [ :each | each isRealNumber ].
]

{ #category : #testing }
PMVector >> isZero [
^ self allSatisfy: [ :element | element = 0 ]
Expand Down
16 changes: 16 additions & 0 deletions src/Math-Tests-Complex/PMComplexNumberTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,22 @@ PMComplexNumberTest >> testIsRealNumberOnReal [
self assert: 0.5 isRealNumber
]

{ #category : #tests }
PMComplexNumberTest >> testIsRealOnComplexVector [

| vector |
vector := { 1. 4. -2. (0.5 + 3 i) } asPMVector.
self deny: vector isReal
]

{ #category : #tests }
PMComplexNumberTest >> testIsRealOnRealVector [

| vector |
vector := #( 1 4 -2 0.5 ) asPMVector.
self assert: vector isReal
]

{ #category : #'testing - mathematical functions' }
PMComplexNumberTest >> testLn [
self assert: (Float e + 0 i) ln equals: Float e ln "See Bug 1815 on Mantis"
Expand Down
14 changes: 0 additions & 14 deletions src/Math-Tests-Core/PMVectorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,6 @@ PMVectorTest >> testHouseholder [
assert: (w at: 2) asArray equals: #(1.0 -1.6180158992689828).
]

{ #category : #tests }
PMVectorTest >> testIsRealOnComplexVector [
| vector |
vector := { 1 . 4 . -2 . 0.5 + 3i } asPMVector.
self deny: vector isReal.
]

{ #category : #tests }
PMVectorTest >> testIsRealOnRealVector [
| vector |
vector := #(1 4 -2 0.5) asPMVector.
self assert: vector isReal.
]

{ #category : #tests }
PMVectorTest >> testLessThan [
| vec vecCopy |
Expand Down