137 NumMyRows_ = Graph.NumMyRows();
139 if ((RootNode_ < 0) || (RootNode_ >= NumMyRows_))
142 Reorder_.resize(NumMyRows_);
146 InvReorder_.resize(NumMyRows_);
151 for (
int i = 0 ; i < NumMyRows_ ; ++i)
154 std::vector<int> tmp;
155 tmp.push_back(RootNode_);
157 int count = NumMyRows_ - 1;
158 int Length = Graph.MaxMyNumEntries();
159 std::vector<int> Indices(Length);
161 Reorder_[RootNode_] = count;
168 std::vector<int> tmp2;
172 for (
int i = 0 ; i < (int)tmp.size() ; ++i) {
174 IFPACK_CHK_ERR(Graph.ExtractMyRowCopy(tmp[i], Length,
175 NumEntries, &Indices[0]));
178 std::sort(Indices.begin(), Indices.begin() + Length);
180 for (
int j = 0 ; j < NumEntries ; ++j) {
181 int col = Indices[j];
182 if (col >= NumMyRows_)
185 if (Reorder_[col] == -1) {
186 Reorder_[col] = count;
199 if ((tmp2.size() == 0) && (count != -1)) {
200 for (
int i = 0 ; i < NumMyRows_ ; ++i)
201 if (Reorder_[i] == -1) {
203 Reorder_[i] = count--;
213 for (
int i = 0 ; i < NumMyRows_ ; ++i) {
214 if (Reorder_[i] == -1)
219 InvReorder_.resize(NumMyRows_);
221 for (
int i = 0 ; i < NumMyRows_ ; ++i)
224 for (
int i = 0 ; i < NumMyRows_ ; ++i)
225 InvReorder_[Reorder_[i]] = i;
227 for (
int i = 0 ; i < NumMyRows_ ; ++i) {
228 if (InvReorder_[i] == -1)
virtual int Pinv(const Epetra_MultiVector &Xorig, Epetra_MultiVector &Xinvreord) const
Applies inverse reordering to multivector X, whose local length equals the number of local rows.