11 #ifndef BOGUS_COLORING_HPP
12 #define BOGUS_COLORING_HPP
14 #include "../Block.fwd.hpp"
24 std::vector< std::ptrdiff_t >
colors ;
30 template <
typename Derived >
33 std::size_t size()
const {
return permutation.size() ; }
38 #ifndef BOGUS_DONT_PARALLELIZE
39 #pragma omp parallel for
41 for( std::ptrdiff_t i = 0 ; i < (std::ptrdiff_t)
permutation.size() ; ++ i )
47 void reset( std::size_t n )
57 template <
typename Derived >
58 void compute(
const SparseBlockMatrixBase< Derived >& matrix ) ;
60 template <
typename Derived >
61 void compute(
const BlockMatrixBase< Derived >& matrix ) ;
Base class for dense and sparse block matrices, thought dense don't exist yet.
Definition: BlockMatrixBase.hpp:22
std::vector< std::ptrdiff_t > colors
Index of first row for each color.
Definition: Coloring.hpp:24
std::vector< std::size_t > permutation
Computed permuation so that each color is contiguous.
Definition: Coloring.hpp:22
void resetPermutation()
Sets the permutation to the identity. Keep the current colors.
Definition: Coloring.hpp:36
void update(const bool enable, const BlockMatrixBase< Derived > &matrix)
Computes a coloring for matrix, or simply reset it if enable is false.
Coloring algorithm to determine which rows of a matrix can be treated in parallel.
Definition: Coloring.hpp:20