Skip to content

Commit 5c89259

Browse files
committed
Fixed #266. Moved productWithVector: and productWithMatrix: closer to PMVector and PMMatrix
1 parent 497c9f6 commit 5c89259

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

src/Math-Core/Number.extension.st

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,9 @@ Number >> addWithVector: aVector [
1111
"Adds itself to each element of the vector"
1212
^ aVector collect: [ :each | each + self ]
1313
]
14+
15+
{ #category : #'*Math-Core' }
16+
Number >> productWithVector: aVector [
17+
"Answers a new vector product of the receiver with aVector."
18+
^aVector collect: [ :each | each * self]
19+
]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Extension { #name : #Number }
2+
3+
{ #category : #'*Math-Matrix' }
4+
Number >> productWithMatrix: aMatrix [
5+
^aMatrix class rows: (aMatrix rowsCollect: [:r| self productWithVector: r])
6+
]

src/Math-Numerical/Number.extension.st

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,6 @@ Number >> logGamma [
5858
]
5959
]
6060

61-
{ #category : #'*Math-Numerical' }
62-
Number >> productWithMatrix: aMatrix [
63-
^aMatrix class rows: (aMatrix rowsCollect: [:r| self productWithVector: r])
64-
]
65-
66-
{ #category : #'*Math-Numerical' }
67-
Number >> productWithVector: aVector [
68-
"Answers a new vector product of the receiver with aVector."
69-
^aVector collect: [ :each | each * self]
70-
]
71-
7261
{ #category : #'*Math-Numerical' }
7362
Number class >> random [
7463
"Answers a floating random number between 0 and 1 excluded"

0 commit comments

Comments
 (0)