Open
Conversation
Member
|
Could you please explain the changes that you did? |
Pull Request Test Coverage Report for Build 21994104149Details
💛 - Coveralls |
DurieuxPol
commented
Feb 17, 2026
Comment on lines
+429
to
+433
| PMMatrix >> columnAverage [ | ||
|
|
||
| ^ (1 to: self numberOfColumns) collect: [ :colIndex | | ||
| (self columnAt: colIndex) average ] | ||
| ] |
Author
There was a problem hiding this comment.
I added this method to have the average of each column of the matrix.
DurieuxPol
commented
Feb 17, 2026
Comment on lines
+901
to
+912
| PMMatrix >> rowWiseSubstractionWith: aRow [ | ||
| "Assume a collection is a matrix of one row" | ||
|
|
||
| | result | | ||
| result := self class rows: self numberOfRows columns: self numberOfColumns. | ||
|
|
||
| 1 to: self numberOfColumns do: [ :col | | ||
| | me | | ||
| me := self atColumn: col. | ||
| result atColumn: col put: me - (aRow at: col) ]. | ||
| ^ result | ||
| ] |
Author
There was a problem hiding this comment.
I also added this method to subtract a vector to each row of a matrix.
For example:
matrix := PMMatrix rows: #( #( 1 2 ) #( 3 4 ) ).
vector := #( 1 2 ) asPMVector.
matrix -= vector.This gives:
PMMatrix rows: #( #( 0 0 ) #( 2 2) )It is similar to the -= method from AIContiguousMatrix.
And I added a -= method also to PMMatrix that calls this method, for convenience.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added methods to have the average of each column, and to subtract a vector to each row.