示例#1
0
void CFactor::TieDistribFun( CFactor *factor )
{
    PNL_CHECK_IS_NULL_POINTER( factor );
    if( m_Domain.size() != factor->m_Domain.size() )
    {
        PNL_THROW( CInvalidOperation, "domain has different sizes" );
    }
    if( m_DistributionType != factor->m_DistributionType )
    {
        PNL_THROW( CInvalidOperation, "distribution type should be the same" )
    }
    if( m_FactorType != factor->m_FactorType )
    {
        PNL_THROW( CInvalidOperation, "parameter type should be the same" )
    }
    SetDistribFun( factor->GetDistribFun() );
}
示例#2
0
void CFactor::ConvertToSparse()
{
    CDistribFun* sparseDistr = m_CorrespDistribFun->ConvertToSparse();
    SetDistribFun( sparseDistr );
    delete sparseDistr;
}
示例#3
0
void CFactor::ConvertToDense()
{
    CDistribFun* denceDistr = m_CorrespDistribFun->ConvertToDense();
    SetDistribFun( denceDistr );
    delete denceDistr;
}
void CGaussianCPD::NormalizeCPD()
{
    CDistribFun *normData = m_CorrespDistribFun->GetNormalized();
    SetDistribFun( normData );
}