1#ifndef TATAMI_CHUNKED_SPARSE_SLAB_FACTORY_HPP
2#define TATAMI_CHUNKED_SPARSE_SLAB_FACTORY_HPP
27template<
typename Value_,
typename Index_,
typename Count_ = Index_>
93 size_t my_offset_slab = 0, my_offset_number = 0;
94 size_t my_target_dim, my_non_target_dim, my_slab_size;
95 bool my_needs_value, my_needs_index;
96 std::vector<Value_> my_value_pool;
97 std::vector<Index_> my_index_pool;
98 std::vector<Count_> my_number_pool;
142 output.number = my_number_pool.data() + my_offset_number;
143 my_offset_number += my_target_dim;
145 if (my_needs_value) {
146 output.values.reserve(my_target_dim);
147 auto vptr = my_value_pool.data() + my_offset_slab;
148 for (
size_t p = 0;
p < my_target_dim; ++
p,
vptr += my_non_target_dim) {
153 if (my_needs_index) {
154 output.indices.reserve(my_target_dim);
155 auto iptr = my_index_pool.data() + my_offset_slab;
156 for (
size_t p = 0;
p < my_target_dim; ++
p,
iptr += my_non_target_dim) {
161 my_offset_slab += my_slab_size;
Methods to handle chunked tatami matrices.
Definition ChunkDimensionStats.hpp:4
Statistics for regular chunks along a dimension.
Definition ChunkDimensionStats.hpp:35
Statistics for slab caching.
Definition SlabCacheStats.hpp:20
Sparse slab.
Definition SparseSlabFactory.hpp:104
std::vector< Index_ * > indices
Definition SparseSlabFactory.hpp:123
std::vector< Value_ * > values
Definition SparseSlabFactory.hpp:113
Count_ * number
Definition SparseSlabFactory.hpp:131
Factory for sparse slabs.
Definition SparseSlabFactory.hpp:28
Slab create()
Definition SparseSlabFactory.hpp:140
SparseSlabFactory(size_t target_dim, size_t non_target_dim, size_t max_slabs, bool needs_value, bool needs_index)
Definition SparseSlabFactory.hpp:64
SparseSlabFactory(size_t target_dim, size_t non_target_dim, size_t slab_size, size_t max_slabs, bool needs_value, bool needs_index)
Definition SparseSlabFactory.hpp:39
SparseSlabFactory(size_t target_dim, size_t non_target_dim, const SlabCacheStats &stats, bool needs_value, bool needs_index)
Definition SparseSlabFactory.hpp:75