From 8512f6c66f5908364e51407b530aa33ced263b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Wed, 25 May 2016 13:50:43 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@202 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/math/pimathmatrix.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) 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