diff --git a/src/math/pimathmatrix.h b/src/math/pimathmatrix.h index 82487e28..8e96acb8 100644 --- a/src/math/pimathmatrix.h +++ b/src/math/pimathmatrix.h @@ -248,8 +248,8 @@ inline PIMathMatrixT operator *(const PIMathMatrixT -inline PIMathVectorT operator *(const PIMathMatrixT & fm, - const PIMathVectorT & sv) { +inline PIMathVectorT operator *(const PIMathMatrixT & fm, + const PIMathVectorT & sv) { PIMathVectorT tv; Type t; for (uint j = 0; j < Rows; ++j) { @@ -261,21 +261,20 @@ inline PIMathVectorT operator *(const PIMathMatrixT -inline PIMathVectorT operator *(const PIMathMatrixT & fm, - const PIMathVectorT & sv) { - PIMathVectorT tv; +inline PIMathVectorT operator *(const PIMathVectorT & sv, + const PIMathMatrixT & fm) { + PIMathVectorT tv; Type t; - for (uint j = 0; j < Rows; ++j) { + for (uint j = 0; j < Cols; ++j) { t = Type(0); - for (uint i = 0; i < Cols; ++i) - t += fm[j][i] * sv[i]; + for (uint i = 0; i < Rows; ++i) + t += fm[i][j] * sv[i]; tv[j] = t; } return tv; -}*/ +} /// Multiply value(T) on matrix {Rows x Cols}, result is vector {Rows} template