From c3e58cd5b2c5cedba8aecbf8048b97bb7adedd18 Mon Sep 17 00:00:00 2001 From: "Jacob.lsx" Date: Fri, 5 Feb 2021 15:49:17 +0800 Subject: [PATCH] [Fix]: optimize matrix_3x3 & matrix_3x1 function --- src/mynteye/device/motions.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mynteye/device/motions.cc b/src/mynteye/device/motions.cc index 36a1080..d292fec 100644 --- a/src/mynteye/device/motions.cc +++ b/src/mynteye/device/motions.cc @@ -27,6 +27,7 @@ void matrix_3x1(const double (*src1)[3], const double (*src2)[1], double (*dst)[1]) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 1; j++) { + dst[i][j] = 0.; for (int k = 0; k < 3; k++) { 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]) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { + dst[i][j] = 0.; for (int k = 0; k < 3; k++) { dst[i][j] += src1[i][k] * src2[k][j]; }