Crate rust_advent_matrix

Crate rust_advent_matrix 

Source
Expand description

The matrix crate provides a generic multidimensional tensor, and the matrix concrete implementation of that type, along with various quality-of-life methods and accessors for the matrix type. It was initially developed for use implementing solutions for the annual advent-of-code challenges, and was heavily inspired and adapted from https://github.com/Daedelus1/RustTensors

Structs§

Column
Column is a quality-of-life assistant to ease processing matrices in a column-major fashion.
FormatOptions
Matrix
Matrix is a rectangular store of type T, providing a variety of useful iterator patterns.
MatrixAddress
MatrixAddress references a cell in a matrix by its row and column. Rows are numbered from zero at the top, and columns are numbered from zero at the left. Thus (0, 0), the origin, is positioned at the upper-left of the matrix. Any built in numeric or character type that fits in usize can be used as the index (thus in practice up to i16 / u16).
MatrixColumnIterator
MatrixColumnsIterator
MatrixDisplayOptions
MatrixForwardIndexedIterator
MatrixForwardIndexedIterator returns (address, value) tuples for a matrix in row-major order, starting at the upper left origin (0,0).
MatrixForwardIterator
MatrixForwardIterator returns the available addresses in a matrix in row-major format starting at the origin, or upper left (0, 0) address.
MatrixParseOptions
MatrixRowIterator
MatrixRowsIterator
Row
Row is a quality-of-life assistant to ease processing matrices in a row-major fashion.

Enums§

LogicalDimension
LogicalDimension lets you refer to the address dimensions of a matrix conceptually, rather than numerically.

Traits§

Address
Addresses must be convertible to and from a slice containing one V for each of the (fixed number) of dimensions for that Tensor.
CheckedMul
CheckedMul is a trait to capture the built-in checked_mul behavior provided for all intrinsic integer types in Rust, casting to usize. This is intended for computing matrix bounds for storage in a contiguous vector, whose upper-bound size is limited by usize.
Coordinate
Coordinate is the traits required to act as a dimensional index in a Matrix. All the built-in integral types should satisfy these.
Tensor
Tensor is a generic multidimensional data store trait. Think of it as a shared interface for a vector, a matrix, a cube, and a hypercube.
Unit
Unit returns the natural “one” value for a given type. This in turn is used to increment and decrement values within a range to provide an iterator.

Type Aliases§

Dimension
Dimension is an axis of the storage. In a vector there’s a single Dimension (0) and it’s the horizontal position within the vector. For a matrix, there are two Dimensions, x and y (0 and 1, but whether 0 is x or 1 is an implementation detail).