FieldVector nesting fails with bigunsignedint as field in DenseVector::one_norm
Consider this snippet
using Vec = Dune::FieldVector<int, 1>;
using BigVec = Dune::FieldVector<Dune::bigunsignedint<96>, 1>;
BigVec big_vec;
big_vec.one_norm();
Vec vec;
vec.one_norm();
Dune::FieldVector<Vec, 1> vec_vec;
vec_vec.one_norm();
Dune::FieldVector<BigVec, 1> vec_bigvec;
vec_bigvec.one_norm();
This fails to compile in the last line (gcc 5.4, master branch). The compile cannot find a suitable abs function to call in here:
typename FieldTraits<value_type>::real_type one_norm() const {
using std::abs;
typename FieldTraits<value_type>::real_type result( 0 );
for (size_type i=0; i<size(); i++)
result += abs((*this)[i]);
return result;
}
where (*this)[i]
is of type Dune::FieldVector<Dune::bigunsignedint<96>, 1>
then. Since Dune::FieldVector<Vec, 1>().one_norm()
works, I assumed it should also for bigunsignedint
as Filedtype in the inner vector. However I do not understand the method by which this works, so I cannot fix it for bigunsignedint. Can somebody help me?