File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,27 @@ into a distributed array constructor:
98
98
In this case the ` init ` function only needs to call ` fill ` with the
99
99
dimensions of the local piece it is creating.
100
100
101
+ ` DArray ` 's can also be constructed from multidimensional ` Array ` comprehensions with
102
+ the ` @DArray ` macro syntax. This syntax is just sugar for the primitive ` DArray ` constructor:
103
+
104
+ ``` julia
105
+ julia> [i+ j for i = 1 : 5 , j = 1 : 5 ]
106
+ 5 x5 Array{Int64,2 }:
107
+ 2 3 4 5 6
108
+ 3 4 5 6 7
109
+ 4 5 6 7 8
110
+ 5 6 7 8 9
111
+ 6 7 8 9 10
112
+
113
+ julia> @DArray [i+ j for i = 1 : 5 , j = 1 : 5 ]
114
+ 5 x5 DistributedArrays. DArray{Int64,2 ,Array{Int64,2 }}:
115
+ 2 3 4 5 6
116
+ 3 4 5 6 7
117
+ 4 5 6 7 8
118
+ 5 6 7 8 9
119
+ 6 7 8 9 10
120
+ ```
121
+
101
122
Distributed Array Operations
102
123
----------------------------
103
124
You can’t perform that action at this time.
0 commit comments