#ifndef __fpa__Base__Functors__GaussianModel__hxx__ #define __fpa__Base__Functors__GaussianModel__hxx__ // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > typename fpa::Base::Functors::GaussianModel< _TInput, _TOutput >:: TOutput fpa::Base::Functors::GaussianModel< _TInput, _TOutput >:: Evaluate( const TInput& x ) const { TOutput r = TOutput( 0 ); if( this->m_Model->GetNumberOfSamples( ) > this->m_SupportSize ) { r = this->m_Model->SquaredMahalanobis( TOutput( x ) ); if( r <= TOutput( 1 ) ) this->m_Model->AddSample( TOutput( x ) ); } else { this->m_Model->AddSample( TOutput( x ) ); if( this->m_Model->GetNumberOfSamples( ) > 2 ) r = this->m_Model->SquaredMahalanobis( TOutput( x ) ); } // fi if( r < this->m_MinimumCost ) return( this->m_MinimumCost ); else return( r ); } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > fpa::Base::Functors::GaussianModel< _TInput, _TOutput >:: GaussianModel( ) : Superclass( ), m_SupportSize( 30 ), m_MinimumCost( TOutput( 1e-10 ) ) { this->m_Model = TModel::New( ); } // ------------------------------------------------------------------------- template< class _TInput, class _TOutput > fpa::Base::Functors::GaussianModel< _TInput, _TOutput >:: ~GaussianModel( ) { } #endif // __fpa__Base__Functors__GaussianModel__hxx__ // eof - $RCSfile$