Commit 18a5b967 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

added dot() for FieldMatrix with 1 row

parent 7b3241de
...@@ -53,6 +53,9 @@ namespace AMDiS ...@@ -53,6 +53,9 @@ namespace AMDiS
REQUIRES( N!=1 && M!=1 )> REQUIRES( N!=1 && M!=1 )>
auto operator*(FieldVector<T,N> const& v, FieldVector<T,M> const& w); auto operator*(FieldVector<T,N> const& v, FieldVector<T,M> const& w);
template <class T, class S, int N>
auto dot(FieldMatrix<T,1,N> const& vec1, FieldMatrix<S,1,N> const& vec2);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/// Sum of vector entires. /// Sum of vector entires.
......
...@@ -85,6 +85,12 @@ auto operator*(FieldVector<T,N> const& v, FieldVector<T,M> const& w) ...@@ -85,6 +85,12 @@ auto operator*(FieldVector<T,N> const& v, FieldVector<T,M> const& w)
return v.dot(w); return v.dot(w);
} }
template <class T, class S, int N>
auto dot(FieldMatrix<T,1,N> const& vec1, FieldMatrix<S,1,N> const& vec2)
{
return vec1[0].dot(vec2[0]);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
namespace Impl namespace Impl
......
Supports Markdown
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