1#ifndef TATAMI_CONVERT_TO_FRAGMENTED_SPARSE_H
2#define TATAMI_CONVERT_TO_FRAGMENTED_SPARSE_H
5#include "../utils/parallelize.hpp"
6#include "../utils/consecutive_extractor.hpp"
29template<
typename Value_,
typename Index_>
43 std::vector<std::vector<Value_> >
value;
50 std::vector<std::vector<Index_> >
index;
65template<
typename StoredValue_,
typename StoredIndex_,
typename InputValue_,
typename InputIndex_>
79 std::vector<InputValue_>
buffer_v(secondary);
80 std::vector<InputIndex_>
buffer_i(secondary);
101 std::vector<InputValue_>
buffer_v(secondary);
127 if (
matrix->is_sparse()) {
129 std::vector<InputValue_>
buffer_v(primary);
130 std::vector<InputIndex_>
buffer_i(primary);
180template<
typename Value_,
typename Index_,
typename StoredValue_ = Value_,
typename StoredIndex_ = Index_,
typename InputValue_,
typename InputIndex_>
183 return std::shared_ptr<Matrix<Value_, Index_> >(
187 std::vector<std::vector<StoredValue_> >,
188 std::vector<std::vector<StoredIndex_> >
192 std::move(
frag.value),
193 std::move(
frag.index),
204template <
bool row_,
typename StoredValue_,
typename StoredIndex_,
typename InputValue_,
typename InputIndex_>
209template <
bool row_,
typename Value_,
typename Index_,
typename StoredValue_ = Value_,
typename StoredIndex_ = Index_,
typename InputValue_,
typename InputIndex_>
Fragmented sparse matrix representation.
Fragmented sparse matrix representation.
Definition FragmentedSparseMatrix.hpp:435
Virtual class for a matrix.
Definition Matrix.hpp:59
Flexible representations for matrix data.
Definition Extractor.hpp:15
std::shared_ptr< Matrix< Value_, Index_ > > convert_to_fragmented_sparse(const Matrix< InputValue_, InputIndex_ > *matrix, bool row, int threads=1)
Definition convert_to_fragmented_sparse.hpp:181
void parallelize(Function_ fun, Index_ tasks, int threads)
Definition parallelize.hpp:42
FragmentedSparseContents< StoredValue_, StoredIndex_ > retrieve_fragmented_sparse_contents(const Matrix< InputValue_, InputIndex_ > *matrix, bool row, int threads=1)
Definition convert_to_fragmented_sparse.hpp:66
auto consecutive_extractor(const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
Definition consecutive_extractor.hpp:35
Fragmented sparse contents.
Definition convert_to_fragmented_sparse.hpp:30
std::vector< std::vector< Value_ > > value
Definition convert_to_fragmented_sparse.hpp:43
std::vector< std::vector< Index_ > > index
Definition convert_to_fragmented_sparse.hpp:50