Skip to content

Commit

Permalink
Improved comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Sep 5, 2023
1 parent d985003 commit fdaf94f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/AI-KMeans/AIKMeans.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ AIKMeans >> clusters: aCollection [
{ #category : #training }
AIKMeans >> distanceBetween: firstPoint and: secondPoint [
"It follows the Euclidean distance between two points formula."

^ euclideanDistance distanceBetween: firstPoint and: secondPoint

"The code is not idiomatic because of performance. We see that writting this instead of
(firstPoint - secondPoint raisedTo: 2) sum sqrt
is about 30% fastest."

"The below code is not idiomatic because of performance. We see that writting this instead
of has a lot of performance improvements. If you are having performance issues, use the
below implementation. Another option that is in the middle, between is
`(firstPoint - secondPoint raisedTo: 2) sum sqrt`"

"| sum |
sum := 0.
Expand Down

0 comments on commit fdaf94f

Please sign in to comment.