diff --git a/src/Math-Complex/Number.extension.st b/src/Math-Complex/Number.extension.st index 040707be..53031928 100644 --- a/src/Math-Complex/Number.extension.st +++ b/src/Math-Complex/Number.extension.st @@ -13,16 +13,6 @@ Number >> asComplex [ ^ PMComplexNumber real: self imaginary: 0 ] -{ #category : #'*Math-Complex' } -Number >> complexConjugate [ - "The complex conjugate of a complex number (a + bi) is another complex number (a - bi). - Every real number x is also a complex number with imaginary part equal to 0. - In other words, x = x + 0i and x = x - 0i. - Therefore, the complex conjugate of a real number is the same real number" - - ^ self -] - { #category : #'*Math-Complex' } Number >> i [ ^ PMComplexNumber real: 0 imaginary: self diff --git a/src/Math-Matrix/ManifestMathMatrix.class.st b/src/Math-Matrix/ManifestMathMatrix.class.st new file mode 100644 index 00000000..cf149221 --- /dev/null +++ b/src/Math-Matrix/ManifestMathMatrix.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 : #ManifestMathMatrix, + #superclass : #PackageManifest, + #category : #'Math-Matrix-Manifest' +} + +{ #category : #'meta-data - dependency analyser' } +ManifestMathMatrix class >> manuallyResolvedDependencies [ + ^ #(#'Collections-Streams' #'Math-Operations-Extensions') +] diff --git a/src/Math-Matrix/Number.extension.st b/src/Math-Matrix/Number.extension.st index 81af666e..c092e342 100644 --- a/src/Math-Matrix/Number.extension.st +++ b/src/Math-Matrix/Number.extension.st @@ -6,6 +6,18 @@ Number >> addWithRegularMatrix: aMatrix [ ^ PMMatrix rows: (aMatrix rowsCollect: [ :row | row + self ]) ] +{ #category : #'*Math-Matrix' } +Number >> complexConjugate [ + "The complex conjugate of a complex number (a + bi) is another complex number (a - bi). + Every real number x is also a complex number with imaginary part equal to 0. + In other words, x = x + 0i and x = x - 0i. + Therefore, the complex conjugate of a real number is the same real number" + + "Maintenance note: This method is related to complexes but is packaged in Matrix because the version on Number is not dependant of Complexe and is used by matrix algos." + + ^ self +] + { #category : #'*Math-Matrix' } Number >> productWithMatrix: aMatrix [ ^aMatrix class rows: (aMatrix rowsCollect: [:r| self productWithVector: r]) diff --git a/src/Math-Tests-Complex/PMMatrixTest.extension.st b/src/Math-Tests-Complex/PMMatrixTest.extension.st new file mode 100644 index 00000000..44c64fd4 --- /dev/null +++ b/src/Math-Tests-Complex/PMMatrixTest.extension.st @@ -0,0 +1,13 @@ +Extension { #name : #PMMatrixTest } + +{ #category : #'*Math-Tests-Complex' } +PMMatrixTest >> testIsRealOnComplexMatrix [ + | matrix | + + matrix := PMMatrix rows: { + { 1 . 3 + 4i . 0 } . + { 1 - 2i . 2 . -4 } . + { -8 + 0i . 5 . -1 } }. + + self deny: matrix isReal. +] diff --git a/src/Math-Tests-Matrix/ManifestMathTestsMatrix.class.st b/src/Math-Tests-Matrix/ManifestMathTestsMatrix.class.st new file mode 100644 index 00000000..a5521a9d --- /dev/null +++ b/src/Math-Tests-Matrix/ManifestMathTestsMatrix.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 : #ManifestMathTestsMatrix, + #superclass : #PackageManifest, + #category : #'Math-Tests-Matrix-Manifest' +} + +{ #category : #'meta-data - dependency analyser' } +ManifestMathTestsMatrix class >> manuallyResolvedDependencies [ + ^ #(#'Math-Core-Process') +] diff --git a/src/Math-Tests-Matrix/PMMatrixTest.class.st b/src/Math-Tests-Matrix/PMMatrixTest.class.st index 0104706e..95d0d4ce 100644 --- a/src/Math-Tests-Matrix/PMMatrixTest.class.st +++ b/src/Math-Tests-Matrix/PMMatrixTest.class.st @@ -252,18 +252,6 @@ PMMatrixTest >> testInverseSingularMatrixError [ raise: PMSingularMatrixError. ] -{ #category : #tests } -PMMatrixTest >> testIsRealOnComplexMatrix [ - | matrix | - - matrix := PMMatrix rows: { - { 1 . 3 + 4i . 0 } . - { 1 - 2i . 2 . -4 } . - { -8 + 0i . 5 . -1 } }. - - self deny: matrix isReal. -] - { #category : #tests } PMMatrixTest >> testIsRealOnRealMatrix [ | matrix |