From 0ed08b3ca9bed4d2c1a1f1bb3075576be1cd4e72 Mon Sep 17 00:00:00 2001 From: Soumya Date: Mon, 30 Sep 2024 12:33:29 +0200 Subject: [PATCH] Added and fixed some comments --- src/complex/matrix.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/complex/matrix.rs b/src/complex/matrix.rs index f757e79e..4bea3083 100644 --- a/src/complex/matrix.rs +++ b/src/complex/matrix.rs @@ -376,9 +376,9 @@ impl ComplexMatrix { /// ); /// println!("{}", a.spread()); // same as println!("{}", a); /// // Result: - /// // c[0] c[1] - /// // r[0] 1 3 - /// // r[1] 2 4 + /// // c[0] c[1] + /// // r[0] 1+1i 3+3i + /// // r[1] 2+2i 4+4i /// ``` pub fn spread(&self) -> String { assert_eq!(self.row * self.col, self.data.len()); @@ -662,7 +662,7 @@ impl ComplexMatrix { pub fn to_vec(&self) -> Vec>> { let mut result = vec![vec![Complex::zero(); self.col]; self.row]; for i in 0..self.row { - result[i] = self.row(i); // ToDo: needs row implementation + result[i] = self.row(i); } result } @@ -1886,6 +1886,7 @@ pub trait LinearAlgebra { fn solve(&self, b: &Vec>, sk: SolveKind) -> Vec>; fn solve_mat(&self, m: &ComplexMatrix, sk: SolveKind) -> ComplexMatrix; fn is_symmetric(&self) -> bool; + // ToDo: Add other fn of this trait from src/structure/matrix.rs } impl LinearAlgebra for ComplexMatrix {