18#ifndef itkPriorityQueueContainer_h
19#define itkPriorityQueueContainer_h
35template <
typename TElement,
typename TElementIdentifier = IdentifierType>
68template <
typename TElementWrapperPo
inter,
typename TElementIdentifier = IdentifierType>
103template <
typename TElement,
typename TElementPriority =
double,
typename TElementIdentifier = IdentifierType>
105 :
public ElementWrapperInterface<MinPriorityQueueElementWrapper<TElement, TElementPriority, TElementIdentifier>,
155template <
typename TElement,
typename TElementPriority =
double,
typename TElementIdentifier = IdentifierType>
189template <
typename TElementWrapper,
190 typename TElementWrapperInterface,
191 typename TElementPriority = double,
211 template <
typename TInputIterator>
215 TInputIterator it = first;
259 inline ElementWrapperType &
262 return this->operator[](identifier);
265 inline const ElementWrapperType &
268 return this->operator[](identifier);
274 this->operator[](identifier) = element;
275 m_Interface.SetLocation(element, identifier);
278 inline ElementIdentifierType
281 return ((identifier - 1) >> 1);
284 inline ElementIdentifierType
287 return ((identifier << 1) + 1);
290 inline ElementIdentifierType
293 return ((identifier << 1) + 2);
313#include "itkPriorityQueueContainer.hxx"
static const ElementIdentifierType m_ElementNotFound
virtual bool is_greater(const ElementType &element1, const ElementType &element2) const =0
virtual ~ElementWrapperInterface()=default
TElementIdentifier ElementIdentifierType
ElementWrapperInterface()=default
virtual void SetLocation(ElementType &element, const ElementIdentifierType &identifier)=0
virtual bool is_less(const ElementType &element1, const ElementType &element2) const =0
virtual ElementIdentifierType GetLocation(const ElementType &element) const =0
virtual ~ElementWrapperPointerInterface()=default
virtual bool is_less(const ElementWrapperPointerType &element1, const ElementWrapperPointerType &element2) const
void SetLocation(ElementWrapperPointerType &element, const ElementIdentifierType &identifier)
TElementIdentifier GetLocation(const ElementWrapperPointerType &element) const
virtual bool is_greater(const ElementWrapperPointerType &element1, const ElementWrapperPointerType &element2) const
TElementWrapperPointer ElementWrapperPointerType
ElementWrapperPointerInterface()=default
static const ElementIdentifierType m_ElementNotFound
TElementIdentifier ElementIdentifierType
Light weight base class for most itk classes.
TElementIdentifier ElementIdentifierType
bool is_greater(const Superclass &element1, const Superclass &element2) const override
MaxPriorityQueueElementWrapper()=default
TElementPriority ElementPriorityType
bool is_less(const Superclass &element1, const Superclass &element2) const override
MaxPriorityQueueElementWrapper(ElementType element, ElementPriorityType priority)
virtual bool is_greater(const MaxPriorityQueueElementWrapper &element1, const MaxPriorityQueueElementWrapper &element2) const
~MaxPriorityQueueElementWrapper() override=default
virtual bool is_less(const MaxPriorityQueueElementWrapper &element1, const MaxPriorityQueueElementWrapper &element2) const
bool is_greater(const MinPriorityQueueElementWrapper &element1, const MinPriorityQueueElementWrapper &element2) const override
bool operator>(const MinPriorityQueueElementWrapper &other) const
bool operator==(const MinPriorityQueueElementWrapper &other) const
bool is_less(const MinPriorityQueueElementWrapper &element1, const MinPriorityQueueElementWrapper &element2) const override
TElementIdentifier ElementIdentifierType
MinPriorityQueueElementWrapper()=default
ElementIdentifierType GetLocation(const MinPriorityQueueElementWrapper &element) const override
void SetLocation(MinPriorityQueueElementWrapper &element, const ElementIdentifierType &identifier) override
~MinPriorityQueueElementWrapper() override=default
TElementPriority ElementPriorityType
MinPriorityQueueElementWrapper(ElementType element, ElementPriorityType priority)
ElementWrapperType & GetElementAtLocation(const ElementIdentifierType &identifier)
void UpdateDownTree(const ElementIdentifierType &identifier)
TElementWrapperInterface ElementInterfaceType
ElementIdentifierType GetParent(const ElementIdentifierType &identifier) const
bool HasParent(const ElementIdentifierType &iId) const
PriorityQueueContainer()=default
bool DeleteElement(const ElementWrapperType &element)
void UpdateUpTree(const ElementIdentifierType &identifier)
TElementWrapper ElementWrapperType
ElementIdentifierType GetRight(const ElementIdentifierType &identifier) const
bool Update(const ElementWrapperType &element)
~PriorityQueueContainer() override=default
void SetElementAtLocation(const ElementIdentifierType &identifier, ElementWrapperType &element)
static const ElementIdentifierType m_ElementNotFound
const ElementWrapperType & Peek() const
ElementIdentifierType GetLeft(const ElementIdentifierType &identifier) const
void Push(ElementWrapperType element)
PriorityQueueContainer(TInputIterator first, TInputIterator last)
TElementIdentifier ElementIdentifierType
const ElementWrapperType & GetElementAtLocation(const ElementIdentifierType &identifier) const
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)