Commit de6bb9ba authored by Backofen, Rainer's avatar Backofen, Rainer
Browse files

added operator: WorlMatrix*scalar->WorldMatrix and WorldMatrix*WorldVector->WorldVector

parent 365bc7e9
......@@ -585,6 +585,35 @@ namespace AMDiS {
template<typename T>
const WorldMatrix<T>& operator+=(WorldMatrix<T>& m1, const WorldMatrix<T>& m2);
template<typename T>
WorldMatrix<T> operator*(const WorldMatrix<T>& v, double d)
{
WorldMatrix<T> result = v;
result *= d;
return result;
}
template<typename T>
WorldMatrix<T> operator*(double d, const WorldMatrix<T>& v)
{
return v * d;
}
template<typename T>
WorldMatrix<T> operator/(const WorldMatrix<T>& v, double d)
{
WorldMatrix<T> result = v;
result = 1./d*v;
return result;
}
template<typename T>
WorldVector<T> operator*(const WorldMatrix<T>& M, const WorldVector<T>& v )
{
WorldVector<T> res;
res.multMatrixVec(M,v);
return res;
}
inline double norm(const WorldVector<double>& v)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment