dropToHypercube

Returns maximal multidimensional cube.

  1. Slice!(Iterator, N, kind) dropToHypercube(Slice!(Iterator, N, kind) slice)
  2. Slice!(Iterator, N, Canonical) dropToHypercube(Slice!(Iterator, N) slice)
    @optmath
    Slice!(Iterator, N, Canonical)
    dropToHypercube
    (
    Iterator
    size_t N
    )
    (
    Slice!(Iterator, N) slice
    )
    if (
    N > 1
    )

Parameters

slice Slice!(Iterator, N)

input slice

Return Value

Type: Slice!(Iterator, N, Canonical)

n-dimensional slice

Examples

import mir.ndslice.topology: iota, canonical, universal;

assert(iota(5, 3, 6, 7)
    .dropToHypercube
    .shape == cast(size_t[4])[3, 3, 3, 3]);

assert(iota(5, 3, 6, 7)
    .universal
    .dropToHypercube
    .shape == cast(size_t[4])[3, 3, 3, 3]);

assert(4.iota.dropToHypercube == 4.iota);

Meta