Struct pathfinding::SquareMatrix
[−]
[src]
pub struct SquareMatrix<C> { pub size: usize, // some fields omitted }
Square matrix of an arbitrary type
Fields
size: usize
Size of every dimension
Methods
impl<C: Clone> SquareMatrix<C>
[src]
fn new(size: usize, value: C) -> SquareMatrix<C>
[src]
Create new square matrix with an initial value.
fn fill(&mut self, value: C)
[src]
Fill with a known value.
impl<C> SquareMatrix<C>
[src]
fn from_vec(values: Vec<C>) -> SquareMatrix<C>
[src]
Create new square matrix from vector values. The first value will be assigned to index (0, 0), the second one to index (0, 1), and so on.
Panics
This function will panic if the number of values is not a square number.
Trait Implementations
impl<C: Debug> Debug for SquareMatrix<C>
[src]
impl<C: Clone> Clone for SquareMatrix<C>
[src]
fn clone(&self) -> SquareMatrix<C>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C: Clone + Signed> Neg for SquareMatrix<C>
[src]
type Output = SquareMatrix<C>
The resulting type after applying the -
operator.
fn neg(self) -> SquareMatrix<C>
[src]
Performs the unary -
operation.
impl<'a, C> Index<&'a (usize, usize)> for SquareMatrix<C>
[src]
type Output = C
The returned type after indexing.
fn index(&self, index: &'a (usize, usize)) -> &C
[src]
Performs the indexing (container[index]
) operation.