--- /dev/null
+// =========================================================================
+// @author Leonardo Florez Valencia
+// @email florez-l@javeriana.edu.co
+// =========================================================================
+#ifndef __fpa__Filters__PriorityQueueAlgorithm__hxx__
+#define __fpa__Filters__PriorityQueueAlgorithm__hxx__
+
+// -------------------------------------------------------------------------
+template< class _TDataInterface >
+fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+PriorityQueueAlgorithm( bool double_buffer )
+ : Superclass( ),
+ m_CurrQueue( 0 ),
+ m_DoubleBuffer( double_buffer )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TDataInterface >
+fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+~PriorityQueueAlgorithm( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TDataInterface >
+void fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+_QueueSwap( )
+{
+ if( this->m_DoubleBuffer )
+ this->m_CurrQueue = ( this->m_CurrQueue + 1 ) % 2;
+ else
+ this->m_CurrQueue = 0;
+}
+
+// -------------------------------------------------------------------------
+template< class _TDataInterface >
+void fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+_QueueClear( )
+{
+ this->m_Queues[ 0 ].clear( );
+ this->m_Queues[ 1 ].clear( );
+ this->m_CurrQueue = 0;
+}
+
+// -------------------------------------------------------------------------
+template< class _TDataInterface >
+typename fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+TNode fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+_QueuePop( )
+{
+ std::pop_heap(
+ this->m_Queues[ this->m_CurrQueue ].begin( ),
+ this->m_Queues[ this->m_CurrQueue ].end( ),
+ this->m_QueueOrder
+ );
+ TNode n = this->m_Queues[ this->m_CurrQueue ].back( );
+ this->m_Queues[ this->m_CurrQueue ].pop_back( );
+ return( n );
+}
+
+// -------------------------------------------------------------------------
+template< class _TDataInterface >
+void fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+_QueuePush( const TNode& n )
+{
+ bool push_needed = ( n.Parent == n.Vertex );
+ push_needed |= !( n.Value < this->_GetOutputValue( n.Parent ) );
+ if( push_needed )
+ {
+ this->m_Queues[ this->m_CurrQueue ].push_back( n );
+ std::push_heap(
+ this->m_Queues[ this->m_CurrQueue ].begin( ),
+ this->m_Queues[ this->m_CurrQueue ].end( ),
+ this->m_QueueOrder
+ );
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class _TDataInterface >
+unsigned long fpa::Filters::PriorityQueueAlgorithm< _TDataInterface >::
+_QueueSize( ) const
+{
+ return( this->m_Queues[ this->m_CurrQueue ].size( ) );
+}
+
+#endif // __fpa__Filters__PriorityQueueAlgorithm__hxx__
+// eof - $RCSfile$