Skip to content
Snippets Groups Projects
Commit fd12389f authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

add division of FieldMatrix by scalar

[[Imported from SVN: r7561]]
parent a8d8276f
No related branches found
No related tags found
No related merge requests found
...@@ -36,4 +36,18 @@ Dune::FieldMatrix<K,m,n> operator- ( const Dune::FieldMatrix<K, m, n> &A, const ...@@ -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 #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment