diff --git a/src/Math-Matrix/PMMatrix.class.st b/src/Math-Matrix/PMMatrix.class.st index 13145fb7..881b1730 100644 --- a/src/Math-Matrix/PMMatrix.class.st +++ b/src/Math-Matrix/PMMatrix.class.st @@ -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' } @@ -311,6 +311,12 @@ PMMatrix >> atColumn: aColumnNumber put: aCollection startingAt: rowNumber [ ] +{ #category : #'cell accessing' } +PMMatrix >> atRow: aRowNumber [ + "answers the aRowNumber-th row in the receiver" + ^ self rowAt: aRowNumber +] + { #category : #'cell accessing' } PMMatrix >> atRow: rowIndex put: aCollection [ diff --git a/src/Math-Tests-Matrix/PMMatrixTest.class.st b/src/Math-Tests-Matrix/PMMatrixTest.class.st index 5ec746d3..d0b99139 100644 --- a/src/Math-Tests-Matrix/PMMatrixTest.class.st +++ b/src/Math-Tests-Matrix/PMMatrixTest.class.st @@ -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 |