Skip to content
Snippets Groups Projects
  1. May 31, 2024
  2. Apr 17, 2024
  3. Mar 22, 2024
    • Carsten Gräser's avatar
      [cleanup] Remove unused allocators · 45aae438
      Carsten Gräser authored
      Remove allocator template parameter from the classes
      `base_array_unmanaged`, `compressed_base_array_unmanaged`,
      `block_vector_unmanaged`, `compressed_block_vector_unmanaged`, and
      `CompressedBlockVectorWindow`.
      All of these classes do not manage memory on their own.
      The provided allocator was only used to deduce `size_type`.
      The latter is now provided as template parameter explicitely.
      
      Notice that this (seemigly breaking) change is safe, because
      all these classes are clearly marked as implementation details
      that should not be used outside of dune-istl.
      45aae438
  4. Dec 02, 2022
  5. Sep 30, 2022
  6. Mar 16, 2021
  7. Apr 11, 2020
  8. Mar 05, 2020
  9. Apr 10, 2019
  10. Apr 09, 2019
    • Carsten Gräser's avatar
      Get rid of toVector() · d883ca6e
      Carsten Gräser authored and Oliver Sander's avatar Oliver Sander committed
      Using the wrapper generated by `asVector()` we can get rid of `toVector()`.
      The important difference is, that `toVector()` invokes undefined behaviour
      by dereferencing the result of an aliasing `reinterpret_cast`. However,
      there's no noteable properties of the new implementation:
      * You can't use `asVector()` directly in calls to `mv()` and friends,
        because the latter is not robust wrt. to proxy references.
      * When creating copies of values, you can't replace
        `auto rhs = v[i];` by `auto rhs = Impl::asVector(v[i])`
        because proxy references don't use deep copy on purpose.
        Instead we have to use the two step
        `auto rhsValue = v[i]; auto&& rhs = Impl::asVector(rhsValue);`
      d883ca6e
    • Carsten Gräser's avatar
      Simplify scalar entries in block vector classes · 0e962e10
      Carsten Gräser authored and Oliver Sander's avatar Oliver Sander committed
      Using `Impl::asVector()` we can get rid of several `Hybrid::ifElse()`
      constructions used to implement the special case of scalar entries
      (i.e. `IsNumber==true`).
      0e962e10
  11. Mar 22, 2019
  12. Jan 22, 2019
  13. Dec 17, 2018
  14. Dec 06, 2018
  15. Dec 03, 2018
  16. Nov 12, 2018
  17. Jun 11, 2018
  18. Jun 08, 2018
  19. Jun 04, 2018
  20. May 16, 2018
    • Jö Fahlke's avatar
      [BlockVector] Defer memory management to std::vector. · 60b6e604
      Jö Fahlke authored
      Stop doing memory management ourselves, use a `std::vector` instead.  This has
      the advantage that allocation, deallocation, construction and destruction of
      elements is handled for us using the supplied allocator in an exception-safe
      manner.
      
      This has the disadvantage of using an extra pointer and an extra size_type in
      `base_array_unmanaged`, which are kept syncronized with the `std::vector` used
      as storage.  Anything else would require interface modification of
      `base_array_unmanaged` and `block_vector_unmanaged`, which in turn would
      require modifications to `BlockVectorWindow`, `MatrixBase`, and
      `VariableBlockVector` and make this patch even larger.
      
      This adds a `swap()` operation and move-construction/assignment to
      `BlockVector`.
      
      The one-argument versions of `resize()` and `reserve()` now behave exactly as
      they do for `std::vector`.  This means that using `reserve()` to shrink the
      capacity of a BlockVector no longer has any effect.  Apart from that, the
      behaviour with regard to capacity on copy and move has also changed to that of
      `std::vector`: copying will only expand the capacity of the copied-to vector
      to accomodate the size of the copied-from vector, not necessarily it's
      capacity.
      
      This deprecates the two-argument versions of `resize()` and `reserve()`, and
      makes them behave exactly the same as the one-argument versions, ignoring the
      second argument.  The second argument specified whether or not to copy the old
      values upon reallocation.  This conflicted with the common container semantics
      of always copying/moving.  For `resize()`, it also conflicted with the common
      signature where the second argument specifies the value for newly created
      elements.
      
      There were only two uses of the two-argument version of `resize()` in
      dune-istl that triggered in the unit tests (both in arpackpp.hh), and those
      had no effect different from the the one-argument version, because the
      BlockVectors were empty before the `resize()`.
      
      Fixes: #41
      Requires:
      - dune-common!494 for the tested allocators to be usable with `std::vector`.
      60b6e604
    • Jö Fahlke's avatar
      [cleanup] Remove incomplete Dune::BlockVectorWindow. · e31a1a70
      Jö Fahlke authored
      `Dune::BlockVectorWindow` is declared, but never defined.  Also get rid of
      `BlockVector` assignment from `Dune::BlockVectorWindow` which can't possibly
      have worked, since `Dune::BlockVectorWindow` is incomplete, and there are no
      issues or MRs in istl complaining about this.
      
      Note that there is a similar but unrelated (except possibly historically)
      `Dune::Imp::BlockVectorWindow`.
      e31a1a70
  21. Apr 15, 2018
  22. Nov 17, 2016
    • Oliver Sander's avatar
      Move various implementation classes into the 'Imp' namespace · 13ec7d1b
      Oliver Sander authored and Ansgar Burchardt's avatar Ansgar Burchardt committed
      There are various classes in dune-istl that are effectively implementation
      classes internal to dune-istl. A few of them are base_array_unmanaged,
      base_array_window, compressed_base_array_unmanaged,block_vector_unmanaged,
      BlockVectorWindow, compressed_block_vector_unmanaged, CompressedBlockVectorWindow
      
      See #22 for a brief
      discussion.
      
      This patch moves the classes into the namespace 'Imp'.  That way it is
      clear that they are internal.
      
      All code outside of dune-istl using those classes will break, but does
      such code really exist?
      13ec7d1b
  23. Nov 10, 2016
  24. Oct 25, 2016
    • Carsten Gräser's avatar
      Implement assignment of BlockVector from BlockVectorWindow · b797918e
      Carsten Gräser authored
      The implementation for this was hidden in the base classes
      before and relied on undefined behaviour by using a downcast.
      Now it is explicitly implemented for the derived classes
      which also makes it more visible to users.
      b797918e
    • Carsten Gräser's avatar
      Remove unused methods based on unsave casts · c5e023c5
      Carsten Gräser authored
      These constructors and assignments from base class are
      all using a downcast which may result in undefined behaviour.
      Since this is potentially dangerous and not used anywhere
      in the core modules, this patch removes those methods.
      c5e023c5
  25. Sep 12, 2016
    • Carsten Gräser's avatar
      [comment] Fix comment: This is a downcast · 3aedadf4
      Carsten Gräser authored
      This is in fact an _unsafe_ downcast to a derived
      class. Accessing members via this pointer is undefined
      if it is not guaranteed that the passed pointer
      points to an object of the _derived_ class - even
      if the memory layout is the same. In this case
      this static_cast acts like a reinterpret_cast.
      3aedadf4
  26. Feb 20, 2016
    • Oliver Sander's avatar
      Export the types 'reference' and 'const_reference' · 57141a3a
      Oliver Sander authored
      Just as containers from the standard library do.  These types are needed for
      proper interface testing of the dune-istl vector interface.  For VariableBlockVector,
      in particular, the type used for references is *not* value_type&, and therefore
      the more general approach using a separate 'reference' type is needed.
      57141a3a
  27. Nov 25, 2015
Loading