@@ -20,10 +20,20 @@ $(BUGSTITLE Library Changes,
2020 $(LI $(RELATIVE_LINK2 optimization, `findLocalMin` was added to `std.numeric`.))
2121 $(LI $(RELATIVE_LINK2 slice_ptr, `ptr` property and public constructor were
2222 added to `std.experimental.ndslice.slice.Slice`.))
23+ $(LI $(RELATIVE_LINK2 slice_toHash, `toHash` method was
24+ added to `std.experimental.ndslice.slice.Slice`.))
2325 $(LI $(RELATIVE_LINK2 slice_alloc, `slice`, `shape`, `ndarray`, and other
2426 utilities were added to `std.experimental.ndslice.slice`.))
27+ $(LI $(RELATIVE_LINK2 slice_as, `as` lazy tensor was added to
28+ `std.experimental.ndslice.slice`.))
2529 $(LI $(RELATIVE_LINK2 slice_iota, `iotaSlice` lazy tensor was added to
2630 `std.experimental.ndslice.selection`.))
31+ $(LI $(RELATIVE_LINK2 slice_index, `indexSlice` lazy tensor was added to
32+ `std.experimental.ndslice.selection`.))
33+ $(LI $(RELATIVE_LINK2 slice_repeat, `repeatSlice` lazy tensor was added to
34+ `std.experimental.ndslice.selection`.))
35+ $(LI $(RELATIVE_LINK2 slice_map, `mapSlice` lazy tensor was added to
36+ `std.experimental.ndslice.selection`.))
2737 $(LI $(RELATIVE_LINK2 slice_mio, partial support for Math Index Order
2838 was added to `std.experimental.ndslice.slice.Slice`.))
2939 $(LI $(RELATIVE_LINK2 mutation, `std.algorithm.mutation.swapAt` was
@@ -183,16 +193,30 @@ $(LI $(LNAME2 slice_ptr, `ptr` property and public constructor were added to
183193 )
184194)
185195
196+ $(LI $(LNAME2 slice_toHash, $(P $(REF .Slice.toHash, std,experimental,ndslice,slice) method was added.)
197+ ---
198+ import std.experimental.ndslice;
199+
200+ // hash is the same for allocated data and generated data
201+ auto a = iotaSlice(3, 7);
202+ auto b = iotaSlice(3, 7).slice;
203+
204+ assert(a.toHash == b.toHash);
205+ ---
206+ )
207+
186208$(LI $(LNAME2 slice_alloc, `slice`, `shape`, `ndarray`, and other utilities
187209 were added to `std.experimental.ndslice.slice`.)
188210 $(P These utility functions have been added to
189211 $(MREF std,experimental,ndslice):)
190212 $(UL
213+ $(LI $(REF makeNdarray, std,experimental,ndslice,slice),)
214+ $(LI $(REF makeSlice, std,experimental,ndslice,slice),)
215+ $(LI $(REF makeUninitializedSlice, std,experimental,ndslice,slice),)
216+ $(LI $(REF ndarray, std,experimental,ndslice,slice),)
191217 $(LI $(REF shape, std,experimental,ndslice,slice),)
192218 $(LI $(REF slice, std,experimental,ndslice,slice),)
193- $(LI $(REF makeSlice, std,experimental,ndslice,slice),)
194- $(LI $(REF ndarray, std,experimental,ndslice,slice), and)
195- $(LI $(REF makeNdarray, std,experimental,ndslice,slice).)
219+ $(LI $(REF uninitializedSlice, std,experimental,ndslice,slice).)
196220 )
197221 $(P Example: Transposing common 2D array using `ndslice`)
198222-----
@@ -209,6 +233,24 @@ assert(ar == [[0, 3], [1, 4], [2, 5]]);
209233-----
210234)
211235
236+ $(LI $(LNAME2 slice_as, $(P $(REF as, std,experimental,ndslice,slice)
237+ lazy tensor was added.)
238+ ---
239+ import std.experimental.ndslice;
240+
241+ auto matrix = slice!double([2, 2], 0);
242+ auto stringMatrixView = matrix.as!string;
243+ assert(stringMatrixView ==
244+ [["0", "0"],
245+ ["0", "0"]]);
246+
247+ matrix.diagonal[] = 1;
248+ assert(stringMatrixView ==
249+ [["1", "0"],
250+ ["0", "1"]]);
251+ ---
252+ )
253+
212254$(LI $(LNAME2 slice_iota, `iotaSlice` lazy tensor was added to `std.experimental.ndslice.selection`.)
213255 $(P $(REF iotaSlice, std,experimental,ndslice,selection) is the fastest possible `Slice`.)
214256---
@@ -222,6 +264,46 @@ assert(sl.transposed == [[10, 13],
222264---
223265)
224266
267+ $(LI $(LNAME2 slice_index, $(P $(REF indexSlice, std,experimental,ndslice,selection)
268+ lazy tensor was added.)
269+ ---
270+ import std.experimental.ndslice;
271+
272+ auto slice = indexSlice(2, 3);
273+
274+ assert(slice == [[[0, 0], [0, 1], [0, 2]],
275+ [[1, 0], [1, 1], [1, 2]]]);
276+ ---
277+ )
278+
279+ $(LI $(LNAME2 slice_repeat, $(P $(REF repeatSlice, std,experimental,ndslice,selection)
280+ lazy tensor was added.)
281+ ---
282+ import std.experimental.ndslice;
283+
284+ auto sl = iotaSlice(3).repeatSlice(4);
285+ assert(sl == [[0, 1, 2],
286+ [0, 1, 2],
287+ [0, 1, 2],
288+ [0, 1, 2]]);
289+
290+ auto m = 4.repeatSlice(2, 3);
291+ assert(m == [[4, 4, 4],
292+ [4, 4, 4]]);
293+ ---
294+ )
295+
296+ $(LI $(LNAME2 slice_map, $(P $(REF mapSlice, std,experimental,ndslice,selection)
297+ lazy tensor was added.)
298+ ---
299+ import std.experimental.ndslice;
300+
301+ auto s = iotaSlice(2, 3).mapSlice!(a => a * a);
302+ assert(s == [[ 0, 1, 4],
303+ [ 9, 16, 25]]);
304+ ---
305+ )
306+
225307$(LI $(LNAME2 slice_mio, partial support for Math Index Order was added to `std.experimental.ndslice.slice.Slice`.)
226308---
227309import std.experimental.ndslice;
0 commit comments