Comparing sensitive data, confidential files or internal emails?

Most legal and privacy policies prohibit uploading sensitive data online. Diffchecker Desktop ensures your confidential information never leaves your computer. Work offline and compare documents securely.

Matrix Multiply Row/Column Difference

Created Diff never expires
3 removals
14 lines
3 additions
14 lines
mat33 operator*(const mat33& lhs, const mat33& rhs) {
mat33 operator*(const mat33& lhs, const mat33& rhs) {
mat33 m;
mat33 m;
for (int r = 0; r < 3; ++r) {
for (int r = 0; r < 3; ++r) {
for (int c = 0; c < 3; ++c) {
for (int c = 0; c < 3; ++c) {
float elem = 0.0f;
float elem = 0.0f;
for (int s = 0; s < 3; ++s) {
for (int s = 0; s < 3; ++s) {
elem += lhs.data[row_col_rm(r, s)] *
elem += lhs.data[row_col_cm(r, s)] *
rhs.data[row_col_rm(s, c)];
rhs.data[row_col_cm(s, c)];
}
}
m.data[row_col_rm(r, c)] = elem;
m.data[row_col_cm(r, c)] = elem;
}
}
}
}
return m;
return m;
}
}