File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff 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+ ]
Original file line number Diff line number Diff line change 1+ Extension { #name : #Number }
2+
3+ { #category : #' *Math-Matrix' }
4+ Number >> productWithMatrix: aMatrix [
5+ ^ aMatrix class rows: (aMatrix rowsCollect: [:r | self productWithVector: r])
6+ ]
Original file line number Diff line number Diff 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' }
7362Number class >> random [
7463 " Answers a floating random number between 0 and 1 excluded"
You can’t perform that action at this time.
0 commit comments