13#ifndef vtkDijkstraGraphInternals_h
14#define vtkDijkstraGraphInternals_h
20VTK_ABI_NAMESPACE_BEGIN
53 unsigned int l = i * 2;
55 unsigned int r = i * 2 + 1;
60 if (l <= this->HeapSize &&
61 (this->CumulativeWeights[this->Heap[l]] < this->CumulativeWeights[this->Heap[i]]))
70 if (r <= this->HeapSize &&
71 (this->CumulativeWeights[this->Heap[r]] < this->CumulativeWeights[this->Heap[smallest]]))
78 int t = this->Heap[i];
80 this->Heap[i] = this->Heap[smallest];
83 this->HeapIndices[this->Heap[i]] = i;
86 this->Heap[smallest] = t;
87 this->HeapIndices[t] = smallest;
95 if (this->HeapSize >= (this->Heap.size() - 1))
101 int i = this->HeapSize;
103 while (i > 1 && this->CumulativeWeights[this->Heap[i / 2]] > this->CumulativeWeights[v])
105 this->Heap[i] = this->Heap[i / 2];
106 this->HeapIndices[this->Heap[i]] = i;
111 this->HeapIndices[v] = i;
116 if (this->HeapSize == 0)
121 int minv = this->Heap[1];
122 this->HeapIndices[minv] = -1;
124 this->Heap[1] = this->Heap[this->HeapSize];
125 this->HeapIndices[this->Heap[1]] = 1;
136 int i = this->HeapIndices[v];
137 if (i < 1 || i >
static_cast<int>(this->HeapSize))
142 while (i > 1 && this->CumulativeWeights[this->Heap[i / 2]] > this->CumulativeWeights[v])
144 this->Heap[i] = this->Heap[i / 2];
145 this->HeapIndices[this->Heap[i]] = i;
151 this->HeapIndices[v] = i;
158 this->Heap.resize(size + 1);
159 this->HeapIndices.resize(size);
163 unsigned int HeapSize;
166 std::vector<int> Heap;
169 std::vector<int> HeapIndices;
Helper class due to PIMPL excess.
std::vector< unsigned char > BlockedVertices
std::vector< unsigned char > OpenVertices
void HeapDecreaseKey(const int &v)
std::vector< unsigned char > ClosedVertices
std::vector< int > Predecessors
void Heapify(const int &i)
std::vector< double > CumulativeWeights
void HeapInsert(const int &v)
void InitializeHeap(const int &size)
vtkDijkstraGraphInternals()
~vtkDijkstraGraphInternals()=default
std::vector< std::map< int, double > > Adjacency