Skip to content
Snippets Groups Projects
Commit 1fa7304f authored by Max Kahnt's avatar Max Kahnt
Browse files

Foward readBinary to dune-matrix-vector module.

parent d8e6de66
No related branches found
No related tags found
No related merge requests found
...@@ -41,23 +41,9 @@ struct GenericVector ...@@ -41,23 +41,9 @@ struct GenericVector
template <class VectorType> template <class VectorType>
static void readBinary(std::istream& s, VectorType& v) static void readBinary(std::istream& s, VectorType& v)
{ {
Dune::Hybrid::forEach(v, [&](auto&& vi) { Dune::MatrixVector::Generic::readBinary(s, v);
GenericVector::readBinary(s, vi);
});
} }
template <class field_type, int n>
static void readBinary(std::istream& s, Dune::FieldVector<field_type,n>& v)
{
typedef typename Dune::FieldVector<field_type,n> VectorType;
typename VectorType::iterator it = v.begin();
typename VectorType::iterator end = v.end();
for(; it!=end; ++it)
s.read(reinterpret_cast<char*>(&(*it)), sizeof(field_type));
}
//! Resize vector recursivly to size of given vector/matrix //! Resize vector recursivly to size of given vector/matrix
template <class VectorTypeA, class VectorTypeB> template <class VectorTypeA, class VectorTypeB>
static void resize(VectorTypeA& a, const VectorTypeB& b) static void resize(VectorTypeA& a, const VectorTypeB& b)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment