src/fisher.cpp
// Converts an edge-row-column to a linear index identifying the free parameter.
Converts an edge-row-column to a linear index identifying the free parameter.
Converts an edge - row - column to a linear index identifying the free parameter .
long erc2freeparam(Tree &T, Model &Mod, long e, long r, long c) {
  long p = Mod.matrix_structure(r, c);
  long a,b;
  for (a=0; a < T.nalpha; a++) {
    for(b=0; b < T.nalpha; b++) {
      if (Mod.matrix_structure(a,b) == p) {
        if (b > a) return e*Mod.df + p - a - 1;
        else if (b < a) return e*Mod.df + p - a;
        else return -1;
      }
    }
  }
  return -1;
}
long erc2freeparam ( Tree & T , Model & Mod , long e , long r , long c ) { long p = Mod . matrix_structure ( r , c ) ; long a , b ; for ( a = 0 ; a < T . nalpha ; a ++ ) { for ( b = 0 ; b < T . nalpha ; b ++ ) { if ( Mod . matrix_structure ( a , b ) == p ) { if ( b > a ) return e * Mod . df + p - a - 1 ; else if ( b < a ) return e * Mod . df + p - a ; else return -1 ; } } } return -1 ; }
Converts an edge-row-column to a linear index identifying the free parameter.
Converts an edge - row - column to a linear index identifying the free parameter .
// find first appearence of parameter p.