www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Recently added ndslice API

reply Ilya Yaroshenko <ilyayaroshenko gmail.com> writes:
11 ndslice and ndField constructors was added since ndslice API 
had been reworked. All of them do not perform any memory 
allocations.

mir.ndslice.slice:

- slicedNdField - Creates full featured n-dimensional ndslice 
over an ndField. ndField is a simple user-defined 
multidimensional view that may have only
`auto ref opIndex(size_t[N] indexes...)` primitive.

mir.ndslice.topology:

- cartesian - Multidimensional Cartesian product

- kronecker - Multidimensional Kronecker product

- bitwise - Bitwise slice over an unsigned integral slice. (used 
in tamediadigital/lincount)

- bitpack - Bitpack slice over an unsigned integral slice. (used 
in tamediadigital/hll-d)

- indexed - Multidimensional std.range.indexed analog for 
ndslice. It works like map, e.g. indexes may have any type that 
can be accepted by source's `opIndex` API.

- linspace - Multidimensional evenly spaced numbers over 
specified intervals. It is numpy and matlab analog. linspace does 
not have floating-point related std.range.iota bug (Issue 6531).

mir.ndslice.concatenation (new):

- concatenation, Creates a concatenated view of multiple slices.

- pad, Pads with a constant value.

- padEdge, Pads with the edge values of slice.

- padSymmetric, Pads with the reflection of the slice mirrored 
along the edge of the slice.

- padWrap - Pads with the wrap of the slice along the axis. The 
first values are used to pad the end and the end values are used 
to pad the beginning.

Github:
https://github.com/libmir/mir-algorithm
API:
http://docs.algorithm.dlang.io/
Know bugs:
- `mir.ndslice.topology.map` may not work with LDC because it has 
deprecated DMD FE.

Best regards,
Ilya
Mar 11 2017
parent reply jmh530 <john.michael.hall gmail.com> writes:
On Saturday, 11 March 2017 at 10:53:35 UTC, Ilya Yaroshenko wrote:
 Github:
 https://github.com/libmir/mir-algorithm
Every time I look at that mir-alogrithm main page with the Scheme image, I'm just like what the hell is going on. Maybe you can just link to it instead of featuring it so prominently...
Mar 17 2017
parent Ilya <ilyayaroshenko gmail.com> writes:
On Friday, 17 March 2017 at 17:35:33 UTC, jmh530 wrote:
 On Saturday, 11 March 2017 at 10:53:35 UTC, Ilya Yaroshenko 
 wrote:
 Github:
 https://github.com/libmir/mir-algorithm
Every time I look at that mir-alogrithm main page with the Scheme image, I'm just like what the hell is going on. Maybe you can just link to it instead of featuring it so prominently...
Agreed)
Mar 17 2017