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

Forward writeBinary to dune-matrix-vector module.

parent 72e5ac11
No related branches found
No related tags found
No related merge requests found
...@@ -34,19 +34,7 @@ struct GenericVector ...@@ -34,19 +34,7 @@ struct GenericVector
template <class VectorType> template <class VectorType>
static void writeBinary(std::ostream& s, const VectorType& v) static void writeBinary(std::ostream& s, const VectorType& v)
{ {
Dune::Hybrid::forEach(v, [&](auto&& vi) { Dune::MatrixVector::Generic::writeBinary(s, v);
GenericVector::writeBinary(s, vi);
});
}
template <class field_type, int n>
static void writeBinary(std::ostream& s, const Dune::FieldVector<field_type,n>& v)
{
typedef typename Dune::FieldVector<field_type,n> VectorType;
typename VectorType::const_iterator it = v.begin();
typename VectorType::const_iterator end = v.end();
for(; it!=end; ++it)
s.write(reinterpret_cast<const char*>(&(*it)), sizeof(field_type));
} }
//! Read vector from a given stream //! Read vector from a given stream
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment