The OpenD Programming Language

dropToHypercube

Returns maximal multidimensional cube.

  1. Slice!(Iterator, N, kind) dropToHypercube(Slice!(Iterator, N, kind) slice)
    Slice!(Iterator, N, kind)
    dropToHypercube
    (
    Iterator
    size_t N
    SliceKind kind
    )
    (
    Slice!(Iterator, N, kind) slice
    )
    if (
    kind == Canonical ||
    kind == Universal
    ||
    N == 1
    )
  2. Slice!(Iterator, N, Canonical) dropToHypercube(Slice!(Iterator, N) slice)

Parameters

slice Slice!(Iterator, N, kind)

input slice

Return Value

Type: Slice!(Iterator, N, kind)

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