------------------------------------------------------------------------------
| 88 | |
| 89 | //------------------------------------------------------------------------------ |
| 90 | vtkEdgeType vtkEdgeListIterator::Next() |
| 91 | { |
| 92 | // First, determine the current item. |
| 93 | vtkEdgeType e(this->Vertex, this->Current->Target, this->Current->Id); |
| 94 | |
| 95 | // Next, increment the iterator. |
| 96 | this->Increment(); |
| 97 | // If it is undirected, skip edges that are non-local or |
| 98 | // entirely-local edges whose source is greater than the target. |
| 99 | if (!this->Directed) |
| 100 | { |
| 101 | int myRank = -1; |
| 102 | vtkDistributedGraphHelper* helper = this->Graph->GetDistributedGraphHelper(); |
| 103 | |
| 104 | if (helper) |
| 105 | { |
| 106 | myRank = this->Graph->GetInformation()->Get(vtkDataObject::DATA_PIECE_NUMBER()); |
| 107 | } |
| 108 | |
| 109 | while (this->Current != nullptr && |
| 110 | ( // Skip non-local edges. |
| 111 | (helper && helper->GetEdgeOwner(this->Current->Id) != myRank) |
| 112 | // Skip entirely-local edges where Source > Target |
| 113 | || (((helper && myRank == helper->GetVertexOwner(this->Current->Target)) || !helper) && |
| 114 | this->Vertex > this->Current->Target))) |
| 115 | { |
| 116 | this->Increment(); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | // Return the current item. |
| 121 | return e; |
| 122 | } |
| 123 | |
| 124 | //------------------------------------------------------------------------------ |
| 125 | vtkGraphEdge* vtkEdgeListIterator::NextGraphEdge() |
no test coverage detected