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
10 changes: 8 additions & 2 deletions src/Math-Matrix/PMMatrix.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ PMMatrix >> atAllPut: element [
]

{ #category : #'cell accessing' }
PMMatrix >> atColumn: anInteger [
PMMatrix >> atColumn: aColumnNumber [

^ self columnAt: anInteger
^ self columnAt: aColumnNumber
]

{ #category : #'cell accessing' }
Expand Down Expand Up @@ -311,6 +311,12 @@ PMMatrix >> atColumn: aColumnNumber put: aCollection startingAt: rowNumber [

]

{ #category : #'cell accessing' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any programmer tests to write here, @rakki-18 ? I seems simple enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hemalvarambhia Yeah sure, I will write some tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hemalvarambhia Yeah sure, I will write some tests.

TYSM

PMMatrix >> atRow: aRowNumber [
"answers the aRowNumber-th row in the receiver"
^ self rowAt: aRowNumber
]

{ #category : #'cell accessing' }
PMMatrix >> atRow: rowIndex put: aCollection [

Expand Down
10 changes: 10 additions & 0 deletions src/Math-Tests-Matrix/PMMatrixTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ PMMatrixTest >> testAtColumnPutRepeat [
self assert: a equals: (PMMatrix rows: #(#(1 nil nil) #(1 nil nil) #(nil nil nil))).
]

{ #category : #tests }
PMMatrixTest >> testAtRow [

| a |
a := PMMatrix rows: #(#(1 2 3) #(2 3 4)).

self assert: (a atRow: 2) equals: (#(2 3 4) asPMVector).
self assert: (a atRow: 1) equals: (#(1 2 3) asPMVector).
]

{ #category : #'linear algebra' }
PMMatrixTest >> testAtRowPutAtColumnPut [
| a |
Expand Down