The OpenD Programming Language

mir.ndslice.slice

This is a submodule of mir.ndslice.

More...

Members

Aliases

Canonical
alias Canonical = SliceKind.canonical

Alias for .SliceKind.canonical.

Contiguous
alias Contiguous = SliceKind.contiguous

Alias for .SliceKind.contiguous.

DeepElementType (from mir.primitives)
alias DeepElementType(S : T[], T) = T via public import mir.primitives : DeepElementType;
IteratorOf
alias IteratorOf(T : Slice!(Iterator, N, kind), Iterator, size_t N, SliceKind kind) = Iterator

Extracts iterator type from a Slice.

Slice
alias Slice = mir_slice

Presents an n-dimensional view over a range.

SliceKind
alias SliceKind = mir_slice_kind

SliceKind of Slice.

Universal
alias Universal = SliceKind.universal

Alias for .SliceKind.universal.

Enums

isConvertibleToSlice
eponymoustemplate isConvertibleToSlice(T)

Check if toConst function can be called with type T.

isSlice
eponymoustemplate isSlice(T)

Checks if the type is Slice instance.

kindOf
eponymoustemplate kindOf(T : Slice!(Iterator, N, kind), Iterator, size_t N, SliceKind kind)

Extracts SliceKind.

mir_slice_kind
enum mir_slice_kind

SliceKind of Slice.

Functions

ndassign
auto ndassign(L lside, R rside)

Assignment utility for generic code that works both with scalars and with ndslices.

sliced
auto sliced(Iterator iterator, size_t[N] lengths)

Creates an n-dimensional slice-shell over an iterator.

sliced
Slice!(T*) sliced(T[] array)

Creates an 1-dimensional slice-shell over an array.

sliced
Slice!(Iterator, N, kind) sliced(Slice!(Iterator, 1, kind) slice, size_t[N] lengths)

Creates an n-dimensional slice-shell over the 1-dimensional input slice.

slicedField
Slice!(FieldIterator!Field, N) slicedField(Field field, size_t[N] lengths)
auto slicedField(Field field)

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

slicedNdField
Slice!(IndexIterator!(FieldIterator!(ndIotaField!N), ndField), N) slicedNdField(ndField field, size_t[N] lengths)
auto slicedNdField(ndField field)

Creates an n-dimensional slice-shell over an ndField.

toSlice
auto toSlice(Slice!(Iterator, N, kind) val)
auto toSlice(T[] val)
auto toSlice(T val)

Reurns: Ndslice view in the same data.

Structs

CoordinateValue
struct CoordinateValue(T, size_t N = 1)

Combination of coordinate(s) and value.

Structure
struct Structure(size_t N)

Presents .Slice.structure.

mir_slice
struct mir_slice(Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous, Labels_...)

Presents an n-dimensional view over a range.

Templates

hasAsSlice
template hasAsSlice(T)

Checks if type T has asSlice property and its returns a slices. Aliases itself to a dimension count

toSlices
template toSlices(args...)

Detailed Description

Safety note

User-defined iterators should care about their safety except bounds checks. Bounds are checked in ndslice code.

Meta

Authors

Ilia Ki

Definitions

NameDescription
SliceN-dimensional slice.
SliceKindSliceKind of Slice enumeration.
UniversalAlias for .SliceKind.universal.
CanonicalAlias for .SliceKind.canonical.
ContiguousAlias for .SliceKind.contiguous.
slicedCreates a slice on top of an iterator, a pointer, or an array's pointer.
slicedFieldCreates a slice on top of a field, a random access range, or an array.
slicedNdFieldCreates a slice on top of an ndField.
kindOfExtracts SliceKind.
isSliceChecks if the type is Slice instance.
StructureA tuple of lengths and strides.