pub trait Matrix { // Required methods fn width(&self) -> usize; fn height(&self) -> usize; // Provided methods fn size(&self) -> (usize, usize) { ... } fn is_square(&self) -> bool { ... } }
行列
行列の列数を返す。
行列の行数を返す。
行数の行数と列数のペアを返す。
行列が正方であるかどうかを判定する。