------------------------------------------------------------------------------
| 754 | |
| 755 | //------------------------------------------------------------------------------ |
| 756 | vtkIdType vtkGraph::GetSourceVertex(vtkIdType e) |
| 757 | { |
| 758 | if (vtkDistributedGraphHelper* helper = this->GetDistributedGraphHelper()) |
| 759 | { |
| 760 | int myRank = this->Information->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 761 | if (myRank != helper->GetEdgeOwner(e)) |
| 762 | { |
| 763 | if (e != this->Internals->LastRemoteEdgeId) |
| 764 | { |
| 765 | helper->FindEdgeSourceAndTarget( |
| 766 | e, &this->Internals->LastRemoteEdgeSource, &this->Internals->LastRemoteEdgeTarget); |
| 767 | } |
| 768 | |
| 769 | return this->Internals->LastRemoteEdgeSource; |
| 770 | } |
| 771 | |
| 772 | e = helper->GetEdgeIndex(e); |
| 773 | } |
| 774 | |
| 775 | if (e < 0 || e >= this->GetNumberOfEdges()) |
| 776 | { |
| 777 | vtkErrorMacro("Edge index out of range."); |
| 778 | return -1; |
| 779 | } |
| 780 | if (!this->EdgeList) |
| 781 | { |
| 782 | this->BuildEdgeList(); |
| 783 | } |
| 784 | return this->EdgeList->GetValue(2 * e); |
| 785 | } |
| 786 | |
| 787 | //------------------------------------------------------------------------------ |
| 788 | vtkIdType vtkGraph::GetTargetVertex(vtkIdType e) |