Skip to content

Commit 0f7e9fa

Browse files
royalstreampradeep
authored andcommitted
WriteArray, Iota, Constant, Range, Identity
1 parent 69811c2 commit 0f7e9fa

File tree

2 files changed

+241
-17
lines changed

2 files changed

+241
-17
lines changed

Wrapper/Array.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,24 @@ public int ElemCount
8080
}
8181
}
8282

83-
public Dim4 Dimensions
83+
public int[] Dimensions
8484
{
8585
get
8686
{
87+
int[] result = new int[DimCount];
8788
long d0, d1, d2, d3;
8889
Internal.VERIFY(AFArray.af_get_dims(out d0, out d1, out d2, out d3, _ptr));
89-
return new Dim4((int)d0, (int)d1, (int)d2, (int)d3);
90+
result[0] = (int)d0;
91+
if (result.Length > 1)
92+
{
93+
result[1] = (int)d1;
94+
if (result.Length > 2)
95+
{
96+
result[2] = (int)d2;
97+
if (result.Length > 3) result[3] = (int)d3;
98+
}
99+
}
100+
return result;
90101
}
91102
}
92103

0 commit comments

Comments
 (0)