MCPcopy Create free account
hub / github.com/Axect/Peroxide / add

Method add

src/complex/matrix.rs:1097–1108  ·  view source on GitHub ↗
(self, other: Self)

Source from the content-addressed store, hash-verified

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
1111impl<'b> Add<&'b ComplexMatrix> for &ComplexMatrix {

Callers 4

indexMethod · 0.45
index_mutMethod · 0.45
col_mutMethod · 0.45
row_mutMethod · 0.45

Calls 4

cmatrixFunction · 0.85
intoMethod · 0.80
add_vecMethod · 0.45
fmapMethod · 0.45

Tested by

no test coverage detected