Skip to content
Snippets Groups Projects
  1. Nov 23, 2016
  2. Nov 22, 2016
    • Ansgar Burchardt's avatar
      Correct spelling errors [ci skip] · 005780c9
      Ansgar Burchardt authored
      005780c9
    • Ansgar Burchardt's avatar
      Add correct offset for end of chunk · 040d2a87
      Ansgar Burchardt authored
      Using `&current->chunk_ + x` will add `x * sizeof(current->chunk_)` to
      the pointer, but we only want to add `x`.
      
      Adding a much larger number still "works" on 64bit systems (although it
      does not perform the intended check). However on 32bit platforms this
      wraps (at least in the way used by sllisttest.cc) and the "end" of the
      chunk is suddenly before the beginning.
      
      Closes #57
      040d2a87
  3. Nov 20, 2016
    • Carsten Gräser's avatar
      Merge branch 'feature/fix-forloop' into 'master' · b8d06d5c
      Carsten Gräser authored
      [bugfix] Fix possible memory corruption in ForLoop
      
      The reason for perfect forwarding is to also forward r-values as
      r-value references such that the called function can do a move
      on such values.
      As a consequence you should never call `std::forward` on the same
      object twice because the second function may get a moved from
      object since the first one has already stolen the data. E.g.
      for the following operation
      ```cpp
        template<int i>
        struct Operation
        {
          static void apply(std::vector<int> v)
          {}
        };
      ```
      a call to
      ```cpp
        Dune::ForLoop<Operation, 0, 1>::apply(std::vector<int>{1,2,3});
      ```
      will pass a moved from vector in an undefined state on the second call.
      
      BTW: The same error existed in the old implementation of `ForLoop`
      
      See merge request !177
      b8d06d5c
  4. Nov 18, 2016
    • Carsten Gräser's avatar
      [bugfix] Fix possible memory corruption in ForLoop · 2277612d
      Carsten Gräser authored
      The reason for perfect forwarding is to also forward r-values as
      r-value references such that the called function can do a move
      on such values.
      
      As a consequence you should never call std::forward on the same
      object twice because the second function may get a moved from
      object since the first one has already stolen the data. E.g.
      for the following operation
      
        template<int i>
        struct Operation
        {
          static void apply(std::vector<int> v)
          {}
        };
      
      a call to
      
        Dune::ForLoop<Operation, 0, 1>::apply(std::vector<int>{1,2,3});
      
      will pass a moved from vector in an undefined state on the second call.
      
      BTW: The same error existed in the old implementation of ForLoop
      2277612d
    • Ansgar Burchardt's avatar
      Merge branch 'cleanup/extra-semicolon' into 'master' · e683e1df
      Ansgar Burchardt authored
      [cleanup] fix warning: extra ‘;’ [-Wpedantic]
      
      This removes the extra ‘;’ warnings when compiling with -Wpedantic.
      
      See merge request !176
      e683e1df
    • Felix Gruber's avatar
      f9d1bf56
  5. Nov 17, 2016
  6. Nov 14, 2016
    • Carsten Gräser's avatar
      [doc] Update required clang version · fce40000
      Carsten Gräser authored
      fce40000
    • Carsten Gräser's avatar
      Merge branch 'feature/extend-stdapplytest' into 'master' · a392e029
      Carsten Gräser authored
      [test] Check Std::apply() by implementing a tuple transformation
      
      This checks with a real application example: An implementation
      of a tuple transformation.
      
      Maybe we also want to implement our real tuple tranformation
      that way, because its easier to read and much shorter.
      
      See merge request !171
      a392e029
    • Carsten Gräser's avatar
      Merge branch 'feature/add-integersequenceentry' into 'master' · 9e63c2bd
      Carsten Gräser authored
      Feature/add integersequenceentry
      
      The traits class `IntegerSequenceEntry` computes the i-th entry
      of an `std::integer_sequence`. The `integerSequenceEntry` helper
      function does the same with function syntax.
          
       This allows to avoid the hight template instantiation depth
       of `std::make_tuple` when using the "natural" implementation
      
      ```cpp    
      std::get<index>(std::make_tuple(t...));
      ```
          
      The latter adds 15 instantiation levels per argument whereas
      the still recursive implementation in this MR adds only one.
      
      See merge request !170
      9e63c2bd
    • Andreas Dedner's avatar
      Merge branch 'feature/fix-call-MPIfinalize-onlyif-MPIInit-called' into 'master' · 9af12b69
      Andreas Dedner authored
      MPIHelper should only finalize MPI if it called init
      
      MPIHelper only calls MPI if it was not already called before MPIHelper is constructed. Finalize is however always called on destruction leading to
      problems with other packages calling init/finalize before/after MPIHelper
      is setup. Added a bool storing the information if MPIInit was called by the
      MPIHelper so that finalize is only called in that case.
      
      See merge request !58
      9af12b69
    • Carsten Gräser's avatar
      [test] Check Std::apply() by implementing a tuple transformation · 9e3027e5
      Carsten Gräser authored
      This checks with a real application example: An implementation
      of a tuple transformation.
      
      Maybe we also want to implement our real tuple tranformation
      that way, because its easier to read and much shorter.
      9e3027e5
    • Carsten Gräser's avatar
    • Carsten Gräser's avatar
      Implement Hybrid::elementAt() using integerSequenceEntry() · 61a8ac4b
      Carsten Gräser authored
      Now the template instantiation depth for an integer_sequence
      of length n is ~n instead of ~15n (for gcc 6).
      61a8ac4b
    • Carsten Gräser's avatar
      Add IntegerSequenceEntry and integerSequenceEntry · d66ed094
      Carsten Gräser authored
      The traits class IntegerSequenceEntry computes the i-th entry
      of an std::integer_sequence. The integerSequenceEntry helper
      function does the same with function syntax.
      
      This allows to avoid the hight template instantiation depth
      of std::make_tuple when using the "natural" implementation
      
        std::get<index>(std::make_tuple(t...))
      
      The letter adds 15 instantiation levels per argument whereas
      the still recursive implementation in this commit adds only one.
      d66ed094
    • Christoph Grüninger's avatar
      Merge branch 'feature/deprecate_various_static_forloops' into 'master' · 4f193672
      Christoph Grüninger authored
      Deprecate ForLoop, ForEachValue and ForEachValuePair
      
      Deprecate `ForLoop`, `ForEachValue` and `ForEachValuePair` since they are only a useless wrapper around the generic `Hybrid::forEach`.
      
      See merge request !169
      4f193672
    • Marco Agnese's avatar
      deprecate ForLoop, ForEachValue and ForEachValuePair since they are only a... · dc69a72c
      Marco Agnese authored
      deprecate ForLoop, ForEachValue and ForEachValuePair since they are only a useless wrapper around the generic Hybrid::forEach
      dc69a72c
    • Christoph Grüninger's avatar
      Merge branch 'feature/tuplevector' into 'master' · 40752c75
      Christoph Grüninger authored
      Add the TupleVector class
      
      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` arguments
      * `static size()`
          
      You can now write code like this which will work for multitype
      and classic vector like containers:
      
      ```c++    
          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
      
      See merge request !134
      40752c75
  7. Nov 13, 2016
  8. Nov 10, 2016
  9. Nov 08, 2016
  10. Nov 04, 2016
    • Carsten Gräser's avatar
      Merge branch 'feature/overloadset' into 'master' · cbc5dfe1
      Carsten Gräser authored
      Add overload() and orderedOverload()
      
      These helper functions allow to create overload sets from lambdas.
      E.g. one can merge to lambdas for different argument types into
      one overload set in order to easily implement type-specific behaviour
      when looping over a tuple.
      
      While the result of overload(f1, f2,...) will pick the best match
      for a given set of arguments, orderedOverload(f1,f2,...) will pick
      the first match which allows to prevent ambiguity.
      
      This functionality is proposed for the standard in P0051R2
      (open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0051r2.pdf).
      There overload(...) is proposed and an upcomming proposal
      with the functionality of orderedOverload(...) is announced.
      Since the former is not accepted and the latter is not even written
      I did explicitly implement this in Dune:: instead of Dune::Std::.
      
      See merge request !153
      cbc5dfe1
    • Carsten Gräser's avatar
Loading