Skip to content

Commit c9005cb

Browse files
authored
Merge pull request #332 from DurieuxPol/fix/jacobi
Adjustments following changes made to JacobiTransformation
2 parents 60cd14e + e5b0df8 commit c9005cb

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

src/BaselineOfPolyMath/BaselineOfPolyMath.class.st

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ PolyMath is a Smalltalk project, similar to existing scientific libraries like N
1010
1111
"
1212
Class {
13-
#name : #BaselineOfPolyMath,
14-
#superclass : #BaselineOf,
15-
#category : #BaselineOfPolyMath
13+
#name : 'BaselineOfPolyMath',
14+
#superclass : 'BaselineOf',
15+
#category : 'BaselineOfPolyMath',
16+
#package : 'BaselineOfPolyMath'
1617
}
1718

18-
{ #category : #baselines }
19+
{ #category : 'baselines' }
1920
BaselineOfPolyMath >> baseline: spec [
2021

2122
<baseline>
@@ -41,23 +42,23 @@ BaselineOfPolyMath >> baseline: spec [
4142
package: 'Math-CompatibilityUpToPharo11' ]
4243
]
4344

44-
{ #category : #dependencies }
45+
{ #category : 'dependencies' }
4546
BaselineOfPolyMath >> dataFrameInspector: spec [
4647

4748
spec
4849
baseline: 'AIDataFrameInspector'
4950
with: [ spec repository: 'github://pharo-ai/data-inspector/src' ]
5051
]
5152

52-
{ #category : #dependencies }
53+
{ #category : 'dependencies' }
5354
BaselineOfPolyMath >> datasets: spec [
5455

5556
spec
5657
baseline: 'AIDatasets'
5758
with: [ spec repository: 'github://pharo-ai/datasets' ].
5859
]
5960

60-
{ #category : #baselines }
61+
{ #category : 'baselines' }
6162
BaselineOfPolyMath >> groups: spec [
6263

6364
spec
@@ -98,7 +99,7 @@ BaselineOfPolyMath >> groups: spec [
9899
with: #( 'Core' 'Extensions' 'Tests' 'Benchmarks' 'Accuracy' )
99100
]
100101

101-
{ #category : #baselines }
102+
{ #category : 'baselines' }
102103
BaselineOfPolyMath >> packages: spec [
103104

104105
spec
@@ -204,40 +205,40 @@ BaselineOfPolyMath >> packages: spec [
204205
with: [ spec requires: #( 'AIDatasets' 'AIDataFrameInspector') ]
205206
]
206207

207-
{ #category : #accessing }
208+
{ #category : 'accessing' }
208209
BaselineOfPolyMath >> projectClass [
209210
^ [ self class environment at: #MetacelloCypressBaselineProject ]
210211
on: NotFound
211212
do: [ super projectClass ]
212213
]
213214

214-
{ #category : #dependencies }
215+
{ #category : 'dependencies' }
215216
BaselineOfPolyMath >> randomNumbers: spec [
216217

217218
spec baseline: 'MathRandomNumbers' with: [ spec repository: 'github://PolyMathOrg/random-numbers:v1.x.x/src' ]
218219
]
219220

220-
{ #category : #dependencies }
221+
{ #category : 'dependencies' }
221222
BaselineOfPolyMath >> roassal: spec [
222223

223224
spec
224225
baseline: 'Roassal'
225226
with: [ spec repository: 'github://pharo-graphics/Roassal' ].
226227
]
227228

228-
{ #category : #dependencies }
229+
{ #category : 'dependencies' }
229230
BaselineOfPolyMath >> sMark: spec [
230231

231232
spec baseline: 'SMark' with: [ spec repository: 'github://smarr/SMark:v1.0.4' ]
232233
]
233234

234-
{ #category : #dependencies }
235+
{ #category : 'dependencies' }
235236
BaselineOfPolyMath >> vectorMatrix: spec [
236237

237-
spec baseline: 'MathVectorMatrix' with: [ spec repository: 'github://PolyMathOrg/vector-matrix:v1.x.x/src' ]
238+
spec baseline: 'MathVectorMatrix' with: [ spec repository: 'github://PolyMathOrg/vector-matrix/src' ]
238239
]
239240

240-
{ #category : #dependencies }
241+
{ #category : 'dependencies' }
241242
BaselineOfPolyMath >> xmlWriter: spec [
242243

243244
spec baseline: 'XMLWriter' with: [ spec repository: 'github://pharo-contributions/XML-XMLWriter:2.9.x/src' ]

src/BaselineOfPolyMath/package.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Package { #name : #BaselineOfPolyMath }
1+
Package { #name : 'BaselineOfPolyMath' }

src/Math-PrincipalComponentAnalysis/PMPrincipalComponentAnalyserJacobiTransformation.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ PMPrincipalComponentAnalyserJacobiTransformation >> accumulate: aPMVectorOrArray
3333
PMPrincipalComponentAnalyserJacobiTransformation >> components [
3434
"Precondition: accumulate: should have been used."
3535

36-
^ self jacobiTransform evaluate copyFrom: 1 to: componentsNumber
36+
^ self jacobiTransform eigenValues copyFrom: 1 to: componentsNumber
3737
]
3838

3939
{ #category : 'accessing' }
@@ -59,5 +59,5 @@ PMPrincipalComponentAnalyserJacobiTransformation >> transform: aPMMatrix [
5959
PMPrincipalComponentAnalyserJacobiTransformation >> transformMatrix [
6060
"Return a matrix that can be applied to any data vector to extract the relevant component of the data vector"
6161

62-
^ PMMatrix rows: (self jacobiTransform transform rows copyFrom:1 to: componentsNumber )
62+
^ PMMatrix rows: (self jacobiTransform eigenVectors rows copyFrom:1 to: componentsNumber )
6363
]

src/Math-Tests-Numerical/PMNumericalMethodsTestCase.class.st

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ PMNumericalMethodsTestCase >> testEigenvalues [
6363
charPol := PMPolynomial coefficients: #(82 -66 15 -1).
6464
roots := charPol roots asSortedCollection asArray reverse.
6565
finder := PMJacobiTransformation matrix: m.
66-
finder desiredPrecision: 1.0e-09.
67-
eigenvalues := finder evaluate.
66+
eigenvalues := finder eigenValues.
6867
self assert: eigenvalues size equals: 3.
6968
self assert: ((roots at: 1) - (eigenvalues at: 1)) abs < 1.0e-09.
7069
self assert: ((roots at: 2) - (eigenvalues at: 2)) abs < 1.0e-09.

src/Math-Tests-TSNE/PMTSNETest.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ PMTSNETest >> testreduceXToInputDimsUsing [
8282
t := (PMTSNE new)
8383
x: (PMMatrix rows: #(#(0 0) #(2 2) #(2 0))).
8484
t reduceXToInputDimsUsing: PMPrincipalComponentAnalyserJacobiTransformation.
85-
self assert: (t x) closeTo: (PMMatrix rows: #(#(-0.5 -1.5) #(-0.5 1.5) #(1 0)))
85+
self assert: (t x) closeTo: (PMMatrix rows: #(#(-1.5 -0.5) #(1.5 -0.5) #(0 1)))
8686
]

0 commit comments

Comments
 (0)