15 #ifndef __TPETRA_DISTRIBUTIONMM_HPP
16 #define __TPETRA_DISTRIBUTIONMM_HPP
21 template <
typename gno_t,
typename scalar_t>
22 class DistributionMMFile :
public Distribution<gno_t,scalar_t> {
39 using Distribution<gno_t,scalar_t>::me;
40 using Distribution<gno_t,scalar_t>::np;
41 using Distribution<gno_t,scalar_t>::nrows;
43 DistributionMMFile(
size_t nrows_,
44 const Teuchos::RCP<
const Teuchos::Comm<int> > &comm_,
45 const Teuchos::ParameterList ¶ms) :
46 Distribution<gno_t,scalar_t>(nrows_, comm_, params)
48 if (me == 0) std::cout <<
"\n MMFile Distribution: "
49 <<
"\n np = " << np << std::endl;
52 inline enum DistributionType DistType() {
return MMFile; }
54 bool Mine(gno_t i, gno_t j) {
55 std::cout <<
"Invalid call to Mine(i,j); "
56 <<
"MMFile-distribution requires use of Mine(i,j,p) providing "
57 <<
"process assignment p." << std::endl;
61 bool Mine(gno_t i, gno_t j,
int oneBasedRank) {
64 if (oneBasedRank < 1 || oneBasedRank > np) {
65 std::cout <<
"Invalid rank " << oneBasedRank
66 <<
" provided in user distribution; "
67 <<
"rank must be in range 1 to " << np << std::endl;
72 if (oneBasedRank-1 == me && i == j) myVecEntries.insert(i);
74 return (oneBasedRank-1 == me);
81 inline bool VecMine(gno_t i) {
82 return (myVecEntries.find(i) != myVecEntries.end());
86 std::set<gno_t> myVecEntries;