Struct afarray::Coords[][src]

pub struct Coords { /* fields omitted */ }
Expand description

A hardware-accelerated set of n-dimensional coordinates, all with the same dimension.

Implementations

Constructs Coords with the given size full of zeros (origin points) for the given shape.

Panics: if shape is empty

Constructs a new Coords from an iterator of Coords.

Panics: if any Coord is not of length ndim, or if ndim is zero.

Constructs a new Coords from an ArrayExt of offsets with respect to the given shape.

Panics: if shape is empty

Constructs a new Coords from a [Stream] of Coords.

Panics: if any Coord has a length other than ndim, or if ndim is zero

Constructs a new Coords from a [TryStream] of Coords.

Panics: if any Coord has a length other than ndim

Borrow these Coords as an af::Array<u64>.

Borrow these Coords mutably as an af::Array<u64>.

Return true if the number of coordinates in these Coords is zero.

Return true if these Coords are in sorted order with respect to the given shape.

Return the number of coordinates stored in these Coords.

Return the number of dimensions of these Coords.

Return a copy of these Coords without the specified axis.

Panics: if there is no dimension at axis

Return a copy of these Coords with a new dimension at the given axis.

Panics: if axis is greater than self.ndim()

Transform the coordinate basis of these Coords from a source tensor to a slice.

Transpose these Coords according to the given permutation.

If no permutation is given, the coordinate axes will be inverted.

Invert the given broadcast of these Coords.

Panics: if source_shape and broadcast are not the same length.

Transform the coordinate basis of these Coords from a slice to a source tensor.

Panics: if source_shape.len() - self.ndim() does not match elided.len()

Construct a new Coords from the selected indices.

Panics: if any index is out of bounds

Update these Coords by writing the given value at the given index.

Panics: if any index is out of bounds, or if value.len() does not match self.len()

Return these Coords as Offsets with respect to the given shape.

Panics: if shape.len() does not equal self.ndim()

Return a list of Coords from these Coords.

Panics: if the given number of dimensions does not fit the set of coordinates

Convert these Coords into a list of Coords.

Panics: if the given number of dimensions does not fit the set of coordinates.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Returns true if self can be cast into the target type T.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Test if value can be cast into Self.

Returns Some(Self) if the source value can be cast into Self, otherwise None.

Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.

Test if self can be cast into T.

Returns Some(T) if self can be cast into T, otherwise None.

Returns Ok(T) if self can be cast into T, otherwise calls on_err.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.