git-svn-id: svn://db.shs.com.ru/pip@768 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -536,6 +536,23 @@ inline PIMathVector<Type> operator *(const PIMathMatrix<Type> & fm,
|
||||
return tv;
|
||||
}
|
||||
|
||||
|
||||
/// Multiply vector {Rows} on matrix {Rows x Cols}, result is vector {Cols}
|
||||
template<typename Type>
|
||||
inline PIMathVector<Type> operator *(const PIMathVector<Type> & sv,
|
||||
const PIMathMatrix<Type> & fm) {
|
||||
uint c = fm.cols(), r = fm.rows();
|
||||
PIMathVector<Type> tv(c);
|
||||
Type t;
|
||||
for (uint j = 0; j < c; ++j) {
|
||||
t = Type(0);
|
||||
for (uint i = 0; i < r; ++i)
|
||||
t += fm.element(i, j) * sv[i];
|
||||
tv[j] = t;
|
||||
}
|
||||
return tv;
|
||||
}
|
||||
|
||||
/// Multiply value(T) on matrix {Rows x Cols}, result is vector {Rows}
|
||||
template<typename Type>
|
||||
inline PIMathMatrix<Type> operator *(const Type & x, const PIMathMatrix<Type> & v) {
|
||||
|
||||
Reference in New Issue
Block a user