diff --git a/src_main/math/pimathmatrix.h b/src_main/math/pimathmatrix.h index f9c3e973..09e6905c 100644 --- a/src_main/math/pimathmatrix.h +++ b/src_main/math/pimathmatrix.h @@ -527,11 +527,11 @@ inline PIMathVector operator *(const PIMathMatrix & fm, PIMathVector tv(r); if (c != sv.size()) return tv; Type t; - for (uint i = 0; i < r; ++i) { + for (uint j = 0; j < r; ++j) { t = Type(0); - for (uint j = 0; j < c; ++j) - t += fm.element(j, i) * sv[j]; - tv[i] = t; + for (uint i = 0; i < c; ++i) + t += fm.element(j, i) * sv[i]; + tv[j] = t; } return tv; }