diff --git a/dune/gfe/linearalgebra.hh b/dune/gfe/linearalgebra.hh index 04f464fa76839b3c336c855d5826c05d77909c46..6e202259663e3203c097693eee23cf2bfb99b3e0 100644 --- a/dune/gfe/linearalgebra.hh +++ b/dune/gfe/linearalgebra.hh @@ -36,4 +36,18 @@ Dune::FieldMatrix<K,m,n> operator- ( const Dune::FieldMatrix<K, m, n> &A, const } +//! calculates ret = A - B +template< class K, int m, int n> +Dune::FieldMatrix<K,m,n> operator/ ( const Dune::FieldMatrix<K, m, n> &A, const K& s) +{ + typedef typename Dune::FieldMatrix<K,m,n> :: size_type size_type; + Dune::FieldMatrix<K,m,n> ret; + + for( size_type i = 0; i < m; ++i ) + for( size_type j = 0; j < n; ++j ) + ret[i][j] = A[i][j] / s; + + return ret; +} + #endif