hmmer-3.3/src/p7_profile.c
/* Function:  p7_profile_Compare()
 * Synopsis:  Compare two profiles for equality.
 *
 * Purpose:   Compare two profiles <gm1> and <gm2> to each other.
 *            Return <eslOK> if they're identical, and <eslFAIL> if
 *            they differ. Floating-point probabilities are 
 *            compared for equality within a fractional tolerance
 *            <tol>.  Only compares the scores, not any annotation
 *            on the profiles.
 */
p7_profile_Compare()
Synopsis:  Compare two profiles for equality.

Compare two profiles  and  to each other.
Return  if they're identical, and  if
they differ. Floating-point probabilities are
compared for equality within a fractional tolerance
.  Only compares the scores, not any annotation
on the profiles.
p7_profile_Compare () Synopsis : Compare two profiles for equality . Compare two profiles and to each other . Return if they ' re identical and if they differ . Floating - point probabilities are compared for equality within a fractional tolerance . Only compares the scores not any annotation on the profiles .
int
p7_profile_Compare(P7_PROFILE *gm1, P7_PROFILE *gm2, float tol)
{
  int x;
  if (gm1->mode != gm2->mode) return eslFAIL;
  if (gm1->M    != gm2->M)    return eslFAIL;
  if (esl_vec_FCompare(gm1->tsc, gm2->tsc, gm1->M*p7P_NTRANS, tol)         != eslOK) return eslFAIL;
  for (x = 0; x < gm1->abc->Kp; x++) 
    if (esl_vec_FCompare(gm1->rsc[x], gm2->rsc[x], (gm1->M+1)*p7P_NR, tol) != eslOK) return eslFAIL;
  for (x = 0; x < p7P_NXSTATES; x++)
    if (esl_vec_FCompare(gm1->xsc[x], gm2->xsc[x], p7P_NXTRANS, tol)       != eslOK) return eslFAIL;
  return eslOK;
}
int p7_profile_Compare ( P7_PROFILE * gm1 , P7_PROFILE * gm2 , float tol ) { int x ; if ( gm1 -> mode != gm2 -> mode ) return eslFAIL ; if ( gm1 -> M != gm2 -> M ) return eslFAIL ; if ( esl_vec_FCompare ( gm1 -> tsc , gm2 -> tsc , gm1 -> M * p7P_NTRANS , tol ) != eslOK ) return eslFAIL ; for ( x = 0 ; x < gm1 -> abc -> Kp ; x ++ ) if ( esl_vec_FCompare ( gm1 -> rsc [ x ] , gm2 -> rsc [ x ] , ( gm1 -> M + 1 ) * p7P_NR , tol ) != eslOK ) return eslFAIL ; for ( x = 0 ; x < p7P_NXSTATES ; x ++ ) if ( esl_vec_FCompare ( gm1 -> xsc [ x ] , gm2 -> xsc [ x ] , p7P_NXTRANS , tol ) != eslOK ) return eslFAIL ; return eslOK ; }
Function:  p7_profile_Compare()
 Synopsis:  Compare two profiles for equality.
Function : p7_profile_Compare () Synopsis : Compare two profiles for equality .