11#include <kernel/util/memory_arbiter.hpp>
12#include <kernel/util/type_traits.hpp>
13#include <kernel/adjacency/graph.hpp>
14#include <kernel/lafem/forward.hpp>
15#include <kernel/lafem/container.hpp>
40 template<
typename DT_,
typename IT_>
51 template <
typename DT2_ = DT_,
typename IT2_ = IT_>
55 template <
typename DataType2_,
typename IndexType2_>
100 MatrixMirrorBuffer(graph.get_num_nodes_domain(), graph.get_num_nodes_image(), graph.get_num_indices(), entries_per_nonzero_in)
110 FEAT_PRAGMA_OMP(parallel
for)
112 prow_ptr[i] = IT_(dom_ptr[i]);
114 FEAT_PRAGMA_OMP(parallel
for)
115 for(
Index i = 0; i < num_nnze; ++i)
116 pcol_idx[i] = IT_(img_idx[i]);
135 XASSERT(val_in.
size() % entries_per_nonzero_in == 0);
172 this->
move(std::forward<MatrixMirrorBuffer>(other));
186 t.
clone(*
this, clone_mode);
198 template<
typename DT2_,
typename IT2_>
211 template <
typename DT2_,
typename IT2_>
323 return Memory::TypedView<DT_>();
330 return Memory::TypedView<DT_>();
331 return Memory::TypedView<IT_>(this->
_elements.at(0).view(loc, acc));
337 return Memory::TypedView<IT_>();
344 return Memory::TypedView<IT_>();
351 return Memory::TypedView<IT_>();
358 return Memory::TypedView<IT_>();
359 return Memory::TypedView<IT_>(this->
_indices.at(0).view(loc, acc));
365 return Memory::TypedView<IT_>();
372 return Memory::TypedView<IT_>();
379 return Memory::TypedView<IT_>();
386 return Memory::TypedView<IT_>();
387 return Memory::TypedView<IT_>(this->
_indices.at(1).view(loc, acc));
#define XASSERT(expr)
Assertion macro definition.
Adjacency Graph implementation.
Index * get_domain_ptr()
Returns the domain pointer array.
Index * get_image_idx()
Returns the image node index array.
Index get_num_indices() const
Returns the total number indices.
void move(Container &&source)
Assignment move operation.
void clone(const Container &source, CloneMode clone_mode=CloneMode::Weak)
Clone operation.
std::vector< Index > _elements_size
List of corresponding datatype array sizes.
void assign(const Container< DT2_, IT2_ > &other)
Assignment operation.
std::vector< Memory::Arbiter > _indices
List of pointers to all IT_ dependent arrays.
std::vector< Index > _indices_size
List of corresponding IT_ array sizes.
std::vector< Memory::Arbiter > _elements
List of pointers to all datatype dependent arrays.
std::vector< Index > _scalar_index
List of scalars with datatype index.
Dense data vector class template.
Memory::Arbiter & elements_arbiter()
Returns a reference to the element array arbiter.
Index size() const
Returns the size of this vector, i.e. its number of entries.
Matrix Mirror Buffer class template.
Index num_rows() const
Retrieve matrix row count.
const Memory::Arbiter & row_ptr_arbiter() const
Returns a reference to the row-pointer array arbiter.
IT_ IndexType
Our indextype.
const Memory::Arbiter & col_idx_arbiter() const
Returns a reference to the column-index array arbiter.
const Memory::Arbiter & val_arbiter() const
Returns a reference to the values array arbiter.
Memory::Arbiter & col_idx_arbiter()
Returns a reference to the column-index array arbiter.
MatrixMirrorBuffer(const Index rows_in, const Index columns_in, Index entries_per_nonzero_in, DenseVector< IT_, IT_ > &col_idx_in, DenseVector< DT_, IT_ > &val_in, DenseVector< IT_, IT_ > &row_ptr_in)
Constructor.
void convert(const MatrixMirrorBuffer< DT2_, IT2_ > &other)
Conversion method.
MatrixMirrorBuffer clone(CloneMode clone_mode=CloneMode::Weak) const
Clone operation.
Memory::Arbiter & val_arbiter()
Returns a reference to the values array arbiter.
MatrixMirrorBuffer(MatrixMirrorBuffer &&other)
Move Constructor.
DT_ DataType
Our datatype.
Index num_cols() const
Retrieve matrix column count.
Memory::Arbiter & row_ptr_arbiter()
Returns a reference to the row-pointer array arbiter.
MatrixMirrorBuffer(Index rows_in, Index columns_in, Index used_elements_in, Index entries_per_nonzero_in)
Basic Constructor.
MatrixMirrorBuffer & operator=(MatrixMirrorBuffer &&other)
Assignment move operator.
MatrixMirrorBuffer()=default
Constructor.
Index num_nzes() const
Retrieve non zero element count.
MatrixMirrorBuffer(const Adjacency::Graph &graph, Index entries_per_nonzero_in)
Constructor.
Index num_nzes_raw() const
Retrieve total length of value array.
DT_ ValueType
Our value type.
void clone(const MatrixMirrorBuffer< DT2_, IT2_ > &other, CloneMode clone_mode=CloneMode::Weak)
Clone operation.
Index entries_per_nonzero() const
Retrieve entries per non zero element count.
Arbiter attach(std::size_t offset=0u, std::size_t size=full_size) const
Creates a new arbiter that is attached to the same memory block as this arbiter.
Access
Memory access enumeration.
@ read_write
read-write access
@ write
write-only access (see attention note above)
Location
Memory location enumeration.
std::uint64_t Index
Index data type.