10 #ifndef IFPACK2_LINEAR_PARTITIONER_DEF_HPP
11 #define IFPACK2_LINEAR_PARTITIONER_DEF_HPP
12 #include "Ifpack2_ConfigDefs.hpp"
13 #include "Ifpack2_LinearPartitioner_decl.hpp"
19 template <
class GraphType>
24 template <
class GraphType>
27 template <
class GraphType>
31 template <
class GraphType>
41 const int mod = as<int>(this->Graph_->getLocalNumRows() /
42 this->NumLocalParts_);
43 for (
size_t i = 0; i < this->Graph_->getLocalNumRows(); ++i) {
44 this->Partition_[i] = as<local_ordinal_type>(i / mod);
45 if (this->Partition_[i] >= as<local_ordinal_type>(this->NumLocalParts_)) {
46 this->Partition_[i] = this->NumLocalParts_ - 1;
53 #define IFPACK2_LINEARPARTITIONER_INSTANT(LO, GO, N) \
54 template class Ifpack2::LinearPartitioner<Tpetra::CrsGraph<LO, GO, N> >; \
55 template class Ifpack2::LinearPartitioner<Tpetra::RowGraph<LO, GO, N> >;
57 #endif // IFPACK2_LINEARPARTITIONER_DEF_HPP
void computePartitions()
Compute the partitions.
Definition: Ifpack2_LinearPartitioner_def.hpp:32
virtual ~LinearPartitioner()
Destructor.
Definition: Ifpack2_LinearPartitioner_def.hpp:25
LinearPartitioner(const Teuchos::RCP< const row_graph_type > &graph)
Constructor.
Definition: Ifpack2_LinearPartitioner_def.hpp:21
void setPartitionParameters(Teuchos::ParameterList &List)
Set the partitioner's parameters (none for linear partitioning).
Definition: Ifpack2_LinearPartitioner_def.hpp:29
TypeTo as(const TypeFrom &t)
Create overlapping partitions of a local graph.
Definition: Ifpack2_OverlappingPartitioner_decl.hpp:45