(self, other: Self)
| 1095 | type Output = Self; |
| 1096 | |
| 1097 | fn add(self, other: Self) -> Self { |
| 1098 | assert_eq!(&self.row, &other.row); |
| 1099 | assert_eq!(&self.col, &other.col); |
| 1100 | |
| 1101 | let mut result = cmatrix(self.data.clone(), self.row, self.col, self.shape); |
| 1102 | for i in 0..self.row { |
| 1103 | for j in 0..self.col { |
| 1104 | result[(i, j)] += other[(i, j)]; |
| 1105 | } |
| 1106 | } |
| 1107 | result |
| 1108 | } |
| 1109 | } |
| 1110 | |
| 1111 | impl<'b> Add<&'b ComplexMatrix> for &ComplexMatrix { |