deps/kb_meme/meme-5.0.1/src/mhmm-state.c
/************************************************************************
 * Mix two HMM states, according to a given mixing parameter.
 *
 * Assumes both states are already allocated and that both are in log
 * form.
 ************************************************************************/
Mix two HMM states, according to a given mixing parameter.
Assumes both states are already allocated and that both are in log
form.
Mix two HMM states according to a given mixing parameter . Assumes both states are already allocated and that both are in log form .
static void mix_states
  (const float    mixing,    
   MHMM_STATE_T * new_state,
   MHMM_STATE_T * old_state)
{
  new_state->type = old_state->type;
  mix_log_arrays(mixing, new_state->emit, old_state->emit);
  mix_log_arrays(mixing, new_state->emit_odds, old_state->emit_odds);
  new_state->num_sites = (mixing * old_state->num_sites)
    + ((1.0 - mixing) * new_state->num_sites);
}
static void mix_states ( const float mixing , MHMM_STATE_T * new_state , MHMM_STATE_T * old_state ) { new_state -> type = old_state -> type ; mix_log_arrays ( mixing , new_state -> emit , old_state -> emit ) ; mix_log_arrays ( mixing , new_state -> emit_odds , old_state -> emit_odds ) ; new_state -> num_sites = ( mixing * old_state -> num_sites ) + ( ( 1.0 - mixing ) * new_state -> num_sites ) ; }
Mix two HMM states, according to a given mixing parameter.
Mix two HMM states according to a given mixing parameter .
/* Percent of old to be retained. */ /* Emissions. */ /* Transitions will be mixed in the transition array and updated later. */