Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoordinateToOrdinal ¶
func CoordinateToOrdinal[T constraints.Integer](rows, cols T, coord MatrixCoordinate[T]) T
Types ¶
type Matrix ¶
type Matrix[T constraints.Integer, V any] struct { MatrixDescriptor[T] // contains filtered or unexported fields }
func FromDescriptor ¶
func FromDescriptor[T constraints.Integer, V any](descriptor MatrixDescriptor[T], initial V) *Matrix[T, V]
func (Matrix[T, V]) GetValueC ¶
func (t Matrix[T, V]) GetValueC(coord MatrixCoordinate[T]) (V, bool)
type MatrixCoordinate ¶
type MatrixCoordinate[T constraints.Integer] struct { Row T Col T }
func OrdinalToCoordinate ¶
func OrdinalToCoordinate[T constraints.Integer](rows, cols, ord T) MatrixCoordinate[T]
type MatrixDescriptor ¶
type MatrixDescriptor[T constraints.Integer] struct { Rows T Cols T }
func SliceToDescriptor ¶
func SliceToDescriptor[T constraints.Integer, V any](slice [][]V) MatrixDescriptor[T]
func (MatrixDescriptor[T]) CoordinateToOrdinal ¶
func (t MatrixDescriptor[T]) CoordinateToOrdinal(coord MatrixCoordinate[T]) T
func (MatrixDescriptor[T]) OrdinalToPosition ¶
func (t MatrixDescriptor[T]) OrdinalToPosition(ord T) MatrixCoordinate[T]
Click to show internal directories.
Click to hide internal directories.