Differences between tensor elements.
Pairwise map for tensors.
Error codes for reshape.
Converts a slice to canonical kind (unsafe).
Converts a slice to contiguous kind (unsafe).
Helps the compiler to use optimisations related to the shape form
Helps the compiler to use optimisations related to the shape form
Bitpack slice over an integral slice.
Bitwise slice over an integral slice.
Bitwise field over an integral field.
Bytegroup slice over an integral slice.
Creates a random access cache for lazyly computed elements.
Creates a random access cache for lazyly computed elements.
Converts a slice to canonical kind.
Cartesian product.
Maps index pairs to subslices.
Cycle repeates 1-dimensional field/range/array/slice in a fixed length 1-dimensional slice.
Drops borders for all dimensions.
Reverses the order of dimension packs. This function is used in a functional pipeline with other selectors.
A contiguous 1-dimensional slice of all elements of a slice. flattened iterates existing data. The order of elements is preserved.
Takes a field source and a slice indices, and creates a view of source as if its elements were reordered according to indices. indices may include only a subset of the elements of source and may also repeat elements.
Returns a slice, the elements of which are equal to the initial flattened index value.
Creates a packed slice, i.e. slice of slices. Packs the last N - P dimensions. The function does not allocate any data.
Evenly spaced numbers over a specified interval.
Returns a slice, the elements of which are equal to the initial multidimensional index value. For a flattened (contiguous) index, see iota.
Creates a packed slice, i.e. slice of slices. Packs the last P dimensions. The function does not allocate any data.
Returns a slice with identical elements. RepeatSlice stores only single value.
Returns a new slice for the same data with different dimensions.
Reverses order of iteration for all dimensions.
Chops 1D input slice into n chunks with ascending or descending lengths.
Slice composed of rows of lower or upper triangular matrix.
Strides 1-dimensional slice.
Maps index pairs to subslices.
Constructs a lazy view of triplets with left, center, and right members.
Converts a slice to universal kind.
Unpacks a packed slice.
Constructs a view of an n-dimensional slice with a dimension added at axis. Used to unsqueeze a squeezed slice.
Selects a slice from a zipped slice.
Implements the homonym function (also known as transform) present in many languages of functional flavor. The call slice.vmap(fun) returns a slice of which elements are obtained by applying fun for all elements in slice. The original slices are not changed. Evaluation is done lazily.
Returns an n-dimensional slice of n-dimensional overlapping windows. windows can be generalized with other selectors. For example, windows in combination with diagonal can be used to get a multi-diagonal slice.
Implements the homonym function (also known as transform) present in many languages of functional flavor. The call map!(fun)(slice) returns a slice of which elements are obtained by applying fun for all elements in slice. The original slices are not changed. Evaluation is done lazily.
Reverses order of iteration for all dimensions.
Returns a slice that can be iterated along dimension. Transposes other dimensions on top and then packs them.
Converts a slice to user provided kind.
Returns a slice that can be iterated by dimension. Transposes dimensions on top and then packs them.
Returns a slice, the elements of which are equal to the initial flattened index value.
Implements the homonym function (also known as transform) present in many languages of functional flavor. The call map!(fun)(slice) returns a slice of which elements are obtained by applying fun for all elements in slice. The original slices are not changed. Evaluation is done lazily.
Field (element's member) projection.
Functional deep-element wise reduce of a slice composed of fields or iterators.
Implements the homonym function (also known as transform) present in many languages of functional flavor. The call rmap!(fun)(slice) returns an RC array (1D) or RC slice (ND) of which elements are obtained by applying fun for all elements in slice. The original slices are not changed. Evaluation is done eagerly.
Lazy convolution for tensors.
Lazy convolution for tensors.
Constructs a new view of an n-dimensional slice with dimension axis removed.
Strides 1-dimensional slice.
Constructs a view of an n-dimensional slice with a dimension added at axis. Used to unsqueeze a squeezed slice.
Lazy zip view of elements packed with sum of their neighbours.
Groups slices into a slice of refTuples. The slices must have identical strides or be 1-dimensional.
Function Name | Description |
---|---|
alongDim | Returns a slice that can be iterated along dimension. |
byDim | Returns a slice that can be iterated by dimension. |
pack | Returns slice of slices. |
ipack | Returns slice of slices. |
unpack | Merges two hight dimension packs. See also fuse. |
evertPack | Reverses dimension packs. |
Function Name | Description |
---|---|
asKindOf | Converts a slice to a user provied kind SliceKind. |
universal | Converts a slice to universal SliceKind. |
canonical | Converts a slice to canonical SliceKind. |
assumeCanonical | Converts a slice to canonical SliceKind. Does only assert checks. |
assumeContiguous | Converts a slice to contiguous SliceKind. Does only assert checks. |
assumeHypercube | Helps the compiler to use optimisations related to the shape form. Does only assert checks. |
assumeSameShape | Helps the compiler to use optimisations related to the shape form. Does only assert checks. |
Function Name | Description |
---|---|
cartesian | Cartesian product. |
kronecker | Kronecker product. |
Function Name | Description |
---|---|
as | Convenience function that creates a lazy view, where each element of the original slice is converted to a type T. |
bitpack | Bitpack slice over an unsigned integral slice. |
bitwise | Bitwise slice over an unsigned integral slice. |
bytegroup | Groups existing slice into fixed length chunks and uses them as data store for destination type. |
cached | Random access cache. It is usefull in combiation with map and vmap. |
cachedGC | Random access cache auto-allocated in GC heap. It is usefull in combiation with map and vmap. |
diff | Differences between vector elements. |
flattened | Contiguous 1-dimensional slice of all elements of a slice. |
map | Multidimensional functional map. |
member | Field (element's member) projection. |
orthogonalReduceField | Functional deep-element wise reduce of a slice composed of fields or iterators. |
pairwise | Pairwise map for vectors. |
pairwiseMapSubSlices | Maps pairwise index pairs to subslices. |
retro | Reverses order of iteration for all dimensions. |
slide | Lazy convolution for tensors. |
slideAlong | Lazy convolution for tensors. |
stairs | Two functions to pack, unpack, and iterate triangular and symmetric matrix storage. |
stride | Strides 1-dimensional slice. |
subSlices | Maps index pairs to subslices. |
triplets | Constructs a lazy view of triplets with left, center, and right members. The topology is usefull for Math and Physics. |
unzip | Selects a slice from a zipped slice. |
withNeighboursSum | Zip view of elements packed with sum of their neighbours. |
zip | Zips slices into a slice of refTuples. |
Subspace selectors serve to generalize and combine other selectors easily. For a slice of Slice!(Iterator, N, kind) type slice.pack!K creates a slice of slices of Slice!(kind, [N - K, K], Iterator) type by packing the last K dimensions of the top dimension pack, and the type of element of flattened is Slice!(Iterator, K). Another way to use pack is transposition of dimension packs using evertPack. Examples of use of subspace selectors are available for selectors, Slice.shape, and Slice.elementCount.
2020 Ilia Ki, Kaleidic Associates Advisory Limited, Symmetry Investments
This is a submodule of mir.ndslice.
Selectors create new views and iteration patterns over the same data, without copying.
Sequence Selectors
Shape Selectors