xflouris / libpll

Phylogenetic Likelihood Library
GNU Affero General Public License v3.0
26 stars 6 forks source link

Bug with PATTERN_TIP and odd number of rate categories #82

Closed ddarriba closed 8 years ago

ddarriba commented 8 years ago

If pattern tip is set (PLL_ATTRIB_PATTERN_TIP), compute_edge_loglikelihood returns -inf when the number of rate categories is not a power of 2 (at least in my tests it works with 1, 2, 4 and 8 and fails with 3, 5, 6 and 12). This happens also in the master branch.

For reproducing this error, we just need to change the number of rate categories in pll_partition_create(...) in examples/unrooted. Note that if we use more than 4 categories we need to make params_indices bigger as well (it does not matter the size as long as it is bigger than the number of categories and all the entries are set to zero).

xflouris commented 8 years ago

Thanks, I reproduced it in the unrooted example. I guess this bug only appears after the removal of the state map from the pll_partition_create function right?

xflouris commented 8 years ago

I just tested libpll before the map removal and it seems the problem persists there as well.

xflouris commented 8 years ago

fixed