18 #ifndef itkPriorityQueueContainer_h 19 #define itkPriorityQueueContainer_h 35 template<
typename TElement,
48 virtual ElementIdentifierType
GetLocation(
const ElementType & element)
const = 0;
50 virtual void SetLocation(ElementType & element,
const ElementIdentifierType & identifier) = 0;
52 virtual bool is_less(
const ElementType & element1,
53 const ElementType & element2)
const = 0;
55 virtual bool is_greater(
const ElementType & element1,
56 const ElementType & element2)
const = 0;
67 template<
typename TElementWrapperPointer,
80 TElementIdentifier
GetLocation(
const ElementWrapperPointerType & element)
const;
82 void SetLocation(ElementWrapperPointerType & element,
83 const ElementIdentifierType & identifier);
85 virtual bool is_less(
const ElementWrapperPointerType & element1,
86 const ElementWrapperPointerType & element2)
const;
88 virtual bool is_greater(
const ElementWrapperPointerType & element1,
89 const ElementWrapperPointerType & element2)
const;
104 typename TElementPriority = double,
109 MinPriorityQueueElementWrapper< TElement,
111 TElementIdentifier >,
130 ElementPriorityType priority);
143 const ElementIdentifierType & identifier);
162 typename TElementPriority = double,
181 ElementPriorityType priority);
188 virtual bool is_less(
const Superclass & element1,
189 const Superclass & element2)
const;
194 virtual bool is_greater(
const Superclass & element1,
195 const Superclass & element2)
const;
205 typename TElementWrapper,
206 typename TElementWrapperInterface,
207 typename TElementPriority = double,
229 template<
typename TInputIterator >
233 TInputIterator it = first;
250 void Push(ElementWrapperType element);
252 const ElementWrapperType & Peek()
const;
259 bool Update(
const ElementWrapperType& element);
264 bool DeleteElement(
const ElementWrapperType& element);
273 return this->operator[](identifier);
278 return this->operator[](identifier);
282 ElementWrapperType& element)
284 this->operator[](identifier) = element;
285 m_Interface.SetLocation(element, identifier);
288 inline ElementIdentifierType
GetParent(
const ElementIdentifierType & identifier)
const 290 return ( ( identifier - 1 ) >> 1 );
293 inline ElementIdentifierType
GetLeft(
const ElementIdentifierType & identifier)
const 295 return ( ( identifier << 1 ) + 1 );
298 inline ElementIdentifierType
GetRight(
const ElementIdentifierType & identifier)
const 300 return ( ( identifier << 1 ) + 2 );
303 inline bool HasParent(
const ElementIdentifierType& iId )
const 308 void UpdateUpTree(
const ElementIdentifierType & identifier);
311 void UpdateDownTree(
const ElementIdentifierType & identifier);
318 #include "itkPriorityQueueContainer.hxx" ElementInterfaceType m_Interface
TElementIdentifier ElementIdentifierType
virtual ~MaxPriorityQueueElementWrapper()
TElementWrapperPointer ElementWrapperPointerType
TElementWrapper ElementWrapperType
TElementPriority ElementPriorityType
MinPriorityQueueElementWrapper< ElementType, ElementPriorityType, ElementIdentifierType > Superclass
TElementIdentifier ElementIdentifierType
static const ElementIdentifierType m_ElementNotFound
TElementPriority ElementPriorityType
SmartPointer< const Self > ConstPointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
static const ElementIdentifierType m_ElementNotFound
TElementIdentifier ElementIdentifierType
bool HasParent(const ElementIdentifierType &iId) const
ElementIdentifierType m_Location
void SetElementAtLocation(const ElementIdentifierType &identifier, ElementWrapperType &element)
ElementPriorityType m_Priority
SmartPointer< Self > Pointer
ElementWrapperType & GetElementAtLocation(const ElementIdentifierType &identifier)
ElementIdentifierType GetParent(const ElementIdentifierType &identifier) const
ElementIdentifierType GetLeft(const ElementIdentifierType &identifier) const
SizeValueType IdentifierType
virtual void SetLocation(ElementType &element, const ElementIdentifierType &identifier)=0
VectorContainer< TElementIdentifier, TElementWrapper > Superclass
ElementIdentifierType GetRight(const ElementIdentifierType &identifier) const
TElementWrapperInterface ElementInterfaceType
static const ElementIdentifierType m_ElementNotFound
virtual bool is_greater(const ElementType &element1, const ElementType &element2) const =0
virtual bool is_less(const ElementType &element1, const ElementType &element2) const =0
virtual ~ElementWrapperInterface()
ElementWrapperInterface()
const ElementWrapperType & GetElementAtLocation(const ElementIdentifierType &identifier) const
TElementIdentifier ElementIdentifierType
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
TElementIdentifier ElementIdentifierType
virtual ElementIdentifierType GetLocation(const ElementType &element) const =0
MinPriorityQueueElementWrapper< TElement, TElementPriority, TElementIdentifier > Superclass
unsigned long IdentifierType
bool ITKIOXML_EXPORT operator==(itk::FancyString &s, const std::string &)
PriorityQueueContainer(TInputIterator first, TInputIterator last)
PriorityQueueContainer Self