We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3df00c5 commit b1b923dCopy full SHA for b1b923d
src/Math-Matrix/PMTensor.class.st
@@ -10,6 +10,28 @@ Class {
10
#category : #'Math-Matrix'
11
}
12
13
+{ #category : #'instance creation' }
14
+PMTensor class >> newWith: anInteger [
15
+
16
+ ^ self new array: {anInteger} withShape: #( )
17
+]
18
19
20
+PMTensor class >> rows: anArray [
21
22
+ ^ self new array: anArray flattened withShape: (self shape:anArray)
23
24
25
+{ #category : #accessing }
26
+PMTensor class >> shape: anArray [
27
28
+anArray isArray ifFalse:[^#()]
29
+ifTrue:[
30
+ ^ {anArray size}, (self shape: anArray first)
31
+ ]
32
33
34
35
{ #category : #comparing }
36
PMTensor >> = aTensor [
37
0 commit comments