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
10 changes: 0 additions & 10 deletions src/Math-Complex/Number.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/Math-Matrix/ManifestMathMatrix.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 : #ManifestMathMatrix,
#superclass : #PackageManifest,
#category : #'Math-Matrix-Manifest'
}

{ #category : #'meta-data - dependency analyser' }
ManifestMathMatrix class >> manuallyResolvedDependencies [
^ #(#'Collections-Streams' #'Math-Operations-Extensions')
]
12 changes: 12 additions & 0 deletions src/Math-Matrix/Number.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
13 changes: 13 additions & 0 deletions src/Math-Tests-Complex/PMMatrixTest.extension.st
Original file line number Diff line number Diff line change
@@ -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.
]
13 changes: 13 additions & 0 deletions src/Math-Tests-Matrix/ManifestMathTestsMatrix.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 : #ManifestMathTestsMatrix,
#superclass : #PackageManifest,
#category : #'Math-Tests-Matrix-Manifest'
}

{ #category : #'meta-data - dependency analyser' }
ManifestMathTestsMatrix class >> manuallyResolvedDependencies [
^ #(#'Math-Core-Process')
]
12 changes: 0 additions & 12 deletions src/Math-Tests-Matrix/PMMatrixTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down