hmmer-3.3/src/p7_hmm.c
/* Function:  p7_hmm_CopyParameters()
 * Synopsis:  Copy parameters from one HMM to another.
 *
 * Purpose:   Copy parameters of <src> to <dest>. The HMM <dest> must
 *            be allocated by the caller for the same 
 *            alphabet and M as <src>. 
 *            
 *            Both core and search model parameters are copied.
 *
 *            No annotation is copied.  This is because several
 *            annotation fields are variable-length strings that
 *            require individual allocations.  The
 *            <p7_hmm_CopyParameters()> function is for cases where we
 *            have to repeatedly reset the parameters of a model - for
 *            example, in entropy weighting.
 *
 * Returns:   <eslOK> on success.
 */
p7_hmm_CopyParameters()
Synopsis:  Copy parameters from one HMM to another.

Copy parameters of  to . The HMM  must
be allocated by the caller for the same
alphabet and M as .

Both core and search model parameters are copied.

No annotation is copied.  This is because several
annotation fields are variable-length strings that
require individual allocations.  The
 function is for cases where we
have to repeatedly reset the parameters of a model - for
example, in entropy weighting.

 on success.
p7_hmm_CopyParameters () Synopsis : Copy parameters from one HMM to another . Copy parameters of to . The HMM must be allocated by the caller for the same alphabet and M as . Both core and search model parameters are copied . No annotation is copied . This is because several annotation fields are variable - length strings that require individual allocations . The function is for cases where we have to repeatedly reset the parameters of a model - for example in entropy weighting . on success .
int
p7_hmm_CopyParameters(const P7_HMM *src, P7_HMM *dest)
{
  int k;
  for (k = 0; k <= src->M; k++) {
    esl_vec_FCopy(src->t[k],   p7H_NTRANSITIONS, dest->t[k]);
    esl_vec_FCopy(src->mat[k], src->abc->K,      dest->mat[k]);
    esl_vec_FCopy(src->ins[k], src->abc->K,      dest->ins[k]);
  }
  return eslOK;
}
int p7_hmm_CopyParameters ( const P7_HMM * src , P7_HMM * dest ) { int k ; for ( k = 0 ; k <= src -> M ; k ++ ) { esl_vec_FCopy ( src -> t [ k ] , p7H_NTRANSITIONS , dest -> t [ k ] ) ; esl_vec_FCopy ( src -> mat [ k ] , src -> abc -> K , dest -> mat [ k ] ) ; esl_vec_FCopy ( src -> ins [ k ] , src -> abc -> K , dest -> ins [ k ] ) ; } return eslOK ; }
Function:  p7_hmm_CopyParameters()
 Synopsis:  Copy parameters from one HMM to another.
Function : p7_hmm_CopyParameters () Synopsis : Copy parameters from one HMM to another .