diff --git a/src/Math-Core/PMVector.class.st b/src/Math-Core/PMVector.class.st index 9185fd96e..4370b0313 100644 --- a/src/Math-Core/PMVector.class.st +++ b/src/Math-Core/PMVector.class.st @@ -20,7 +20,7 @@ Class { #name : #PMVector, #superclass : #Array, #type : #variable, - #category : 'Math-Core' + #category : #'Math-Core' } { #category : #'instance creation' } @@ -167,21 +167,6 @@ PMVector >> cumsum [ ] -{ #category : #deprecated } -PMVector >> dot: aVector [ -"Answers the elementwise product of the receiver with aVector." - | answer n | - answer := self class new: self size. - n := 0. - self with: aVector do: - [ :a :b | - n := n + 1. - answer at: n put: ( a * b). - ]. - ^answer - -] - { #category : #operation } PMVector >> hadamardProduct: aVector [ "Answers the elementwise product of the receiver with aVector." diff --git a/src/Math-Core/PMWeightedPoint.class.st b/src/Math-Core/PMWeightedPoint.class.st index a7beea989..68a6f6146 100644 --- a/src/Math-Core/PMWeightedPoint.class.st +++ b/src/Math-Core/PMWeightedPoint.class.st @@ -12,7 +12,7 @@ Class { 'weight', 'error' ], - #category : 'Math-Core' + #category : #'Math-Core' } { #category : #creation } diff --git a/src/Math-Matrix/PMMatrix.class.st b/src/Math-Matrix/PMMatrix.class.st index 900d3f209..597b1158c 100644 --- a/src/Math-Matrix/PMMatrix.class.st +++ b/src/Math-Matrix/PMMatrix.class.st @@ -407,12 +407,6 @@ PMMatrix >> dimension [ ^ self rows size @ (self rows at: 1) size ] -{ #category : #deprecated } -PMMatrix >> dot: aMatrix [ - "Answers the elementwise product of the receiver with aMatrix." - ^ aMatrix elementwiseProductWithMatrix: self -] - { #category : #operation } PMMatrix >> eigen [ "Computes all eigenvalues and eigenvectors of a matrix. @@ -430,7 +424,7 @@ PMMatrix >> elementwiseProductWithMatrix: aMatrix [ "Answers the elementwise product between aMatrix and the receiver as a Matrix." | n | n := 0. - ^ PMMatrix rows: ( aMatrix rowsCollect: [ :each | n := n + 1. each dot: ( self rowAt: n)]) + ^ self class rows: ( aMatrix rowsCollect: [ :each | n := n + 1. each hadamardProduct: ( self rowAt: n)]) ] diff --git a/src/Math-Tests-Core/PMVectorTest.class.st b/src/Math-Tests-Core/PMVectorTest.class.st index 082e82fe0..497f8a795 100644 --- a/src/Math-Tests-Core/PMVectorTest.class.st +++ b/src/Math-Tests-Core/PMVectorTest.class.st @@ -137,20 +137,6 @@ PMVectorTest >> testVectorCumulativeSum [ self assert: (w at: 3) equals: 6 ] -{ #category : #tests } -PMVectorTest >> testVectorDotProduct [ - "Code Example 8.1" - - | u v w | - u := #(1 2 3) asPMVector. - v := #(3 4 5) asPMVector. - w := u dot: v. - self assert: (w size) equals: 3. - self assert: (w at: 1) equals: 3. - self assert: (w at: 2) equals: 8. - self assert: (w at: 3) equals: 15 -] - { #category : #tests } PMVectorTest >> testVectorGreater [ diff --git a/src/Math-Tests-Matrix/PMMatrixTest.class.st b/src/Math-Tests-Matrix/PMMatrixTest.class.st index b27b24464..3b277e0f6 100644 --- a/src/Math-Tests-Matrix/PMMatrixTest.class.st +++ b/src/Math-Tests-Matrix/PMMatrixTest.class.st @@ -437,24 +437,6 @@ PMMatrixTest >> testMatrixMultiply [ self assert: ((c rowAt: 2) at: 3) equals: 4 ] -{ #category : #'linear algebra' } -PMMatrixTest >> testMatrixMultiplyElementwise [ - "Code Example 8.1" - - | a b c | - a := PMMatrix rows: #(#(1 0 1) #(-1 -2 3)). - b := PMMatrix rows: #(#(1 2 3) #(-2 1 7)). - c := a dot: b. - self assert: c numberOfRows equals: 2. - self assert: c numberOfColumns equals: 3. - self assert: ((c rowAt: 1) at: 1) equals: 1. - self assert: ((c rowAt: 1) at: 2) equals: 0. - self assert: ((c rowAt: 1) at: 3) equals: 3. - self assert: ((c rowAt: 2) at: 1) equals: 2. - self assert: ((c rowAt: 2) at: 2) equals: -2. - self assert: ((c rowAt: 2) at: 3) equals: 21 -] - { #category : #'linear algebra' } PMMatrixTest >> testMatrixPrincipalDiagonal [ | a |