Skip to content

Commit

Permalink
Merge branch 'master' of github.com:stephaneguindon/phyml
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaneguindon committed Jun 12, 2018
2 parents 46f9c7c + fade7b6 commit 66b622f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
27 changes: 26 additions & 1 deletion src/mixt.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,18 @@ void MIXT_Chain_Sprs(t_tree *mixt_tree)
if(tree->next_mixt) tree->best_spr->next_mixt = tree->next_mixt->best_spr;
if(tree->prev_mixt) tree->best_spr->prev_mixt = tree->prev_mixt->best_spr;

For(i,2*tree->n_otu-2)
for(i=0;i<2*tree->n_otu-2;++i)
{
if(tree->next) tree->spr_list_one_edge[i]->next = tree->next->spr_list_one_edge[i];
if(tree->prev) tree->spr_list_one_edge[i]->prev = tree->prev->spr_list_one_edge[i];
if(tree->next_mixt) tree->spr_list_one_edge[i]->next_mixt = tree->next_mixt->spr_list_one_edge[i];
if(tree->prev_mixt) tree->spr_list_one_edge[i]->prev_mixt = tree->prev_mixt->spr_list_one_edge[i];

if(tree->next) tree->spr_list_all_edge[i]->next = tree->next->spr_list_all_edge[i];
if(tree->prev) tree->spr_list_all_edge[i]->prev = tree->prev->spr_list_all_edge[i];
if(tree->next_mixt) tree->spr_list_all_edge[i]->next_mixt = tree->next_mixt->spr_list_all_edge[i];
if(tree->prev_mixt) tree->spr_list_all_edge[i]->prev_mixt = tree->prev_mixt->spr_list_all_edge[i];

}
tree = tree->next;
}
Expand Down Expand Up @@ -1576,6 +1582,25 @@ void MIXT_Graft_Subtree(t_edge *mixt_target, t_node *mixt_link, t_node *mixt_lin
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////

void MIXT_Multiply_Scalar_Dbl(scalar_dbl *this, phydbl scalar)
{
if(this == NULL) return;
else
{
scalar_dbl *buff;
buff = this;
do
{
buff->v *= scalar;
buff = buff->next;
}
while(buff);
}
}

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////

void MIXT_Br_Len_Opt(t_edge *mixt_b, t_tree *mixt_tree)
{
t_tree *tree;
Expand Down
1 change: 1 addition & 0 deletions src/mixt.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ void MIXT_Backup_Partial_Scale(t_node *mixt_d, t_edge *mixt_b, t_tree *mixt_tree
void MIXT_Restore_Partial_Scale(t_node *mixt_d, t_edge *mixt_b, t_tree *mixt_tree);
void MIXT_Set_Both_Sides(int yesno, t_tree *mixt_tree);
void MIXT_Set_Br_Len(phydbl val, t_edge *mixt_b, t_tree *mixt_tree);
void MIXT_Multiply_Scalar_Dbl(scalar_dbl *this, phydbl scalar);

#endif
2 changes: 1 addition & 1 deletion src/spr.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ void Global_Spr_Search(t_tree *tree)
iter = 0;
do
{
if(iter) for(int i=0;i<2*tree->n_otu-3;++i) tree->a_edges[i]->l->v *= Rgamma((phydbl)(0.2*iter+1),(phydbl)(1./(0.2*iter+1)));
if(iter) for(int i=0;i<2*tree->n_otu-3;++i) MIXT_Multiply_Scalar_Dbl(tree->a_edges[i]->l,Rgamma((phydbl)(0.2*iter+1),(phydbl)(1./(0.2*iter+1))));
Spr(tree->c_lnL,1.0,tree);
Optimize_Br_Len_Serie(2,tree);

Expand Down

0 comments on commit 66b622f

Please sign in to comment.