Skip to content
Snippets Groups Projects
Forked from Core Modules / dune-common
Source project has a limited visibility.
  • Carsten Gräser's avatar
    38d5ba56
    Add the TupleVector class · 38d5ba56
    Carsten Gräser authored and Christoph Grüninger's avatar Christoph Grüninger committed
    The TupleVector class is a multitype container without
    algebraic operations. It relates to Dune::MultiTypeBlockVector
    like std::vector relates to Dune::BlockVector. This is achived
    by augmenting std::tuple by the following:
    * operator[] for Dune::index_constant aruments
    * static size()
    
    You can now write code like this which will work for multitype
    and classic vector like containers:
    
    using namespace Dune::Hybrid;
    forEach(integralRange(size(v)), [&](auto i) {
        v[i] = i;
    });
    
    Notice that TupleVector was already present as implementation detail
    of two tests in dune-common and that dune-functions and dune-solvers
    also both contained their own variants
    38d5ba56
    History
    Add the TupleVector class
    Carsten Gräser authored and Christoph Grüninger's avatar Christoph Grüninger committed
    The TupleVector class is a multitype container without
    algebraic operations. It relates to Dune::MultiTypeBlockVector
    like std::vector relates to Dune::BlockVector. This is achived
    by augmenting std::tuple by the following:
    * operator[] for Dune::index_constant aruments
    * static size()
    
    You can now write code like this which will work for multitype
    and classic vector like containers:
    
    using namespace Dune::Hybrid;
    forEach(integralRange(size(v)), [&](auto i) {
        v[i] = i;
    });
    
    Notice that TupleVector was already present as implementation detail
    of two tests in dune-common and that dune-functions and dune-solvers
    also both contained their own variants