Macro pathfinding::matrix

source ·
macro_rules! matrix {
    ($a:expr) => { ... };
    ($a:expr, $($b: expr),+) => { ... };
    ($a:expr, $($b: expr),+, ) => { ... };
}
Expand description

The matrix! macro allows the declaration of a Matrix from static data. All rows must have the same number of columns. The data will be copied into the matrix.

Panics

This macro panics if the rows have an inconsistent number of columns.

Example

use pathfinding::matrix;

let m = matrix![[10, 20, 30], [40, 50, 60]];

assert_eq!(m.columns, 3);
assert_eq!(m.rows, 2);