Layout class

Immutable object describing a multi-dimensional data layout in a flat list of values.

Available Extensions
Annotations
  • @immutable

Constructors

Layout({Iterable<int>? shape, Iterable<int>? strides, int? offset})
factory
Layout.fromObject(dynamic object)
factory
Layout.internal({required int rank, required int length, required int offset, required List<int> shape, required List<int> strides, required bool isContiguous})
Internal constructor of Layout object.

Properties

defaultToStringPrinter → ObjectPrinter
Override to configure the empty ObjectPrinter.
no setterinherited
hashCode int
The hash code for this object.
no setteroverride
indices Iterable<int>
An iterable over the indices of this layout.
no setter
isContiguous bool
True, if the values in this layout are in sequence.
final
keys Iterable<List<int>>
An iterable over the keys of this layout.
no setter
length int
The total number of elements.
final
offset int
The absolute offset of the data.
final
rank int
The number of dimensions.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape List<int>
The length of each dimension.
final
strides List<int>
The number of indices to jump to the next value in each dimension.
final
toStringPrinter → ObjectPrinter
Override and call super to add values to the ObjectPrinter.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toIndex(List<int> key) int
Converts a key (index-list) to an index.
toKey(int index) List<int>
Converts an offset to a key, that is a list of indices.
toString() String
Standard toString implementation. Do not override, instead implement toStringPrinter to customize.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override
operator [](int index) Layout
Returns an updated layout with the first axis resolved to index.

Static Properties

empty Layout
final