Matrix Multiply Row/Column Multi-Dimension Difference
3 removals
13 lines
3 additions
13 lines
mat3_t operator*(const mat3_t& lhs, const mat3_t& rhs) {
mat3_t operator*(const mat3_t& lhs, const mat3_t& rhs) {
mat3_t m;
mat3_t 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.rows[r][s] * rhs.rows[s][c];
elem += lhs.cols[s][r] * rhs.cols[c][s];
}
}
m.rows[r][c] = elem;
m.cols[c][r] = elem;
}
}
}
}
return m;
return m;
}
}