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.
- Format
Options - Matrix
- Matrix is a rectangular store of type T, providing a variety of useful iterator patterns.
- Matrix
Address - 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).
- Matrix
Column Iterator - Matrix
Columns Iterator - Matrix
Display Options - Matrix
Forward Indexed Iterator - MatrixForwardIndexedIterator returns (address, value) tuples for a matrix in row-major order, starting at the upper left origin (0,0).
- Matrix
Forward Iterator - MatrixForwardIterator returns the available addresses in a matrix in row-major format starting at the origin, or upper left (0, 0) address.
- Matrix
Parse Options - Matrix
RowIterator - Matrix
Rows Iterator - Row
- Row is a quality-of-life assistant to ease processing matrices in a row-major fashion.
Enums§
- Logical
Dimension - 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.
- Checked
Mul - 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).