The OpenD Programming Language

slicedField

Creates an n-dimensional slice-shell over a field.

  1. Slice!(FieldIterator!Field, N) slicedField(Field field, size_t[N] lengths)
    Slice!(FieldIterator!Field, N)
    slicedField
    (
    Field
    size_t N
    )
    (
    Field field
    ,
    size_t[N] lengths...
    )
    if (
    N
    )
  2. auto slicedField(Field field)

Parameters

field Field

A field. The length of the array should be equal to or less then the product of lengths.

lengths size_t[N]

A list of lengths for each dimension.

Return Value

Type: Slice!(FieldIterator!Field, N)

n-dimensional slice

Examples

Creates an 1-dimensional slice over a field, array, or random access range.

import mir.ndslice.topology : iota;
auto slice = 10.iota.slicedField;
assert(slice.length == 10);

Meta