diff --git a/src/Math-Complex/PMVector.extension.st b/src/Math-Complex/PMVector.extension.st index c9d2e666..4aa611eb 100644 --- a/src/Math-Complex/PMVector.extension.st +++ b/src/Math-Complex/PMVector.extension.st @@ -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 ] +] diff --git a/src/Math-Core/ManifestMathCore.class.st b/src/Math-Core/ManifestMathCore.class.st new file mode 100644 index 00000000..258ce9ce --- /dev/null +++ b/src/Math-Core/ManifestMathCore.class.st @@ -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') +] diff --git a/src/Math-Core/PMVector.class.st b/src/Math-Core/PMVector.class.st index 20beb4db..c566a150 100644 --- a/src/Math-Core/PMVector.class.st +++ b/src/Math-Core/PMVector.class.st @@ -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 ] diff --git a/src/Math-Tests-Complex/PMComplexNumberTest.class.st b/src/Math-Tests-Complex/PMComplexNumberTest.class.st index 50f9948f..e7d9c779 100644 --- a/src/Math-Tests-Complex/PMComplexNumberTest.class.st +++ b/src/Math-Tests-Complex/PMComplexNumberTest.class.st @@ -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" diff --git a/src/Math-Tests-Core/PMVectorTest.class.st b/src/Math-Tests-Core/PMVectorTest.class.st index 51a433b6..23442b5d 100644 --- a/src/Math-Tests-Core/PMVectorTest.class.st +++ b/src/Math-Tests-Core/PMVectorTest.class.st @@ -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 |