|
dune-istl 2.12-git
|
Loading...
Searching...
No Matches
experimental/matrix.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
69 Matrix(std::shared_ptr<const pattern_type> pattern, const allocator_type &allocator = allocator_type());
152 static void constructBlock(BlockAlloc& block_alloc, block_iter_type ptr, const Alloc& alloc, Args&&... args);
161 block_iter_type allocateData(const Alloc& alloc, size_type count, ConstructFn&& construct_fn, RestoreFn&& restore_fn);
184 // Lightweight replacement of std::uses_allocator_construction_args without overloads to std::pair
190 if constexpr (!std::uses_allocator_v<std::remove_cv_t<T>, Alloc> && std::is_constructible_v<T, Args...>) {
220 void Matrix<B, P, A>::constructBlock(BlockAlloc& block_alloc, block_iter_type ptr, const Alloc& alloc, Args&&... args)
229 auto Matrix<B, P, A>::allocateData(const Alloc& alloc, size_type count, ConstructFn&& construct_fn) -> block_iter_type
231 return allocateData(alloc, count, std::forward<ConstructFn>(construct_fn), [](size_type, block_type&) {});
236 auto Matrix<B, P, A>::allocateData(const Alloc& alloc, size_type count, ConstructFn&& construct_fn, RestoreFn&& restore_fn) -> block_iter_type
265 block_iter_type data_ptr = allocateData(alloc_, count, [this](auto& block_alloc, block_iter_type ptr, size_type) {
278 block_iter_type data_ptr = allocateData(alloc_, count, [this, other_data](auto& block_alloc, block_iter_type ptr, size_type i) {
324 Matrix<B, P, A>::Matrix(std::shared_ptr<pattern_type const> pattern, const allocator_type &allocator)
337 using pattern_alloc_type = typename std::allocator_traits<allocator_type>::template rebind_alloc<P>;
354 : Matrix(other, std::allocator_traits<allocator_type>::select_on_container_copy_construction(other.alloc_))
378 DUNE_THROW(InvalidStateException, "Cannot swap Matrix instances with unequal allocators when propagate_on_container_swap is false");
395 if constexpr (std::allocator_traits<allocator_type>::propagate_on_container_copy_assignment::value)
403 new_block_ptr = allocateData(target_alloc, new_pattern_view->count(), [&](auto& block_alloc, block_iter_type ptr, size_type i) {
453 if constexpr (std::allocator_traits<allocator_type>::propagate_on_container_move_assignment::value) {
#define DUNE_NO_UNIQUE_ADDRESS
STL namespace.
Definition experimental/bcrsmatrix.hh:21
void destroy(pointer p)
#define DUNE_THROW(E,...)
void swap(T &v1, T &v2, bool mask)
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
span(T(&)[N]) -> span< T, N >
Owning matrix container built on top of MatrixView.
Definition experimental/matrix.hh:44
~Matrix()
Destructor releases owned block storage.
Definition experimental/matrix.hh:346
Matrix(pattern_type &&pattern, const allocator_type &allocator=allocator_type())
Construct from an rvalue pattern.
Definition experimental/matrix.hh:334
A allocator_type
Allocator type used by this container.
Definition experimental/matrix.hh:56
Matrix(const allocator_type &allocator=allocator_type())
Construct an empty matrix with allocator allocator.
Definition experimental/matrix.hh:318
std::shared_ptr< const pattern_type > patternStorage() const
Get shared storage of the pattern.
Definition experimental/matrix.hh:134
friend void swap(Matrix &lhs, Matrix &rhs)
Swap contents of lhs and rhs, honoring allocator swap propagation traits.
Definition experimental/matrix.hh:128
Matrix(const Matrix &other, const allocator_type &allocator)
Copy constructor.
Definition experimental/matrix.hh:358
Matrix & operator=(const Matrix &other)
Copy assignment.
Definition experimental/matrix.hh:391
Matrix(const Matrix &other)
Copy constructor.
Definition experimental/matrix.hh:353
void swap(Matrix &other)
Swap contents of this matrix with other, honoring allocator swap propagation traits.
Definition experimental/matrix.hh:373
Matrix(std::shared_ptr< const pattern_type > pattern, const allocator_type &allocator=allocator_type())
Construct from a shared pattern.
Definition experimental/matrix.hh:324
Matrix(Matrix &&other, const allocator_type &allocator)
Move construct with explicit allocator.
Definition experimental/matrix.hh:429
Matrix(Matrix &&other)
Move constructor.
Definition experimental/matrix.hh:419
allocator_type get_allocator() const
Return the allocator currently associated with this matrix.
Definition experimental/matrix.hh:367
Matrix & operator=(Matrix &&other)
Move assignment.
Definition experimental/matrix.hh:448
Non-owning matrix view over external block storage and pattern.
Definition matrixview.hh:54
P pattern_type
The type used for the sparsity pattern.
Definition matrixview.hh:66
B block_iter_type
The iterator type used to access the blocks of the matrix.
Definition matrixview.hh:57
const pattern_type & pattern() const
Definition matrixview.hh:248
void resetView(block_iter_type block_iter, pattern_type const *pattern_ptr)
Reset the view to point to block_iter and pattern_ptr.
Definition matrixview.hh:263
pattern_type const * patternPtr() const
Return the underlying pattern pointer.
Definition matrixview.hh:280
block_iter_type blockIter()
Return the underlying block iterator.
Definition matrixview.hh:270
std::ranges::range_size_t< pattern_type > size_type
The type used to count elements in the row and column index sets.
Definition matrixview.hh:74
Const block iterator adapter.
Definition matrixview.hh:324
T addressof(T... args)
T apply(T... args)
T forward_as_tuple(T... args)
T get(T... args)
T is_constructible_v
T swap(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8