diff --git a/src/complex/matrix.rs b/src/complex/matrix.rs index a3ec647..7afa90a 100644 --- a/src/complex/matrix.rs +++ b/src/complex/matrix.rs @@ -706,6 +706,10 @@ impl MatrixTrait for ComplexMatrix { } } } + + fn shape(&self) -> (usize, usize) { + (self.row, self.col) + } } // ============================================================================= diff --git a/src/structure/matrix.rs b/src/structure/matrix.rs index aa3c01c..0795b28 100644 --- a/src/structure/matrix.rs +++ b/src/structure/matrix.rs @@ -1272,6 +1272,10 @@ impl MatrixTrait for Matrix { } } } + + fn shape(&self) -> (usize, usize) { + (self.row, self.col) + } } impl Matrix { diff --git a/src/traits/matrix.rs b/src/traits/matrix.rs index a2d14c4..10daabd 100644 --- a/src/traits/matrix.rs +++ b/src/traits/matrix.rs @@ -28,6 +28,7 @@ pub trait MatrixTrait: fn to_diag(&self) -> Self; fn submat(&self, start: (usize, usize), end: (usize, usize)) -> Self; fn subs_mat(&mut self, start: (usize, usize), end: (usize, usize), m: &Self); + fn shape(&self) -> (usize, usize); } // ┌─────────────────────────────────────────────────────────┐