Skip to content

Commit d4f52de

Browse files
committed
Renaming methods. To make the names more expressive
1 parent a0d567d commit d4f52de

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/Math-Matrix/PMTensor.class.st

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ Class {
1111
}
1212

1313
{ #category : #'instance creation' }
14-
PMTensor class >> newWith: anInteger [
14+
PMTensor class >> fromNestedArray: anArray [
1515

16-
^ self new array: {anInteger} withShape: #( )
16+
^ self new array: anArray flattened withShape: (self shape:anArray)
1717
]
1818

1919
{ #category : #'instance creation' }
20-
PMTensor class >> rows: anArray [
20+
PMTensor class >> newWith: anInteger [
2121

22-
^ self new array: anArray flattened withShape: (self shape:anArray)
22+
^ self new array: {anInteger} withShape: #( )
2323
]
2424

2525
{ #category : #accessing }
@@ -58,6 +58,15 @@ PMTensor >> first [
5858
^first
5959
]
6060

61+
{ #category : #'as yet unclassified' }
62+
PMTensor >> flattenedIndexOf: aFlatArray withShape: aShape [
63+
64+
array := aFlatArray.
65+
shape := aShape copy.
66+
self updateFirst.
67+
shape ifNotEmpty: [ self updateStrides]
68+
]
69+
6170
{ #category : #public }
6271
PMTensor >> get: coords [
6372

0 commit comments

Comments
 (0)