[Fix]: optimize matrix_3x3 & matrix_3x1 function

This commit is contained in:
Jacob.lsx 2021-02-05 15:49:17 +08:00
parent c43526ceb8
commit c3e58cd5b2

View File

@ -27,6 +27,7 @@ void matrix_3x1(const double (*src1)[3], const double (*src2)[1],
double (*dst)[1]) { double (*dst)[1]) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
for (int j = 0; j < 1; j++) { for (int j = 0; j < 1; j++) {
dst[i][j] = 0.;
for (int k = 0; k < 3; k++) { for (int k = 0; k < 3; k++) {
dst[i][j] += src1[i][k] * src2[k][j]; dst[i][j] += src1[i][k] * src2[k][j];
} }
@ -38,6 +39,7 @@ void matrix_3x3(const double (*src1)[3], const double (*src2)[3],
double (*dst)[3]) { double (*dst)[3]) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
dst[i][j] = 0.;
for (int k = 0; k < 3; k++) { for (int k = 0; k < 3; k++) {
dst[i][j] += src1[i][k] * src2[k][j]; dst[i][j] += src1[i][k] * src2[k][j];
} }