47 #ifndef __TPETRA_DISTRIBUTIONMM_HPP
48 #define __TPETRA_DISTRIBUTIONMM_HPP
53 template <
typename gno_t,
typename scalar_t>
54 class DistributionMMFile :
public Distribution<gno_t,scalar_t> {
71 using Distribution<gno_t,scalar_t>::me;
72 using Distribution<gno_t,scalar_t>::np;
73 using Distribution<gno_t,scalar_t>::nrows;
75 DistributionMMFile(
size_t nrows_,
76 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm_,
77 const Teuchos::ParameterList ¶ms) :
78 Distribution<gno_t,scalar_t>(nrows_, comm_, params)
80 if (me == 0) std::cout <<
"\n MMFile Distribution: "
81 <<
"\n np = " << np << std::endl;
84 inline enum DistributionType DistType() {
return MMFile; }
86 bool Mine(gno_t i, gno_t j) {
87 std::cout <<
"Invalid call to Mine(i,j); "
88 <<
"MMFile-distribution requires use of Mine(i,j,p) providing "
89 <<
"process assignment p." << std::endl;
93 bool Mine(gno_t i, gno_t j,
int oneBasedRank) {
96 if (oneBasedRank < 1 || oneBasedRank > np) {
97 std::cout <<
"Invalid rank " << oneBasedRank
98 <<
" provided in user distribution; "
99 <<
"rank must be in range 1 to " << np << std::endl;
104 if (oneBasedRank-1 == me && i == j) myVecEntries.insert(i);
106 return (oneBasedRank-1 == me);
113 inline bool VecMine(gno_t i) {
114 return (myVecEntries.find(i) != myVecEntries.end());
118 std::set<gno_t> myVecEntries;