1 #ifndef __fpa__Base__Functors__GaussianModel__hxx__
2 #define __fpa__Base__Functors__GaussianModel__hxx__
4 // -------------------------------------------------------------------------
5 template< class _TInput, class _TOutput >
6 typename fpa::Base::Functors::GaussianModel< _TInput, _TOutput >::
7 TOutput fpa::Base::Functors::GaussianModel< _TInput, _TOutput >::
8 Evaluate( const TInput& x ) const
10 TOutput r = TOutput( 0 );
11 if( this->m_Model->GetNumberOfSamples( ) > this->m_SupportSize )
13 r = this->m_Model->SquaredMahalanobis( TOutput( x ) );
14 if( r <= TOutput( 1 ) )
15 this->m_Model->AddSample( TOutput( x ) );
19 this->m_Model->AddSample( TOutput( x ) );
20 if( this->m_Model->GetNumberOfSamples( ) > 2 )
21 r = this->m_Model->SquaredMahalanobis( TOutput( x ) );
24 if( r < this->m_MinimumCost )
25 return( this->m_MinimumCost );
30 // -------------------------------------------------------------------------
31 template< class _TInput, class _TOutput >
32 fpa::Base::Functors::GaussianModel< _TInput, _TOutput >::
36 m_MinimumCost( TOutput( 1e-10 ) )
38 this->m_Model = TModel::New( );
41 // -------------------------------------------------------------------------
42 template< class _TInput, class _TOutput >
43 fpa::Base::Functors::GaussianModel< _TInput, _TOutput >::
48 #endif // __fpa__Base__Functors__GaussianModel__hxx__