10 #ifndef MUELU_VECTORDROPPINGCLASSICAL_DEF_HPP
11 #define MUELU_VECTORDROPPINGCLASSICAL_DEF_HPP
16 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node, Misc::StrengthMeasure SoC>
27 const std::string& droppingMethod,
29 const bool aggregationMayCreateDirichlet,
30 const bool symmetrizeDroppedGraph,
31 const bool useBlocking,
34 auto lclA = A.getLocalMatrixDevice();
38 if (droppingMethod ==
"point-wise") {
39 auto dropping = ClassicalDropping::make_drop_functor<SoC>(A, threshold, results);
41 if (aggregationMayCreateDirichlet) {
42 if (symmetrizeDroppedGraph) {
44 VectorDroppingClassical::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
48 mark_singletons_as_boundary);
51 VectorDroppingClassical::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
55 mark_singletons_as_boundary);
58 if (symmetrizeDroppedGraph) {
60 VectorDroppingClassical::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
66 VectorDroppingClassical::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
72 }
else if (droppingMethod ==
"cut-drop") {
73 auto comparison = CutDrop::make_comparison_functor<SoC>(A, results);
76 if (symmetrizeDroppedGraph) {
78 VectorDroppingClassical::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
84 VectorDroppingClassical::runDroppingFunctors(A, mergedA, blkPartSize, rowTranslation, colTranslation, results, filtered_rowptr, graph_rowptr, nnz, useBlocking, level, factory,
93 #define MUELU_ETI_GROUP(SC, LO, GO, NO) \
94 MUELU_ETI_SLGN_SoC(MueLu::VectorDroppingClassical, SC, LO, GO, NO)
MueLu::DefaultLocalOrdinal LocalOrdinal
Functor that drops boundary nodes for a blockSize > 1 problem.
Functor that marks singletons (all off-diagonal entries in a row are dropped) as boundary.
Kokkos::View< DecisionType *, memory_space > results_view
typename Teuchos::ScalarTraits< Scalar >::magnitudeType magnitudeType
Class that holds all level-specific information.
static void runDroppingFunctors_on_A(matrix_type &A, matrix_type &mergedA, LocalOrdinal blkPartSize, block_indices_view_type &rowTranslation, block_indices_view_type &colTranslation, results_view &results, rowptr_type &filtered_rowptr, rowptr_type &graph_rowptr, nnz_count_type &nnz, boundary_nodes_type &boundaryNodes, const std::string &droppingMethod, const magnitudeType threshold, const bool aggregationMayCreateDirichlet, const bool symmetrizeDroppedGraph, const bool useBlocking, Level &level, const Factory &factory)
typename local_graph_type::row_map_type::non_const_type rowptr_type
Kokkos::pair< LocalOrdinal, LocalOrdinal > nnz_count_type
Order each row by a criterion, compare the ratio of values and drop all entries once the ratio is bel...
Functor that marks diagonal as kept, unless the are already marked as boundary.
static void runDroppingFunctors(matrix_type &A, matrix_type &mergedA, typename matrix_type::local_ordinal_type &blkPartSize, block_indices_view_type &rowTranslation, block_indices_view_type &colTranslation, results_view &results, rowptr_type &filtered_rowptr, rowptr_type &graph_rowptr, nnz_count_type &nnz, const bool useBlocking, Level &level, const Factory &factory, Functors &...functors)
Functor that drops boundary nodes for a blockSize > 1 problem.
typename MueLu::LWGraph_kokkos< LocalOrdinal, GlobalOrdinal, Node >::boundary_nodes_type boundary_nodes_type
typename Kokkos::View< LocalOrdinal *, typename Node::device_type > block_indices_view_type