|
|
@ -10,21 +10,21 @@ Implement the methods: |
|
|
|
|
|
|
|
|
|
|
|
- `row(n)` which returns the `n`th row in the matrix. |
|
|
|
- `row(n)` which returns the `n`th row in the matrix. |
|
|
|
|
|
|
|
|
|
|
|
- `col(n)` which returns the `n`th |
|
|
|
- `col(n)` which returns the `n`th column in the matrix. |
|
|
|
|
|
|
|
|
|
|
|
Define the matrix multiplication by implementing the std::ops::Mul for the type matrix |
|
|
|
Define the matrix multiplication by implementing the std::ops::Mul for the type matrix |
|
|
|
|
|
|
|
|
|
|
|
### Expected Functions |
|
|
|
### Expected Functions |
|
|
|
|
|
|
|
|
|
|
|
```rust |
|
|
|
```rust |
|
|
|
impl Matrix<T> {Esta errado o public, as funçoes row e col estao baralhadas com number of rows e number of colmns |
|
|
|
impl Matrix<T> { |
|
|
|
pub fn number_of_cols(&self) -> usize { |
|
|
|
pub fn number_of_cols(&self) -> usize { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn number_of_row(&self, n: usize) -> usize { |
|
|
|
pub fn number_of_rows(&self) -> usize { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn rows(&self) -> Vec<T> { |
|
|
|
pub fn rows(&self, n: usize) -> Vec<T> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn col(&self, n: usize) -> Vec<T> { |
|
|
|
pub fn col(&self, n: usize) -> Vec<T> { |
|
|
|