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
17 changes: 1 addition & 16 deletions src/Math-Core/PMVector.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Class {
#name : #PMVector,
#superclass : #Array,
#type : #variable,
#category : 'Math-Core'
#category : #'Math-Core'
}

{ #category : #'instance creation' }
Expand Down Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion src/Math-Core/PMWeightedPoint.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Class {
'weight',
'error'
],
#category : 'Math-Core'
#category : #'Math-Core'
}

{ #category : #creation }
Expand Down
8 changes: 1 addition & 7 deletions src/Math-Matrix/PMMatrix.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)])

]

Expand Down
14 changes: 0 additions & 14 deletions src/Math-Tests-Core/PMVectorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand Down
18 changes: 0 additions & 18 deletions src/Math-Tests-Matrix/PMMatrixTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down