Skip to content
Snippets Groups Projects
  1. Aug 05, 2016
  2. Jul 19, 2016
  3. Jul 18, 2016
  4. Jul 07, 2016
  5. Jun 14, 2016
    • Jö Fahlke's avatar
      Merge branch 'feature/issue-5-fix-signed-overflow-warning' into 'master' · 9e4f3530
      Jö Fahlke authored
      Fix "warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]"
      
      This was a tricky one.  It was highly non-obvious why the compiler even ran
      into this issue.  My best guess is as follows: The compiler was trying to
      optimize the loop over the vertices in `testStaticRefinementGeometry()`,
      test-refinement.cc:122.  To do this it needed to statically evaluate
      `vEnd(refinement)`, where `refinement` is unsigned, but converted to int due to
      the signature of `vEnd()`.  The constructed iterator stores it as unsigned
      `_level`, and it also stores the current position as unsigned `_index`.  So there
      is a conversion from unsigned to int and back to unsigned.
      
      Changing the parameter and return value of `vEnd()` to unsigned turns out not to
      be enough: `vEnd` calls `nVertices()`, which also takes and returns an int.
      Changing that to unsigned too is still not enough, because `nVertices` evaluates
      the expression `Power<dimension>::eval((1<<level)+1)`.  While `level` is now
      unsigned, the literal `1`'s are not, and the result of `operator<<()` will have
      the type of the (promoted) left operand (the "usual integral conversions" do
      not happen for `<<`).  Thus we need to change the literals to `1u`.
      
      To be clear: the warning happens because of conversion from unsigned to int
      and then back to unsigned, where the compiler is unable to fully track all
      possible values and cannot prove that everything is fine.
      
      This patch fixes this by making the level parameter unsigned, and by making
      sure that any literals are suffixed by u.
      
      Adresses #5.
      
      See merge request !19
      9e4f3530
  6. Jun 05, 2016
    • Jö Fahlke's avatar
      Fix "warning: assuming signed overflow does not occur when assuming that (X +... · aa7b8dd6
      Jö Fahlke authored
      Fix "warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]"
      
      This was a tricky one.  It was highly non-obvious why the compiler even ran
      into this issue.  My best guess is as follows: The compiler was trying to
      optimize the loop over the vertices in testStaticRefinementGeometry(),
      test-refinement.cc:122.  To do this it needed to statically evaluate
      vEnd(refinement), where refinement is unsigned, but converted to int due to
      the signature of vEnd().  The constructed iterator stores it as unsigned
      _level, and it also stores the current position as unsigned _index.  So there
      is a conversion from unsigned to int and back to unsigned.
      
      Changing the parameter and return value of vEnd() to unsigned turns out not to
      be enough: vEnd calls nVertices(), which also takes and returns an int.
      Changing that to unsigned too is still not enough, because nVertices evaluates
      the expression Power<dimension>::eval((1<<level)+1).  While level is now
      unsigned, the literal 1's are not, and the result of operator<<() will have
      the type of the (promoted) left operand (the "usual integral conversions" do
      not happen for <<).  Thus we need to change the literals to 1u.
      
      To be clear: the warning happens because of conversion from unsigned to int
      and then back to unsigned, where the compiler is unable to fully track all
      possible values and cannot prove that everything is fine.
      
      This patch fixes this by making the level parameter unsigned, and by making
      sure that any literals are suffixed by u.
      
      Adresses #5.
      aa7b8dd6
  7. Jun 04, 2016
  8. Jun 03, 2016
  9. May 28, 2016
  10. May 03, 2016
  11. Apr 29, 2016
    • Jö Fahlke's avatar
      [MultiLinearGeometry] Do not use cref() as if it is a customization point. · 5847134b
      Jö Fahlke authored
      Customization points (like `begin()`) must be found via ADL, which means one
      has to do the two-step construct
      ```
        using std::begin;
        begin(container);
      ```
      Looking at this from a different angle: if a person reading the code sees the
      two-step construct, he will likely assume that it is needed to access a
      customization point when he is not familiar with the function being invoked.
      This leads to confusion if that function is not actually a customization
      point, as in this case `cref()`.
      5847134b
  12. Apr 09, 2016
  13. Mar 21, 2016
  14. Mar 15, 2016
  15. Mar 14, 2016
  16. Mar 12, 2016
    • Jö Fahlke's avatar
      [doxygen] Document extensions to the corner storage in MultiLinearGeometry. · 0e19ea1e
      Jö Fahlke authored
      There are two extensions:
      - It is now sufficient to support `using std::begin; begin(corners);`.
        Previously it was necessary to support `corners.begin();`.  This means that
        C-style arrays should now qualify as corner storage.
      - It is now possible to use a `std::reference_wrapper<T>`, where `T` is a
        suitable container, as the corner storage.  This keeps the actual storage out
        of the geometry, which has lifetime and concurrency implications.
      0e19ea1e
  17. Mar 07, 2016
    • Jö Fahlke's avatar
      [MultiLinearGeometry] Allow std::reference_wrapper of a container as the · 4b59bfd0
      Jö Fahlke authored
      CornerStorage.
      
      This means that the geometry can now easily refer to the actual corner storage
      without containing it itself, while still beeing assignable.
      4b59bfd0
    • Jö Fahlke's avatar
      Merge branch 'feature/fixes-from-patches' into 'master' · 2d08f131
      Jö Fahlke authored
      [GenericGeometry::FieldHelper] Find abs() via argument-dependent lookup, or in std.
      
      This is necessary to work with custom number types.  If they follow the
      standard they are not allowed to put their overload of abs() into namespace
      std.
      
      Also, this avoids issues with the ordering of includes: if std::abs() is used,
      the set of candidates for abs() is fixed when the compiler sees the
      GenericGeometry::FieldHelper template.  If the header for the custom number
      type is included later, any definition of abs() there won't be taken into
      account, even if that header puts that definition into namespace std.  This is
      not an issue with argumend-dependent lookup.
      
      See merge request !11
      2d08f131
    • Jö Fahlke's avatar
      [GenericGeometry::FieldHelper] Find abs() via argument-dependent lookup, or in std. · a42d67bd
      Jö Fahlke authored
      This is necessary to work with custom number types.  If they follow the
      standard they are not allowed to put their overload of abs() into namespace
      std.
      
      Also, this avoids issues with the ordering of includes: if std::abs() is used,
      the set of candidates for abs() is fixed when the compiler sees the
      GenericGeometry::FieldHelper template.  If the header for the custom number
      type is included later, any definition of abs() there won't be taken into
      account, even if that header puts that definition into namespace std.  This is
      not an issue with argumend-dependent lookup.
      a42d67bd
  18. Feb 25, 2016
    • Christoph Grüninger's avatar
      Merge branch 'feature/bump-required-cmake-version' into 'master' · 8e38b347
      Christoph Grüninger authored
      [cmake] bump minimum required version
      
      This is basically redundant, as dune-common requires it, but minimum
      versions should be consistent among the core modules.
      
      See merge request !9
      8e38b347
    • Christoph Grüninger's avatar
      Merge branch 'feature/fix-tests-on-make-all' into 'master' · f5e3981b
      Christoph Grüninger authored
      [cmake][bugfix] Correct handling of the EXCLUDE_FROM_ALL property:
      
      The signature of `dune_add_test`, that takes the `TARGET` from the user
      produced excluded targets if added in a directory that has the directory
      property `EXCLUDE_FROM_ALL` set. The correct solution IMO is to not use
      that property on test subdirectories anymore (it is a relic from the old
      testing magic), because we rely on `dune_add_test` to handle exclusion.
      
      See dune-common#21 for details.
      
      See merge request !8
      f5e3981b
  19. Feb 24, 2016
  20. Feb 22, 2016
    • Dominic Kempf's avatar
      [cmake][bugfix] Correct handling of the EXCLUDE_FROM_ALL property: · 246b2033
      Dominic Kempf authored
      The signature of `dune_add_test`, that takes the `TARGET` from the user
      produced excluded targets if added in a directory that has the directory
      property `EXCLUDE_FROM_ALL` set. The correct solution IMO is to not use
      that property on test subdirectories anymore (it is a relic from the old
      testing magic), because we rely on `dune_add_test` to handle exclusion.
      
      See dune-common#21 for details.
      246b2033
  21. Jan 31, 2016
  22. Jan 30, 2016
  23. Dec 22, 2015
  24. Dec 21, 2015
  25. Dec 18, 2015
  26. Dec 17, 2015
  27. Dec 15, 2015
Loading