Skip to content
Snippets Groups Projects
Commit f157ef50 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Remove various binary operators when using dune-common 2.7

The dune-common 2.7 release finally adds all those standard
binary addition, multiplication, etc operators for FieldVector
and FieldMatrix.  Hence we do not have to have our own
implementation anymore.  We still keep it for backward-
compatibility with dune-common 2.6, but guard it behind
cpp conditionals.
parent a8775dc9
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
#include <dune/common/fmatrix.hh>
#if ADOLC_ADOUBLE_H
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
template< int m, int n, int p >
auto operator* ( const Dune::FieldMatrix< adouble, m, n > &A, const Dune::FieldMatrix< adouble, n, p > &B)
-> Dune::FieldMatrix<adouble, m, p>
......@@ -58,7 +59,9 @@ auto operator* ( const Dune::FieldMatrix< double, m, n > &A, const Dune::FieldMa
return ret;
}
#endif
#endif
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
//! 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 Dune::FieldMatrix<K,m,n> &B)
......@@ -87,8 +90,10 @@ auto operator- ( const Dune::FieldMatrix< T, m, n > &A, const Dune::FieldMatrix<
return result;
}
#endif
#if ADOLC_ADOUBLE_H
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
//! calculates ret = A - B
template <int m, int n>
auto operator- ( const Dune::FieldMatrix< adouble, m, n > &A, const Dune::FieldMatrix< double, m, n > &B)
......@@ -103,6 +108,7 @@ auto operator- ( const Dune::FieldMatrix< adouble, m, n > &A, const Dune::FieldM
return result;
}
#endif
//! calculates ret = s*A
template< int m, int n>
......@@ -120,6 +126,7 @@ auto operator* ( const double& s, const Dune::FieldMatrix<adouble, m, n> &A)
}
#endif
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
//! calculates ret = s*A
template< int m, int n>
auto operator* ( const double& s, const Dune::FieldMatrix<double, m, n> &A)
......@@ -134,6 +141,7 @@ auto operator* ( const double& s, const Dune::FieldMatrix<double, m, n> &A)
return ret;
}
#endif
//! calculates ret = A/s
template< class K, int m, int n>
......@@ -149,6 +157,7 @@ Dune::FieldMatrix<K,m,n> operator/ ( const Dune::FieldMatrix<K, m, n> &A, const
return ret;
}
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
//! calculates ret = A/s
template< class K, int m>
Dune::FieldVector<K,m> operator/ ( const Dune::FieldVector<K, m> &A, const K& s)
......@@ -161,5 +170,6 @@ Dune::FieldVector<K,m> operator/ ( const Dune::FieldVector<K, m> &A, const K& s)
return result;
}
#endif
#endif
......@@ -13,6 +13,7 @@
namespace Dune {
#if DUNE_VERSION_LT(DUNE_FUNCTIONS,2,7)
template< class K, int m, int n, int p >
Dune::FieldMatrix< K, m, p > operator* ( const Dune::FieldMatrix< K, m, n > &A, const Dune::FieldMatrix< K, n, p > &B)
{
......@@ -29,6 +30,7 @@ Dune::FieldMatrix< K, m, p > operator* ( const Dune::FieldMatrix< K, m, n > &A,
}
return ret;
}
#endif
namespace GFE {
/** \brief Interpolate in an embedding Euclidean space, and project back onto the Riemannian manifold
......
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