[][src]Struct pathfinding::matrix::Matrix

pub struct Matrix<C> {
    pub rows: usize,
    pub columns: usize,
    // some fields omitted
}

Matrix of an arbitrary type. Data are stored consecutively in memory, by rows. Raw data can be accessed using as_ref() or as_mut().

Fields

Rows

Columns

Methods

impl<C: Clone> Matrix<C>
[src]

Create new matrix with an initial value.

Create new square matrix with initial value.

Fill with a known value.

Return a copy of a sub-matrix.

Return a copy of a matrix rotated clock-wise a number of times.

Return a copy of a matrix rotated counter-clock-wise a number of times.

Return a copy of the matrix flipped along the vertical axis.

Return a copy of the matrix flipped along the horizontal axis.

Return a copy of the matrix after transposition.

Extend the matrix in place by adding one full row.

Panics

This function panics if the row does not have the expected number of elements.

impl<C: Copy> Matrix<C>
[src]

Replace a slice of the current matrix with the content of another one.

impl<C> Matrix<C>
[src]

Create new 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 does not correspond to the announced size.

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.

Create new empty matrix with a predefined number of rows. This is useful to gradually build the matrix and extend it later using extend and does not require a filler element compared to Matrix::new.

Check if a matrix is a square one.

Index in raw data of a given position.

Flip the matrix around the vertical axis.

Flip the matrix around the horizontal axis.

Rotate a square matrix clock-wise a number of times.

Panics

This function panics if the matrix is not square.

Rotate a square matrix counter-clock-wise a number of times.

Panics

This function panics if the matrix is not square.

Trait Implementations

impl<C: Copy> Weights<C> for Matrix<C>
[src]

Return the number of rows.

Return the number of columns.

Return the element at position.

Return the negated weights.

impl<C> AsMut<[C]> for Matrix<C>
[src]

Performs the conversion.

impl<C: PartialEq> PartialEq<Matrix<C>> for Matrix<C>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<C> AsRef<[C]> for Matrix<C>
[src]

Performs the conversion.

impl<C: Clone> Clone for Matrix<C>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<C: Eq> Eq for Matrix<C>
[src]

impl<C: Debug> Debug for Matrix<C>
[src]

Formats the value using the given formatter. Read more

impl<C: Clone + Signed> Neg for Matrix<C>
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<'a, C> Index<&'a (usize, usize)> for Matrix<C>
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<'a, C> IndexMut<&'a (usize, usize)> for Matrix<C>
[src]

Performs the mutable indexing (container[index]) operation.

impl<C: Hash> Hash for Matrix<C>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl<C> Send for Matrix<C> where
    C: Send

impl<C> Sync for Matrix<C> where
    C: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

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

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

Compare self to key and return true if they are equal.