[med-svn] [libpll] 01/01: New upstream version 0.0+20160909
Andreas Tille
tille at debian.org
Wed May 3 13:17:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to annotated tag upstream/0.0+20160909
in repository libpll.
commit 7a71aa47144a0351db245f52700aff5816e5b5b6
Author: Andreas Tille <tille at debian.org>
Date: Tue Apr 25 17:54:03 2017 +0200
New upstream version 0.0+20160909
---
.gitignore | 6 +
configure.ac | 17 +-
examples/Makefile.am | 1 -
examples/lg4/lg4.c | 2 +-
examples/load-utree/load-utree.c | 2 +-
examples/newick-fasta-rooted/.gitignore | 1 +
examples/newick-fasta-rooted/newick-fasta-rooted.c | 2 +-
examples/newick-fasta-unrooted/.gitignore | 2 +
.../newick-fasta-unrooted/newick-fasta-unrooted.c | 10 +-
.../newick-phylip-unrooted.c | 2 +-
examples/partial-traversal/.gitignore | 1 +
examples/partial-traversal/partial.c | 16 +-
examples/protein-list/.gitignore | 1 +
examples/protein-list/protein-list.c | 4 +-
examples/rooted-tacg/rooted-tacg.c | 2 +-
examples/rooted/rooted.c | 2 +-
examples/stepwise/Makefile | 44 -
examples/stepwise/stepwise.c | 202 -----
examples/stepwise/target.mk | 2 -
examples/unrooted/.gitignore | 1 +
examples/unrooted/Makefile | 2 +-
examples/unrooted/unrooted.c | 2 +-
src/Makefile.am | 70 +-
src/core_derivatives.c | 124 +--
src/core_derivatives_avx.c | 745 +++++++---------
src/core_derivatives_avx2.c | 692 ---------------
src/core_derivatives_sse.c | 128 +--
src/core_likelihood.c | 219 +----
src/core_likelihood_avx.c | 362 +-------
src/core_likelihood_avx2.c | 430 ---------
src/core_likelihood_sse.c | 25 +-
src/core_partials.c | 160 +---
src/core_partials_avx.c | 596 ++-----------
src/core_partials_avx2.c | 702 ---------------
src/core_partials_sse.c | 3 +-
src/core_pmatrix.c | 78 +-
src/core_pmatrix_avx.c | 517 ++---------
src/core_pmatrix_avx2.c | 269 ------
src/core_pmatrix_sse.c | 102 +--
src/derivatives.c | 115 +--
src/fast_parsimony.c | 774 ----------------
src/fast_parsimony_avx.c | 404 ---------
src/fast_parsimony_avx2.c | 399 ---------
src/fast_parsimony_sse.c | 345 --------
src/lex_phylip.l | 39 +-
src/lex_rtree.l | 58 +-
src/lex_utree.l | 58 +-
src/likelihood.c | 34 +-
src/maps.c | 41 +-
src/models.c | 94 +-
src/parse_phylip.y | 31 +-
src/parse_rtree.y | 76 +-
src/parse_utree.y | 93 +-
src/parsimony.c | 64 +-
src/partials.c | 1 -
src/pll.c | 23 +-
src/pll.h | 466 ++--------
src/rtree.c | 12 +-
src/stepwise.c | 542 ------------
src/utree.c | 35 +-
src/utree_svg.c | 6 +-
test/.gitignore | 5 +
test/Makefile | 21 +-
test/README.md | 26 -
test/out/00010_NMDU_lkcalc.out | 98 ---
test/out/00011_NMAU_lkcalc.out | 354 --------
test/out/00012_NMOU_lkcalc.out | 146 ----
test/out/00020_NMDR_lkcalc.out | 98 ---
test/out/00021_NMAR_lkcalc.out | 354 --------
test/out/00022_NMOR_lkcalc.out | 146 ----
test/out/00030_NMDU_gamma.out | 98 ---
test/out/asc-bias.out | 92 +-
test/out/derivatives-oddstates.out | 972 ++++++++++-----------
test/out/derivatives.out | 972 ++++++++++-----------
...{00110_NPDN_fasta.exe.out => fasta-dna.exe.out} | 0
test/out/{00110_NPDN_fasta.out => fasta-dna.out} | 0
...00120_NPAN_fasta.exe.out => fasta-prot.exe.out} | 0
test/out/{00120_NPAN_fasta.out => fasta-prot.out} | 0
test/out/{00032_NMOU_gamma.out => odd-states.out} | 0
test/runtest.py | 32 +-
test/src/00010_NMDU_lkcalc.c | 210 -----
test/src/00011_NMAU_lkcalc.c | 200 -----
test/src/00012_NMOU_lkcalc.c | 221 -----
test/src/00020_NMDR_lkcalc.c | 222 -----
test/src/00021_NMAR_lkcalc.c | 211 -----
test/src/00022_NMOR_lkcalc.c | 246 ------
test/src/00030_NMDU_gamma.c | 215 -----
test/src/README.md | 3 -
test/src/asc-bias.c | 130 ++-
test/src/common.c | 44 +-
test/src/common.h | 11 -
test/src/derivatives-oddstates.c | 8 +-
test/src/derivatives.c | 8 +-
test/src/{00110_NPDN_fasta.c => fasta-dna.c} | 0
test/src/{00120_NPAN_fasta.c => fasta-prot.c} | 0
test/src/{00032_NMOU_gamma.c => odd-states.c} | 0
test/src/partial-traversal.c | 51 +-
test/src/rooted-tipinner.c | 13 +-
test/src/rooted.c | 19 +-
99 files changed, 2308 insertions(+), 12174 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..73e4b1c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+src/libpll.so
+src/parse_rtree.h
+src/parse_utree.h
+src/parse_phylip.h
+*.o
+*.so
diff --git a/configure.ac b/configure.ac
index 98860e4..8e5ffcc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,30 +50,20 @@ AC_FUNC_ALLOCA
AC_FUNC_REALLOC
AC_CHECK_FUNCS([asprintf memcpy memset posix_memalign])
-have_avx2=no
have_avx=no
have_sse=no
have_ps2pdf=no
AX_EXT
-if test "x${ax_cv_have_fma3_ext}" = "xyes"; then
- have_avx2=yes
-fi
-
if test "x${ax_cv_have_avx_ext}" = "xyes"; then
have_avx=yes
fi
if test "x${ax_cv_have_sse3_ext}" = "xyes"; then
- have_sse3=yes
+ have_sse=yes
fi
-AC_ARG_ENABLE(avx2, AS_HELP_STRING([--disable-avx2], [Build without AVX2/FMA support]))
-AS_IF([test "x${ax_cv_have_fma3_ext}" = "xyes"], [
- have_avx2=yes
-])
-
AC_ARG_ENABLE(avx, AS_HELP_STRING([--disable-avx], [Build without AVX support]))
AS_IF([test "x${ax_cv_have_avx_ext}" = "xyes"], [
have_avx=yes
@@ -81,7 +71,7 @@ AS_IF([test "x${ax_cv_have_avx_ext}" = "xyes"], [
AC_ARG_ENABLE(sse,i AS_HELP_STRING([--disable-sse],[Build without SSE support]))
AS_IF([test "x${ax_cv_have_sse3_ext}" = "xyes"], [
- have_sse3=yes
+ have_sse=yes
])
AC_ARG_ENABLE(pdfman, AS_HELP_STRING([--disable-pdfman], [Disable PDF manual creation]))
@@ -94,9 +84,8 @@ AS_IF([test "x$enable_pdfman" != "xno"], [
fi
])
-AM_CONDITIONAL(HAVE_AVX2, test "x${have_avx2}" = "xyes")
AM_CONDITIONAL(HAVE_AVX, test "x${have_avx}" = "xyes")
-AM_CONDITIONAL(HAVE_SSE3, test "x${have_sse3}" = "xyes")
+AM_CONDITIONAL(HAVE_SSE, test "x${have_sse}" = "xyes")
AM_CONDITIONAL(HAVE_PS2PDF, test "x${have_ps2pdf}" = "xyes")
AM_PROG_CC_C_O
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 5218688..7eb6860 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -11,4 +11,3 @@ include protein-list/target.mk
include rooted/target.mk
include rooted-tacg/target.mk
include unrooted/target.mk
-include stepwise/target.mk
diff --git a/examples/lg4/lg4.c b/examples/lg4/lg4.c
index 0ef97cb..b9f823f 100644
--- a/examples/lg4/lg4.c
+++ b/examples/lg4/lg4.c
@@ -416,7 +416,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_utree_destroy(tree,NULL);
+ pll_utree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/examples/load-utree/load-utree.c b/examples/load-utree/load-utree.c
index 2254731..5c647c3 100644
--- a/examples/load-utree/load-utree.c
+++ b/examples/load-utree/load-utree.c
@@ -76,7 +76,7 @@ int main(int argc, char * argv[])
free(newick);
- pll_utree_destroy(utree,NULL);
+ pll_utree_destroy(utree);
return 0;
}
diff --git a/examples/newick-fasta-rooted/.gitignore b/examples/newick-fasta-rooted/.gitignore
new file mode 100644
index 0000000..6ceaa45
--- /dev/null
+++ b/examples/newick-fasta-rooted/.gitignore
@@ -0,0 +1 @@
+nfr
diff --git a/examples/newick-fasta-rooted/newick-fasta-rooted.c b/examples/newick-fasta-rooted/newick-fasta-rooted.c
index b2b1a70..d9ca649 100644
--- a/examples/newick-fasta-rooted/newick-fasta-rooted.c
+++ b/examples/newick-fasta-rooted/newick-fasta-rooted.c
@@ -363,7 +363,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_rtree_destroy(tree,NULL);
+ pll_rtree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/examples/newick-fasta-unrooted/.gitignore b/examples/newick-fasta-unrooted/.gitignore
new file mode 100644
index 0000000..7fff3cb
--- /dev/null
+++ b/examples/newick-fasta-unrooted/.gitignore
@@ -0,0 +1,2 @@
+nfu
+
diff --git a/examples/newick-fasta-unrooted/newick-fasta-unrooted.c b/examples/newick-fasta-unrooted/newick-fasta-unrooted.c
index f0a915e..41fef7d 100644
--- a/examples/newick-fasta-unrooted/newick-fasta-unrooted.c
+++ b/examples/newick-fasta-unrooted/newick-fasta-unrooted.c
@@ -217,7 +217,7 @@ int main(int argc, char * argv[])
branch_count,
RATE_CATS,
inner_nodes_count,
- PLL_ATTRIB_PATTERN_TIP | PLL_ATTRIB_ARCH_AVX);
+ PLL_ATTRIB_ARCH_AVX);
/* initialize the array of base frequencies */
double frequencies[4] = { 0.17, 0.19, 0.25, 0.39 };
@@ -362,12 +362,6 @@ int main(int argc, char * argv[])
NULL);
printf("Log-L: %f\n", logl);
- /* output svg */
- pll_svg_attrib_t * attr = pll_svg_attrib_create();
- attr->width = 500;
- pll_utree_export_svg(tree,tip_nodes_count,attr,"testing.svg");
- pll_svg_attrib_destroy(attr);
-
/* destroy all structures allocated for the concrete PLL partition instance */
pll_partition_destroy(partition);
@@ -379,7 +373,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_utree_destroy(tree,NULL);
+ pll_utree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/examples/newick-phylip-unrooted/newick-phylip-unrooted.c b/examples/newick-phylip-unrooted/newick-phylip-unrooted.c
index 3493a54..40865b3 100644
--- a/examples/newick-phylip-unrooted/newick-phylip-unrooted.c
+++ b/examples/newick-phylip-unrooted/newick-phylip-unrooted.c
@@ -346,7 +346,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_utree_destroy(tree,NULL);
+ pll_utree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/examples/partial-traversal/.gitignore b/examples/partial-traversal/.gitignore
new file mode 100644
index 0000000..b648ac9
--- /dev/null
+++ b/examples/partial-traversal/.gitignore
@@ -0,0 +1 @@
+partial
diff --git a/examples/partial-traversal/partial.c b/examples/partial-traversal/partial.c
index 2c0e385..4a176b5 100644
--- a/examples/partial-traversal/partial.c
+++ b/examples/partial-traversal/partial.c
@@ -35,12 +35,6 @@ typedef struct
int clv_valid;
} node_info_t;
-/* call-back function to destroy the data element of each node */
-static void cb_data_destroy(void * data)
-{
- free(data);
-}
-
/* a callback function for performing a partial traversal */
static int cb_partial_traversal(pll_utree_t * node)
{
@@ -449,6 +443,14 @@ int main(int argc, char * argv[])
printf("Log-L: %f\n", logl);
}
+ /* deallocate the data elements at inner nodes */
+ for (i = 0; i < inner_nodes_count; ++i)
+ {
+ free(inner_nodes_list[i]->data);
+ free(inner_nodes_list[i]->next->data);
+ free(inner_nodes_list[i]->next->next->data);
+ }
+
/* deallocate the inner nodes list */
free(inner_nodes_list);
@@ -463,7 +465,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_utree_destroy(tree,cb_data_destroy);
+ pll_utree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/examples/protein-list/.gitignore b/examples/protein-list/.gitignore
new file mode 100644
index 0000000..b792a77
--- /dev/null
+++ b/examples/protein-list/.gitignore
@@ -0,0 +1 @@
+pl
diff --git a/examples/protein-list/protein-list.c b/examples/protein-list/protein-list.c
index aeb1038..f37e005 100644
--- a/examples/protein-list/protein-list.c
+++ b/examples/protein-list/protein-list.c
@@ -296,7 +296,7 @@ int main(int argc, char * argv[])
unsigned int tip_clv_index = *((unsigned int *)(found->data));
- pll_set_tip_states(partition, tip_clv_index, pll_map_aa, seqdata[i]);
+ pll_set_tip_states(partition, tip_clv_index, pll_map_nt, seqdata[i]);
}
/* destroy hash table */
@@ -432,7 +432,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_utree_destroy(tree,NULL);
+ pll_utree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/examples/rooted-tacg/rooted-tacg.c b/examples/rooted-tacg/rooted-tacg.c
index 3e80ca4..21c8144 100644
--- a/examples/rooted-tacg/rooted-tacg.c
+++ b/examples/rooted-tacg/rooted-tacg.c
@@ -193,7 +193,7 @@ int main(int argc, char * argv[])
5, /* How many probability matrices should we allocate */
4, /* Number of rate categories */
4, /* How many scale buffers do we want */
- PLL_ATTRIB_ARCH_AVX); /* various attributes */
+ PLL_ATTRIB_ARCH_CPU); /* various attributes */
/* initialize an array of two different branch lengths */
double branch_lengths[5] = { 0.36, 0.722, 0.985, 0.718, 1.44};
diff --git a/examples/rooted/rooted.c b/examples/rooted/rooted.c
index 55c2d32..30e598b 100644
--- a/examples/rooted/rooted.c
+++ b/examples/rooted/rooted.c
@@ -15,7 +15,7 @@ int main(int argc, char * argv[])
5, /* How many probability matrices should we allocate */
4, /* Number of rate categories */
4, /* How many scale buffers do we want */
- PLL_ATTRIB_ARCH_AVX); /* various attributes */
+ PLL_ATTRIB_ARCH_CPU); /* various attributes */
/* initialize an array of two different branch lengths */
double branch_lengths[5] = { 0.36, 0.722, 0.985, 0.718, 1.44};
diff --git a/examples/stepwise/Makefile b/examples/stepwise/Makefile
deleted file mode 100644
index 26bd2ea..0000000
--- a/examples/stepwise/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2015 Tomas Flouri
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
-# Heidelberg Institute for Theoretical Studies,
-# Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-
-# Profiling
-#PROFILING=-g -pg
-PROFILING=-g
-
-# Compiler warnings
-WARN=-Wall -Wsign-compare
-
-CC = gcc
-CFLAGS = -Wall -g -O3 $(WARN)
-LINKFLAGS = -L. $(PROFILING)
-LIBS=-lpll -lm
-PROG=stepwise
-
-all: $(PROG)
-
-OBJS=$(PROG).o
-
-$(PROG): $(OBJS)
- $(CC) $(LINKFLAGS) -o $@ $+ $(LIBS) $(LDFLAGS)
-
-%.o: %.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
-
-clean:
- rm -f *~ $(OBJS) gmon.out $(PROG)
diff --git a/examples/stepwise/stepwise.c b/examples/stepwise/stepwise.c
deleted file mode 100644
index d1698ac..0000000
--- a/examples/stepwise/stepwise.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- Copyright (C) 2015 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-#include <stdarg.h>
-#include <search.h>
-#include <time.h>
-
-#define STATES 4
-#define RATE_CATS 4
-
-static void fatal(const char * format, ...) __attribute__ ((noreturn));
-
-static void fatal(const char * format, ...)
-{
- va_list argptr;
- va_start(argptr, format);
- vfprintf(stderr, format, argptr);
- va_end(argptr);
- fprintf(stderr, "\n");
- exit(EXIT_FAILURE);
-}
-
-int main(int argc, char * argv[])
-{
- unsigned int i;
- unsigned int tip_nodes_count, inner_nodes_count, nodes_count, branch_count;
- pll_partition_t * partition;
-
- /* we accept only two arguments - the newick tree (unrooted binary) and the
- alignment in the form of FASTA reads */
- if (argc != 3)
- fatal(" syntax: %s [fasta] [seed]", argv[0]);
-
- /* open FASTA file */
- pll_fasta_t * fp = pll_fasta_open(argv[1], pll_map_fasta);
- if (!fp)
- fatal("Error opening file %s", argv[1]);
-
- char * seq = NULL;
- char * hdr = NULL;
- long seqlen;
- long hdrlen;
- long seqno;
-
-
- unsigned int max_alloc = 100;
- /* allocate arrays to store FASTA headers and sequences */
- char ** headers = (char **)calloc(max_alloc, sizeof(char *));
- char ** seqdata = (char **)calloc(max_alloc, sizeof(char *));
-
- /* read FASTA sequences and make sure they are all of the same length */
- int sites = -1;
- for (i = 0; pll_fasta_getnext(fp,&hdr,&hdrlen,&seq,&seqlen,&seqno); ++i)
- {
- if (i >= max_alloc)
- {
- max_alloc += 100;
- char ** tmpheaders = (char **)calloc(max_alloc, sizeof(char *));
- char ** tmpseqdata = (char **)calloc(max_alloc, sizeof(char *));
- memcpy(tmpheaders,headers,(max_alloc-100)*sizeof(char *));
- memcpy(tmpseqdata,seqdata,(max_alloc-100)*sizeof(char *));
- free(headers);
- free(seqdata);
- headers = tmpheaders;
- seqdata = tmpseqdata;
- }
-
- if (sites != -1 && sites != seqlen)
- fatal("FASTA file does not contain equal size sequences\n");
-
- if (sites == -1) sites = seqlen;
-
- headers[i] = hdr;
- seqdata[i] = seq;
- }
-
- /* did we stop reading the file because we reached EOF? */
- if (pll_errno != PLL_ERROR_FILE_EOF)
- {
- printf("errno %d %s\n", pll_errno, pll_errmsg);
- fatal("Error while reading file %s", argv[1]);
- }
-
- /* close FASTA file */
- pll_fasta_close(fp);
-
- if (sites == -1)
- fatal("Unable to read alignment");
-
- if (i <= 0)
- fatal("FASTA error");
-
- tip_nodes_count = i;
- inner_nodes_count = tip_nodes_count - 2;
- nodes_count = inner_nodes_count + tip_nodes_count;
- branch_count = nodes_count - 1;
-
- printf("Number of tip/leaf nodes in tree: %d\n", tip_nodes_count);
- printf("Number of inner nodes in tree: %d\n", inner_nodes_count);
- printf("Total number of nodes in tree: %d\n", nodes_count);
- printf("Number of branches in tree: %d\n", branch_count);
- printf("Number of sites: %d\n", sites);
-
- unsigned int * weight = pll_compress_site_patterns(seqdata,
- pll_map_nt,
- tip_nodes_count,
- &sites);
- printf("Number of unique sites: %d\n", sites);
-
-
- /* create the PLL partition instance
-
- tip_nodes_count : the number of tip sequences we want to have
- inner_nodes_count : the number of CLV buffers to be allocated for inner nodes
- STATES : the number of states that our data have
- 1 : number of different substitution models (or eigen decomposition)
- to use concurrently (i.e. 4 for LG4)
- branch_count: number of probability matrices to be allocated
- RATE_CATS : number of rate categories we will use
- inner_nodes_count : how many scale buffers to use
- PLL_ATTRIB_ARCH_SSE : list of flags for hardware acceleration (not yet implemented)
-
- */
-
- partition = pll_partition_create(tip_nodes_count,
- inner_nodes_count,
- STATES,
- (unsigned int)sites,
- 1,
- branch_count,
- RATE_CATS,
- inner_nodes_count,
- PLL_ATTRIB_ARCH_CPU);
-
-
- /* set pattern weights and free the weights array */
- pll_set_pattern_weights(partition,weight);
- free(weight);
-
- /* find sequences in hash table and link them with the corresponding taxa */
- for (i = 0; i < tip_nodes_count; ++i)
- pll_set_tip_states(partition, i, pll_map_nt, seqdata[i]);
-
-
- unsigned int score;
-
- pll_parsimony_t * parsimony = pll_fastparsimony_init(partition);
-
- pll_utree_t * tree = pll_fastparsimony_stepwise(&parsimony, headers, &score,1,atoi(argv[2]));
- printf("Score: %u\n", score);
- char * newick = pll_utree_export_newick(tree);
- printf("%s\n", newick);
- free(newick);
-
- /* uncomment the following code to output an SVG file
-
- pll_svg_attrib_t * attr = pll_svg_attrib_create();
- attr->width = 1920;
- pll_utree_export_svg(tree,tip_nodes_count,attr,"parsimony.svg");
- pll_svg_attrib_destroy(attr);
-
- */
-
- pll_parsimony_destroy(parsimony);
-
- /* destroy all structures allocated for the concrete PLL partition instance */
- pll_partition_destroy(partition);
-
- /* we will no longer need the tree structure */
- pll_utree_destroy(tree,NULL);
- /* ...neither the sequences and the headers as they are already
- present in the form of probabilities in the tip CLVs */
- for(i = 0; i < tip_nodes_count; ++i)
- {
- free(seqdata[i]);
- free(headers[i]);
- }
- free(seqdata);
- free(headers);
-
-
- return (EXIT_SUCCESS);
-}
diff --git a/examples/stepwise/target.mk b/examples/stepwise/target.mk
deleted file mode 100644
index 7a4afa3..0000000
--- a/examples/stepwise/target.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-stepwisedir = $(docdir)/examples/stepwise
-dist_stepwise_DATA = stepwise/stepwise.c stepwise/Makefile
diff --git a/examples/unrooted/.gitignore b/examples/unrooted/.gitignore
new file mode 100644
index 0000000..cbf0759
--- /dev/null
+++ b/examples/unrooted/.gitignore
@@ -0,0 +1 @@
+unrooted
diff --git a/examples/unrooted/Makefile b/examples/unrooted/Makefile
index eb98216..c6470f5 100644
--- a/examples/unrooted/Makefile
+++ b/examples/unrooted/Makefile
@@ -25,7 +25,7 @@ PROFILING=-g
WARN=-Wall -Wsign-compare
CC = gcc
-CFLAGS = -Wall -g -O3 $(WARN) -std=c99
+CFLAGS = -Wall -g -O3 $(WARN)
LINKFLAGS = -L. $(PROFILING)
LIBS=-lpll -lm
PROG=unrooted
diff --git a/examples/unrooted/unrooted.c b/examples/unrooted/unrooted.c
index d755c82..22c8e08 100644
--- a/examples/unrooted/unrooted.c
+++ b/examples/unrooted/unrooted.c
@@ -37,7 +37,7 @@ int main(int argc, char * argv[])
5, /* How many probability matrices should we allocate */
4, /* Number of rate categories */
2, /* How many scale buffers do we want */
- PLL_ATTRIB_ARCH_AVX); /* various attributes */
+ PLL_ATTRIB_PATTERN_TIP | PLL_ATTRIB_ARCH_CPU); /* various attributes */
/* initialize an array of two different branch lengths */
double branch_lengths[5] = { 0.2, 0.4, 0.3, 0.5, 0.6};
diff --git a/src/Makefile.am b/src/Makefile.am
index 09f3861..5e52f27 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,18 @@
lib_LTLIBRARIES=libpll.la
-AM_CFLAGS=-Wall -Wsign-compare -D_GNU_SOURCE -std=c99 -O3 -fPIC
+if HAVE_AVX
+AVXFLAGS=-mavx
+else
+AVXFLAGS=
+endif
+
+if HAVE_SSE
+SSEFLAGS=-msse3
+else
+SSEFLAGS=
+endif
+
+AM_CFLAGS=-Wall -Wsign-compare -D_GNU_SOURCE -std=c99 -O3
LIBPLLHEADERS=\
pll.h
@@ -23,65 +35,27 @@ derivatives.c \
partials.c \
compress.c \
utree_moves.c \
-utree_svg.c \
parsimony.c \
core_derivatives.c \
core_partials.c \
core_pmatrix.c \
-core_likelihood.c \
-parse_utree.y \
-parse_rtree.y \
-parse_phylip.y \
-lex_utree.l \
-lex_rtree.l \
-lex_phylip.l \
-fast_parsimony.c \
-stepwise.c
-
-libpll_la_CFLAGS = $(AM_CFLAGS)
-
-# To allow cross-compilation, those SIMD flags will be used for the respective source files only
-AVX2FLAGS=-mfma -mavx2
-AVXFLAGS=-mavx
-SSEFLAGS=-msse3
-
-SIMD_KERNELS=
-
-if HAVE_AVX2
- SIMD_KERNELS+=libsimd_avx2.la
- libsimd_avx2_la_CFLAGS=$(AM_CFLAGS) $(AVX2FLAGS)
- libsimd_avx2_la_SOURCES=\
- core_partials_avx2.c \
- core_derivatives_avx2.c \
- core_pmatrix_avx2.c \
- core_likelihood_avx2.c \
- fast_parsimony_avx2.c
-endif
-
-if HAVE_AVX
-SIMD_KERNELS+=libsimd_avx.la
-libsimd_avx_la_CFLAGS=$(AM_CFLAGS) $(AVXFLAGS)
-libsimd_avx_la_SOURCES=\
core_partials_avx.c \
core_derivatives_avx.c \
-core_pmatrix_avx.c \
+core_likelihood.c \
core_likelihood_avx.c \
-fast_parsimony_avx.c
-endif
-
-if HAVE_SSE3
-SIMD_KERNELS+=libsimd_sse.la
-libsimd_sse_la_CFLAGS=$(AM_CFLAGS) $(SSEFLAGS)
-libsimd_sse_la_SOURCES=\
core_partials_sse.c \
core_derivatives_sse.c \
core_likelihood_sse.c \
+core_pmatrix_avx.c \
core_pmatrix_sse.c \
-fast_parsimony_sse.c
-endif
+parse_utree.y \
+parse_rtree.y \
+parse_phylip.y \
+lex_utree.l \
+lex_rtree.l \
+lex_phylip.l
-libpll_la_LIBADD = $(SIMD_KERNELS)
-noinst_LTLIBRARIES = $(SIMD_KERNELS)
+libpll_la_CFLAGS = $(AM_CFLAGS) $(AVXFLAGS) $(SSEFLAGS)
# This is the version information for libtool and not the libpll version. For
# more information see:
diff --git a/src/core_derivatives.c b/src/core_derivatives.c
index 3f962e6..5e9a4d7 100644
--- a/src/core_derivatives.c
+++ b/src/core_derivatives.c
@@ -82,8 +82,6 @@ PLL_EXPORT int pll_core_update_sumtable_ii(unsigned int states,
unsigned int rate_cats,
const double * parent_clv,
const double * child_clv,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
@@ -101,7 +99,7 @@ PLL_EXPORT int pll_core_update_sumtable_ii(unsigned int states,
const double * t_inv_eigenvecs;
const double * t_freqs;
-#ifdef HAVE_SSE3
+#ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
return pll_core_update_sumtable_ii_sse(states,
@@ -123,30 +121,10 @@ PLL_EXPORT int pll_core_update_sumtable_ii(unsigned int states,
rate_cats,
parent_clv,
child_clv,
- parent_scaler,
- child_scaler,
eigenvecs,
inv_eigenvecs,
freqs,
- sumtable,
- attrib);
- }
-#endif
-#ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- return pll_core_update_sumtable_ii_avx2(states,
- sites,
- rate_cats,
- parent_clv,
- child_clv,
- parent_scaler,
- child_scaler,
- eigenvecs,
- inv_eigenvecs,
- freqs,
- sumtable,
- attrib);
+ sumtable);
}
#endif
@@ -184,12 +162,10 @@ PLL_EXPORT int pll_core_update_sumtable_ti(unsigned int states,
unsigned int rate_cats,
const double * parent_clv,
const unsigned char * left_tipchars,
- const unsigned int * parent_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
unsigned int * tipmap,
- unsigned int tipmap_size,
double *sumtable,
unsigned int attrib)
{
@@ -206,7 +182,7 @@ PLL_EXPORT int pll_core_update_sumtable_ti(unsigned int states,
unsigned int states_padded = states;
-#ifdef HAVE_SSE3
+#ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
return pll_core_update_sumtable_ti_sse(states,
@@ -229,30 +205,10 @@ PLL_EXPORT int pll_core_update_sumtable_ti(unsigned int states,
rate_cats,
parent_clv,
left_tipchars,
- parent_scaler,
- eigenvecs,
- inv_eigenvecs,
- freqs,
- tipmap,
- tipmap_size,
- sumtable,
- attrib);
- }
-#endif
-#ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- return pll_core_update_sumtable_ti_avx2(states,
- sites,
- rate_cats,
- parent_clv,
- left_tipchars,
- parent_scaler,
eigenvecs,
inv_eigenvecs,
freqs,
tipmap,
- tipmap_size,
sumtable,
attrib);
}
@@ -392,6 +348,19 @@ PLL_EXPORT int pll_core_likelihood_derivatives(unsigned int states,
unsigned int states_padded = states;
+#ifdef HAVE_SSE
+ if (attrib & PLL_ATTRIB_ARCH_SSE)
+ {
+ states_padded = (states+1) & 0xFFFFFFFE;
+ }
+#endif
+#ifdef HAVE_AVX
+ if (attrib & PLL_ATTRIB_ARCH_AVX)
+ {
+ states_padded = (states+3) & 0xFFFFFFFC;
+ }
+#endif
+
/* For Stamatakis correction, the likelihood derivatives are computed in
the usual way for the additional per-state sites. */
if ((attrib & PLL_ATTRIB_AB_MASK) == PLL_ATTRIB_AB_STAMATAKIS)
@@ -421,8 +390,8 @@ PLL_EXPORT int pll_core_likelihood_derivatives(unsigned int states,
for(i = 0; i < rate_cats; ++i)
{
t_eigenvals = eigenvals[i];
- ki = rates[i]/(1.0 - prop_invar[i]);
- t_branch_length = branch_length;
+ ki = rates[i];
+ t_branch_length = branch_length/(1.0 - prop_invar[i]);
for(j = 0; j < states; ++j)
{
diagp[0] = exp(t_eigenvals[j] * ki * t_branch_length);
@@ -433,53 +402,22 @@ PLL_EXPORT int pll_core_likelihood_derivatives(unsigned int states,
}
}
-// SSE3 vectorization in missing as of now
-#ifdef HAVE_SSE3
- if (attrib & PLL_ATTRIB_ARCH_SSE)
- {
- states_padded = (states+1) & 0xFFFFFFFE;
- }
-#endif
-
-#ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- states_padded = (states+3) & 0xFFFFFFFC;
-
- pll_core_likelihood_derivatives_avx2(states,
- states_padded,
- rate_cats,
- ef_sites,
- pattern_weights,
- rate_weights,
- invariant,
- prop_invar,
- freqs,
- sumtable,
- diagptable,
- d_f,
- dd_f);
- }
- else
-#endif
#ifdef HAVE_AVX
if (attrib & PLL_ATTRIB_ARCH_AVX)
{
- states_padded = (states+3) & 0xFFFFFFFC;
-
- pll_core_likelihood_derivatives_avx(states,
- states_padded,
- rate_cats,
- ef_sites,
- pattern_weights,
- rate_weights,
- invariant,
- prop_invar,
- freqs,
- sumtable,
- diagptable,
- d_f,
- dd_f);
+ core_likelihood_derivatives_avx(states,
+ states_padded,
+ rate_cats,
+ ef_sites,
+ pattern_weights,
+ rate_weights,
+ invariant,
+ prop_invar,
+ freqs,
+ sumtable,
+ diagptable,
+ d_f,
+ dd_f);
}
else
#endif
diff --git a/src/core_derivatives_avx.c b/src/core_derivatives_avx.c
index 7204f28..9b03e3d 100644
--- a/src/core_derivatives_avx.c
+++ b/src/core_derivatives_avx.c
@@ -19,20 +19,16 @@
Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
*/
-#include <limits.h>
#include "pll.h"
-static int core_update_sumtable_ii_4x4_avx(unsigned int sites,
- unsigned int rate_cats,
- const double * clvp,
- const double * clvc,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- double ** freqs,
- double *sumtable,
- unsigned int attrib)
+PLL_EXPORT int pll_core_update_sumtable_ii_4x4_avx(unsigned int sites,
+ unsigned int rate_cats,
+ const double * clvp,
+ const double * clvc,
+ double ** eigenvecs,
+ double ** inv_eigenvecs,
+ double ** freqs,
+ double *sumtable)
{
unsigned int i, j, k, n;
@@ -41,28 +37,11 @@ static int core_update_sumtable_ii_4x4_avx(unsigned int sites,
const double * t_clvp = clvp;
const double * t_clvc = clvc;
+ double * t_eigenvecs;
double * t_freqs;
unsigned int states = 4;
- unsigned int min_scaler = 0;
- unsigned int * rate_scale_factors = NULL;
- int per_rate_scaling = (attrib & PLL_ATTRIB_RATE_SCALERS) ? 1 : 0;
-
- if (per_rate_scaling)
- rate_scale_factors = (unsigned int*) calloc(rate_cats, sizeof(unsigned int));
-
- /* powers of scale threshold for undoing the scaling */
- __m256d v_scale_minlh[5] = {
- _mm256_set1_pd(1.0),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD)
- };
-
/* transposed inv_eigenvecs */
double * tt_inv_eigenvecs = (double *) pll_aligned_alloc (
(states * states * rate_cats) * sizeof(double),
@@ -77,72 +56,76 @@ static int core_update_sumtable_ii_4x4_avx(unsigned int sites,
for (i = 0; i < rate_cats; ++i)
{
- t_freqs = freqs[i];
for (j = 0; j < states; ++j)
for (k = 0; k < states; ++k)
{
tt_inv_eigenvecs[i * states * states + j * states + k] =
- inv_eigenvecs[i][k * states + j] * t_freqs[k];
+ inv_eigenvecs[i][k * states + j];
}
}
/* vectorized loop from update_sumtable() */
for (n = 0; n < sites; n++)
{
- /* compute per-rate scalers and obtain minimum value (within site) */
- if (per_rate_scaling)
- {
- min_scaler = UINT_MAX;
- for (i = 0; i < rate_cats; ++i)
- {
- rate_scale_factors[i] = (parent_scaler) ? parent_scaler[n*rate_cats+i] : 0;
- rate_scale_factors[i] += (child_scaler) ? child_scaler[n*rate_cats+i] : 0;
- if (rate_scale_factors[i] < min_scaler)
- min_scaler = rate_scale_factors[i];
- }
- }
-
- const double * c_eigenvecs;
- const double * c_inv_eigenvecs = tt_inv_eigenvecs;
-
for (i = 0; i < rate_cats; ++i)
{
- c_eigenvecs = eigenvecs[i];
+ t_eigenvecs = eigenvecs[i];
+ t_freqs = freqs[i];
+
+ const double * c_eigenvecs = t_eigenvecs;
+ const double * ct_inv_eigenvecs = tt_inv_eigenvecs;
__m256d v_lefterm[4], v_righterm[4];
+ v_lefterm[0] = v_lefterm[1] = v_lefterm[2] = v_lefterm[3] = _mm256_setzero_pd ();
+ v_righterm[0] = v_righterm[1] = v_righterm[2] = v_righterm[3] = _mm256_setzero_pd ();
+
__m256d v_eigen;
+ __m256d v_freqs;
__m256d v_clvp, v_clvc;
v_clvp = _mm256_load_pd (t_clvp);
v_clvc = _mm256_load_pd (t_clvc);
+ v_freqs = _mm256_load_pd (t_freqs);
- v_eigen = _mm256_load_pd (c_inv_eigenvecs);
- v_lefterm[0] = _mm256_mul_pd (v_eigen, v_clvp);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_lefterm[0] = _mm256_add_pd (
+ v_lefterm[0],
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clvp)));
v_eigen = _mm256_load_pd (c_eigenvecs);
- v_righterm[0] = _mm256_mul_pd (v_eigen, v_clvc);
+ v_righterm[0] = _mm256_add_pd (v_righterm[0],
+ _mm256_mul_pd (v_eigen, v_clvc));
c_eigenvecs += 4;
- c_inv_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
- v_eigen = _mm256_load_pd (c_inv_eigenvecs);
- v_lefterm[1] = _mm256_mul_pd (v_eigen, v_clvp);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_lefterm[1] = _mm256_add_pd (
+ v_lefterm[1],
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clvp)));
v_eigen = _mm256_load_pd (c_eigenvecs);
- v_righterm[1] = _mm256_mul_pd (v_eigen, v_clvc);
+ v_righterm[1] = _mm256_add_pd (v_righterm[1],
+ _mm256_mul_pd (v_eigen, v_clvc));
c_eigenvecs += 4;
- c_inv_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
- v_eigen = _mm256_load_pd (c_inv_eigenvecs);
- v_lefterm[2] = _mm256_mul_pd (v_eigen, v_clvp);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_lefterm[2] = _mm256_add_pd (
+ v_lefterm[2],
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clvp)));
v_eigen = _mm256_load_pd (c_eigenvecs);
- v_righterm[2] = _mm256_mul_pd (v_eigen, v_clvc);
+ v_righterm[2] = _mm256_add_pd (v_righterm[2],
+ _mm256_mul_pd (v_eigen, v_clvc));
c_eigenvecs += 4;
- c_inv_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
- v_eigen = _mm256_load_pd (c_inv_eigenvecs);
- v_lefterm[3] = _mm256_mul_pd (v_eigen, v_clvp);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_lefterm[3] = _mm256_add_pd (
+ v_lefterm[3],
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clvp)));
v_eigen = _mm256_load_pd (c_eigenvecs);
- v_righterm[3] = _mm256_mul_pd (v_eigen, v_clvc);
+ v_righterm[3] = _mm256_add_pd (v_righterm[3],
+ _mm256_mul_pd (v_eigen, v_clvc));
c_eigenvecs += 4;
- c_inv_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
/* compute lefterm */
__m256d xmm0 = _mm256_unpackhi_pd (v_lefterm[0], v_lefterm[1]);
@@ -167,18 +150,8 @@ static int core_update_sumtable_ii_4x4_avx(unsigned int sites,
__m256d v_righterm_sum = _mm256_add_pd (xmm2, xmm3);
/* update sum */
- __m256d v_sum = _mm256_mul_pd (v_lefterm_sum, v_righterm_sum);
-
- /* apply per-rate scalers */
- if (per_rate_scaling)
- {
- int scalings = rate_scale_factors[i] - min_scaler > 4 ?
- 4 : (rate_scale_factors[i] - min_scaler);
-
- v_sum = _mm256_mul_pd(v_sum, v_scale_minlh[scalings]);
- }
-
- _mm256_store_pd (sum, v_sum);
+ __m256d v_prod = _mm256_mul_pd (v_lefterm_sum, v_righterm_sum);
+ _mm256_store_pd (sum, v_prod);
t_clvc += states;
t_clvp += states;
@@ -188,9 +161,6 @@ static int core_update_sumtable_ii_4x4_avx(unsigned int sites,
pll_aligned_free (tt_inv_eigenvecs);
- if (rate_scale_factors)
- free(rate_scale_factors);
-
return PLL_SUCCESS;
}
@@ -199,13 +169,10 @@ PLL_EXPORT int pll_core_update_sumtable_ii_avx(unsigned int states,
unsigned int rate_cats,
const double * clvp,
const double * clvc,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
- double *sumtable,
- unsigned int attrib)
+ double *sumtable)
{
unsigned int i, j, k, n;
@@ -219,17 +186,14 @@ PLL_EXPORT int pll_core_update_sumtable_ii_avx(unsigned int states,
/* dedicated functions for 4x4 matrices */
if (states == 4)
{
- return core_update_sumtable_ii_4x4_avx(sites,
- rate_cats,
- clvp,
- clvc,
- parent_scaler,
- child_scaler,
- eigenvecs,
- inv_eigenvecs,
- freqs,
- sumtable,
- attrib);
+ return pll_core_update_sumtable_ii_4x4_avx(sites,
+ rate_cats,
+ clvp,
+ clvc,
+ eigenvecs,
+ inv_eigenvecs,
+ freqs,
+ sumtable);
}
unsigned int states_padded = (states+3) & 0xFFFFFFFC;
@@ -261,15 +225,13 @@ PLL_EXPORT int pll_core_update_sumtable_ii_avx(unsigned int states,
memset(tt_eigenvecs, 0, (states_padded * states_padded * rate_cats) * sizeof(double));
memset(tt_inv_eigenvecs, 0, (states_padded * states_padded * rate_cats) * sizeof(double));
- /* add padding to eigenvecs matrices and multiply with frequencies */
for (i = 0; i < rate_cats; ++i)
{
- t_freqs = freqs[i];
for (j = 0; j < states; ++j)
for (k = 0; k < states; ++k)
{
tt_inv_eigenvecs[i * states_padded * states_padded + j * states_padded
- + k] = inv_eigenvecs[i][k * states + j] * t_freqs[k];
+ + k] = inv_eigenvecs[i][k * states + j];
tt_eigenvecs[i * states_padded * states_padded + j * states_padded
+ k] = eigenvecs[i][j * states + k];
}
@@ -282,22 +244,10 @@ PLL_EXPORT int pll_core_update_sumtable_ii_avx(unsigned int states,
const double * ct_inv_eigenvecs = tt_inv_eigenvecs;
for (i = 0; i < rate_cats; ++i)
{
+ t_freqs = freqs[i];
+
for (j = 0; j < states_padded; j += 4)
{
- /* point to the four rows of the eigenvecs matrix */
- const double * em0 = c_eigenvecs;
- const double * em1 = em0 + states_padded;
- const double * em2 = em1 + states_padded;
- const double * em3 = em2 + states_padded;
- c_eigenvecs += 4*states_padded;
-
- /* point to the four rows of the inv_eigenvecs matrix */
- const double * im0 = ct_inv_eigenvecs;
- const double * im1 = im0 + states_padded;
- const double * im2 = im1 + states_padded;
- const double * im3 = im2 + states_padded;
- ct_inv_eigenvecs += 4*states_padded;
-
__m256d v_lefterm0 = _mm256_setzero_pd ();
__m256d v_righterm0 = _mm256_setzero_pd ();
__m256d v_lefterm1 = _mm256_setzero_pd ();
@@ -308,49 +258,79 @@ PLL_EXPORT int pll_core_update_sumtable_ii_avx(unsigned int states,
__m256d v_righterm3 = _mm256_setzero_pd ();
__m256d v_eigen;
- __m256d v_clvp;
- __m256d v_clvc;
+ __m256d v_freqs;
+ __m256d v_clv;
for (k = 0; k < states_padded; k += 4)
{
- v_clvp = _mm256_load_pd (t_clvp + k);
- v_clvc = _mm256_load_pd (t_clvc + k);
-
- /* row 0 */
- v_eigen = _mm256_load_pd (im0 + k);
- v_lefterm0 = _mm256_add_pd (v_lefterm0,
- _mm256_mul_pd (v_eigen, v_clvp));
-
- v_eigen = _mm256_load_pd (em0 + k);
+ v_freqs = _mm256_load_pd (t_freqs + k);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_clv = _mm256_load_pd (t_clvp + k);
+ v_lefterm0 = _mm256_add_pd (
+ v_lefterm0,
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clv)));
+
+ v_clv = _mm256_load_pd (t_clvc + k);
+ v_eigen = _mm256_load_pd (c_eigenvecs);
v_righterm0 = _mm256_add_pd (v_righterm0,
- _mm256_mul_pd (v_eigen, v_clvc));
+ _mm256_mul_pd (v_eigen, v_clv));
- /* row 1 */
- v_eigen = _mm256_load_pd (im1 + k);
- v_lefterm1 = _mm256_add_pd (v_lefterm1,
- _mm256_mul_pd (v_eigen, v_clvp));
+ c_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
+ }
- v_eigen = _mm256_load_pd (em1 + k);
+ for (k = 0; k < states_padded; k += 4)
+ {
+ v_freqs = _mm256_load_pd (t_freqs + k);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_clv = _mm256_load_pd (t_clvp + k);
+ v_lefterm1 = _mm256_add_pd (
+ v_lefterm1,
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clv)));
+
+ v_clv = _mm256_load_pd (t_clvc + k);
+ v_eigen = _mm256_load_pd (c_eigenvecs);
v_righterm1 = _mm256_add_pd (v_righterm1,
- _mm256_mul_pd (v_eigen, v_clvc));
+ _mm256_mul_pd (v_eigen, v_clv));
- /* row 2 */
- v_eigen = _mm256_load_pd (im2 + k);
- v_lefterm2 = _mm256_add_pd (v_lefterm2,
- _mm256_mul_pd (v_eigen, v_clvp));
+ c_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
+ }
- v_eigen = _mm256_load_pd (em2 + k);
+ for (k = 0; k < states_padded; k += 4)
+ {
+ v_freqs = _mm256_load_pd (t_freqs + k);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_clv = _mm256_load_pd (t_clvp + k);
+ v_lefterm2 = _mm256_add_pd (
+ v_lefterm2,
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clv)));
+
+ v_clv = _mm256_load_pd (t_clvc + k);
+ v_eigen = _mm256_load_pd (c_eigenvecs);
v_righterm2 = _mm256_add_pd (v_righterm2,
- _mm256_mul_pd (v_eigen, v_clvc));
+ _mm256_mul_pd (v_eigen, v_clv));
- /* row 3 */
- v_eigen = _mm256_load_pd (im3 + k);
- v_lefterm3 = _mm256_add_pd (v_lefterm3,
- _mm256_mul_pd (v_eigen, v_clvp));
+ c_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
+ }
- v_eigen = _mm256_load_pd (em3 + k);
+ for (k = 0; k < states_padded; k += 4)
+ {
+ v_freqs = _mm256_load_pd (t_freqs + k);
+ v_eigen = _mm256_load_pd (ct_inv_eigenvecs);
+ v_clv = _mm256_load_pd (t_clvp + k);
+ v_lefterm3 = _mm256_add_pd (
+ v_lefterm3,
+ _mm256_mul_pd (v_freqs, _mm256_mul_pd (v_eigen, v_clv)));
+
+ v_clv = _mm256_load_pd (t_clvc + k);
+ v_eigen = _mm256_load_pd (c_eigenvecs);
v_righterm3 = _mm256_add_pd (v_righterm3,
- _mm256_mul_pd (v_eigen, v_clvc));
+ _mm256_mul_pd (v_eigen, v_clv));
+
+ c_eigenvecs += 4;
+ ct_inv_eigenvecs += 4;
}
/* compute lefterm */
@@ -396,12 +376,10 @@ static int core_update_sumtable_ti_4x4_avx(unsigned int sites,
unsigned int rate_cats,
const double * parent_clv,
const unsigned char * left_tipchars,
- const unsigned int * parent_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
- double *sumtable,
- unsigned int attrib)
+ double *sumtable)
{
const unsigned int states = 4;
@@ -412,24 +390,6 @@ static int core_update_sumtable_ti_4x4_avx(unsigned int sites,
const double * t_clvc = parent_clv;
const double * t_eigenvecs_trans;
- unsigned int min_scaler = 0;
- unsigned int * rate_scale_factors = NULL;
- int per_rate_scaling = (attrib & PLL_ATTRIB_RATE_SCALERS) ? 1 : 0;
-
- if (per_rate_scaling)
- rate_scale_factors = (unsigned int*) calloc(rate_cats, sizeof(unsigned int));
-
- /* powers of scale threshold for undoing the scaling */
- __m256d v_scale_minlh[5] = {
- _mm256_set1_pd(1.0),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD)
- };
-
double * eigenvecs_trans = (double *) pll_aligned_alloc (
(states * states * rate_cats) * sizeof(double),
PLL_ALIGNMENT_AVX);
@@ -507,18 +467,6 @@ static int core_update_sumtable_ti_4x4_avx(unsigned int sites,
/* build sumtable */
for (n = 0; n < sites; n++)
{
- /* compute per-rate scalers and obtain minimum value (within site) */
- if (per_rate_scaling)
- {
- min_scaler = UINT_MAX;
- for (i = 0; i < rate_cats; ++i)
- {
- rate_scale_factors[i] = (parent_scaler) ? parent_scaler[n*rate_cats+i] : 0;
- if (rate_scale_factors[i] < min_scaler)
- min_scaler = rate_scale_factors[i];
- }
- }
-
tipstate = (unsigned int) left_tipchars[n];
/* set pointer to the precomputed lefterm values for the current tipstate */
@@ -531,24 +479,15 @@ static int core_update_sumtable_ti_4x4_avx(unsigned int sites,
__m256d v_righterm = _mm256_setzero_pd();
for (k = 0; k < states; ++k)
- {
- __m256d v_clvc = _mm256_set1_pd(t_clvc[k]);
- __m256d v_eigen = _mm256_load_pd(t_eigenvecs_trans + k*states);
- v_righterm = _mm256_add_pd(v_righterm,
- _mm256_mul_pd(v_eigen, v_clvc));
- }
-
- __m256d v_sum = _mm256_mul_pd(v_lefterm, v_righterm);
-
- /* apply per-rate scalers */
- if (per_rate_scaling)
- {
- int scalings = rate_scale_factors[i] - min_scaler > 4 ?
- 4 : (rate_scale_factors[i] - min_scaler);
+ {
+ __m256d v_clvc = _mm256_set1_pd(t_clvc[k]);
+ __m256d v_eigen = _mm256_load_pd(t_eigenvecs_trans + k*states);
+ v_righterm = _mm256_add_pd(v_righterm,
+ _mm256_mul_pd(v_eigen, v_clvc));
- v_sum = _mm256_mul_pd(v_sum, v_scale_minlh[scalings]);
- }
+ }
+ __m256d v_sum = _mm256_mul_pd(v_lefterm, v_righterm);
_mm256_store_pd(sum, v_sum);
t_eigenvecs_trans += states * states;
@@ -561,9 +500,6 @@ static int core_update_sumtable_ti_4x4_avx(unsigned int sites,
pll_aligned_free(eigenvecs_trans);
pll_aligned_free(precomp_left);
- if (rate_scale_factors)
- free(rate_scale_factors);
-
return PLL_SUCCESS;
}
@@ -572,12 +508,10 @@ PLL_EXPORT int pll_core_update_sumtable_ti_avx(unsigned int states,
unsigned int rate_cats,
const double * parent_clv,
const unsigned char * left_tipchars,
- const unsigned int * parent_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
unsigned int * tipmap,
- unsigned int tipmap_size,
double *sumtable,
unsigned int attrib)
{
@@ -587,272 +521,283 @@ PLL_EXPORT int pll_core_update_sumtable_ti_avx(unsigned int states,
rate_cats,
parent_clv,
left_tipchars,
- parent_scaler,
eigenvecs,
inv_eigenvecs,
freqs,
- sumtable,
- attrib);
+ sumtable);
}
+ // TODO: we can use the same pre-computation technique as in 4x4 case,
+ // but we need to know maxstates here
+
unsigned int states_padded = (states+3) & 0xFFFFFFFC;
- unsigned int span = states_padded * rate_cats;
- unsigned int maxstates = tipmap_size;
unsigned int i, j, k, n;
unsigned int tipstate;
double * sum = sumtable;
const double * t_clvc = parent_clv;
- const double * t_eigenvecs_padded;
+ const double * t_eigenvecs_trans;
- double * eigenvecs_padded = (double *) pll_aligned_alloc (
+ double * eigenvecs_trans = (double *) pll_aligned_alloc (
(states_padded * states_padded * rate_cats) * sizeof(double),
PLL_ALIGNMENT_AVX);
double * precomp_left = (double *) pll_aligned_alloc (
- (maxstates * states_padded * rate_cats) * sizeof(double),
+ (states_padded * states_padded * rate_cats) * sizeof(double),
PLL_ALIGNMENT_AVX);
- if (!eigenvecs_padded || !precomp_left)
+ if (!eigenvecs_trans || !precomp_left)
{
pll_errno = PLL_ERROR_MEM_ALLOC;
snprintf (pll_errmsg, 200, "Cannot allocate memory for tt_inv_eigenvecs");
return PLL_FAILURE;
}
- /* add padding to eigenvecs matrix -> for efficient vectorization */
+ /* transpose eigenvecs matrix -> for efficient vectorization */
for (i = 0; i < rate_cats; ++i)
{
for (j = 0; j < states_padded; ++j)
for (k = 0; k < states_padded; ++k)
{
- eigenvecs_padded[i*states_padded*states_padded + j*states_padded + k] =
- (j < states && k < states) ? eigenvecs[i][j*states + k] : 0.;
+ eigenvecs_trans[i*states_padded*states_padded + j*states_padded + k] =
+ (j < states && k < states) ? eigenvecs[i][k*states + j] : 0.;
}
}
/* precompute left terms since they are the same for every site */
double * t_precomp = precomp_left;
- for (n = 0; n < maxstates; ++n)
+ for (i = 0; i < rate_cats; ++i)
{
- unsigned int state = tipmap ? tipmap[n] : n;
-
- int ss = __builtin_popcount(state) == 1 ? __builtin_ctz(state) : -1;
-
- for (i = 0; i < rate_cats; ++i)
- {
- for (j = 0; j < states_padded; j += 4)
- {
- __m256d v_lefterm;
-
- if (ss != -1)
+ for (k = 0; k < states_padded; ++k)
{
- /* special case for non-ambiguous state */
- __m256d v_freqs = _mm256_set1_pd(freqs[i][ss]);
- __m256d v_eigen = _mm256_load_pd(inv_eigenvecs[i] +
- ss*states + j);
- v_lefterm = _mm256_mul_pd(v_eigen, v_freqs);
- }
- else
- {
- v_lefterm = _mm256_setzero_pd();
- for (k = 0; k < states; ++k)
- {
- if ((state>>k) & 1)
+ for (j = 0; j < states_padded; j += 4)
{
- __m256d v_freqs = _mm256_set1_pd(freqs[i][k]);
- __m256d v_eigen = _mm256_load_pd(inv_eigenvecs[i] +
- k*states + j);
-
- v_lefterm = _mm256_add_pd(v_lefterm,
- _mm256_mul_pd(v_eigen, v_freqs));
+ if (k < states && j < states)
+ {
+ __m256d v_freqs = _mm256_set1_pd(freqs[i][k]);
+ __m256d v_eigen = _mm256_load_pd(inv_eigenvecs[i] +
+ k*states + j);
+ __m256d v_lefterm = _mm256_mul_pd(v_eigen, v_freqs);
+ _mm256_store_pd(t_precomp, v_lefterm);
+ }
+ else
+ memset(t_precomp, 0, 4 * sizeof(double));
+
+ t_precomp += 4;
}
- }
}
-
- _mm256_store_pd(t_precomp, v_lefterm);
- t_precomp += 4;
- }
- }
}
/* build sumtable */
for (n = 0; n < sites; n++)
{
- tipstate = (unsigned int) left_tipchars[n];
-
- unsigned int loffset = tipstate * span;
+ // TODO: There should be a proper way to decide (tipmap == NULL?)
+ if (states == 4)
+ tipstate = (unsigned int) left_tipchars[n];
+ else
+ tipstate = tipmap[(unsigned int)left_tipchars[n]];
- t_eigenvecs_padded = eigenvecs_padded;
- t_precomp = precomp_left + loffset;
+ t_eigenvecs_trans = eigenvecs_trans;
+ t_precomp = precomp_left;
for (i = 0; i < rate_cats; ++i)
{
for (j = 0; j < states_padded; j += 4)
- {
- /* point to the four rows of the eigenvec matrix */
- const double * em0 = t_eigenvecs_padded;
- const double * em1 = em0 + states_padded;
- const double * em2 = em1 + states_padded;
- const double * em3 = em2 + states_padded;
- t_eigenvecs_padded += 4*states_padded;
-
- __m256d v_righterm0 = _mm256_setzero_pd();
- __m256d v_righterm1 = _mm256_setzero_pd();
- __m256d v_righterm2 = _mm256_setzero_pd();
- __m256d v_righterm3 = _mm256_setzero_pd();
-
- for (k = 0; k < states_padded; k += 4)
{
- /* load 4 entries of CLV */
- __m256d v_clvc = _mm256_load_pd(t_clvc + k);
-
- /* row 0 */
- __m256d v_eigen = _mm256_load_pd(em0 + k);
- v_righterm0 = _mm256_add_pd(v_righterm0,
- _mm256_mul_pd(v_eigen, v_clvc));
+ __m256d v_lefterm = _mm256_setzero_pd();
+ __m256d v_righterm = _mm256_setzero_pd();
- /* row 1 */
- v_eigen = _mm256_load_pd(em1 + k);
- v_righterm1 = _mm256_add_pd(v_righterm1,
- _mm256_mul_pd(v_eigen, v_clvc));
-
- /* row 2 */
- v_eigen = _mm256_load_pd(em2 + k);
- v_righterm2 = _mm256_add_pd(v_righterm2,
- _mm256_mul_pd(v_eigen, v_clvc));
+ for (k = 0; k < states; ++k)
+ {
+ __m256d v_clvc = _mm256_set1_pd(t_clvc[k]);
+ __m256d v_eigen = _mm256_load_pd(t_eigenvecs_trans +
+ k*states_padded + j);
+ v_righterm = _mm256_add_pd(v_righterm,
+ _mm256_mul_pd(v_eigen, v_clvc));
+
+ if ((tipstate >> k) & 1)
+ {
+ v_lefterm = _mm256_add_pd(v_lefterm,
+ _mm256_load_pd(t_precomp +
+ k*states_padded + j));
+ }
+ }
- /* row 3 */
- v_eigen = _mm256_load_pd(em3 + k);
- v_righterm3 = _mm256_add_pd(v_righterm3,
- _mm256_mul_pd(v_eigen, v_clvc));
+ __m256d v_sum = _mm256_mul_pd(v_lefterm, v_righterm);
+ _mm256_store_pd(sum + j, v_sum);
}
- /* reduce righterm */
- __m256d xmm0, xmm1, xmm2, xmm3;
- xmm0 = _mm256_unpackhi_pd(v_righterm0,v_righterm1);
- xmm1 = _mm256_unpacklo_pd(v_righterm0,v_righterm1);
+ t_clvc += states_padded;
+ t_eigenvecs_trans += states_padded * states_padded;
+ t_precomp += states_padded * states_padded;
+ sum += states_padded;
+ }
+ }
- xmm2 = _mm256_unpackhi_pd(v_righterm2,v_righterm3);
- xmm3 = _mm256_unpacklo_pd(v_righterm2,v_righterm3);
+ pll_aligned_free(eigenvecs_trans);
+ pll_aligned_free(precomp_left);
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
+ return PLL_SUCCESS;
+}
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
+PLL_EXPORT void core_site_likelihood_derivatives_avx(unsigned int states,
+ unsigned int states_padded,
+ unsigned int rate_cats,
+ const double * rate_weights,
+ const double * prop_invar,
+ const double * lk_invar,
+ const double * sumtable,
+ const double * diagptable,
+ double * site_lk)
+{
+ unsigned int i,j;
+ const double *sum = sumtable;
+ const double * diagp = diagptable;
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
+ __m256d v_sitelk = _mm256_setzero_pd ();
+ for (i = 0; i < rate_cats; ++i)
+ {
+ __m256d v_cat_sitelk = _mm256_setzero_pd ();
+ for (j = 0; j < states_padded; j++)
+ {
+ __m256d v_diagp = _mm256_load_pd(diagp);
+ __m256d v_sum = _mm256_set1_pd(sum[j]);
+ v_cat_sitelk = _mm256_add_pd (v_cat_sitelk, _mm256_mul_pd(v_sum, v_diagp));
- __m256d v_righterm = _mm256_add_pd(xmm2,xmm3);
+// v_sitelk = _mm256_add_pd (v_sitelk, _mm256_mul_pd(v_sum, v_diagp));
- __m256d v_lefterm = _mm256_load_pd(t_precomp + j);
+ diagp += 4;
+ }
- __m256d v_sum = _mm256_mul_pd(v_lefterm, v_righterm);
- _mm256_store_pd(sum + j, v_sum);
- }
+ /* account for invariant sites */
+ const double t_prop_invar = prop_invar[i];
+ if (t_prop_invar > 0)
+ {
+ __m256d v_inv_prop = _mm256_set1_pd(1. - t_prop_invar);
+ v_cat_sitelk = _mm256_mul_pd(v_cat_sitelk, v_inv_prop);
- t_clvc += states_padded;
- t_precomp += states_padded;
- sum += states_padded;
+ if (lk_invar)
+ {
+ __m256d v_inv_lk = _mm256_setr_pd(lk_invar[i], 0., 0., 0.);
+ v_cat_sitelk = _mm256_add_pd(v_cat_sitelk, v_inv_lk);
+ }
}
- }
- pll_aligned_free(eigenvecs_padded);
- pll_aligned_free(precomp_left);
+ __m256d v_weight = _mm256_set1_pd(rate_weights[i]);
+ v_sitelk = _mm256_add_pd (v_sitelk, _mm256_mul_pd(v_cat_sitelk, v_weight));
- return PLL_SUCCESS;
+ sum += states_padded;
+ }
+
+ _mm256_store_pd(site_lk, v_sitelk);
}
-PLL_EXPORT int pll_core_likelihood_derivatives_avx(unsigned int states,
- unsigned int states_padded,
- unsigned int rate_cats,
- unsigned int ef_sites,
- const unsigned int * pattern_weights,
- const double * rate_weights,
- const int * invariant,
- const double * prop_invar,
- double ** freqs,
- const double * sumtable,
- const double * diagptable,
- double * d_f,
- double * dd_f)
+PLL_EXPORT void core_site_likelihood_derivatives_4x4_avx(unsigned int rate_cats,
+ const double * rate_weights,
+ const double * prop_invar,
+ const double * lk_invar,
+ const double * sumtable,
+ const double * diagptable,
+ double * site_lk)
{
- unsigned int i,j,k,n;
- unsigned int span_padded = rate_cats * states_padded;
-
- double * t_diagp = NULL;
- const double * diagp_start = NULL;
- double * invar_lk = NULL;
+ unsigned int i;
+ const double *sum = sumtable;
+ const double * diagp = diagptable;
- /* check for special cases in which we can save some computation later on */
- int use_pinv = 0;
- int eq_weights = 1;
+ __m256d v_sitelk = _mm256_setzero_pd ();
for (i = 0; i < rate_cats; ++i)
{
- /* check if proportion of invariant site is used */
- use_pinv |= (prop_invar[i] > 0);
+ __m256d v_cat_sitelk = _mm256_setzero_pd ();
- /* check if rate weights are all equal (e.g. GAMMA) */
- eq_weights &= (rate_weights[i] == rate_weights[0]);
- }
+ __m256d v_diagp = _mm256_load_pd(diagp);
+ __m256d v_sum = _mm256_set1_pd(sum[0]);
+ v_cat_sitelk = _mm256_add_pd (v_cat_sitelk, _mm256_mul_pd(v_sum, v_diagp));
+// v_cat_sitelk = _mm256_fmadd_pd (v_sum, v_diagp, v_cat_sitelk);
- if (use_pinv)
- {
- invar_lk = (double *) pll_aligned_alloc(rate_cats * states * sizeof(double),
- PLL_ALIGNMENT_AVX);
+ v_diagp = _mm256_load_pd(diagp + 4);
+ v_sum = _mm256_set1_pd(sum[1]);
+ v_cat_sitelk = _mm256_add_pd (v_cat_sitelk, _mm256_mul_pd(v_sum, v_diagp));
- if (!invar_lk)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
+ v_diagp = _mm256_load_pd(diagp + 8);
+ v_sum = _mm256_set1_pd(sum[2]);
+ v_cat_sitelk = _mm256_add_pd (v_cat_sitelk, _mm256_mul_pd(v_sum, v_diagp));
- /* pre-compute invariant site likelihoods*/
- for(i = 0; i < states; ++i)
- {
- for(j = 0; j < rate_cats; ++j)
+ v_diagp = _mm256_load_pd(diagp + 12);
+ v_sum = _mm256_set1_pd(sum[3]);
+ v_cat_sitelk = _mm256_add_pd (v_cat_sitelk, _mm256_mul_pd(v_sum, v_diagp));
+
+ /* account for invariant sites */
+ const double t_prop_invar = prop_invar[i];
+ if (t_prop_invar > 0)
{
- invar_lk[i * rate_cats + j] = freqs[j][i] * prop_invar[j];
+ __m256d v_inv_prop = _mm256_set1_pd(1. - t_prop_invar);
+ v_cat_sitelk = _mm256_mul_pd(v_cat_sitelk, v_inv_prop);
+
+ if (lk_invar)
+ {
+ __m256d v_inv_lk = _mm256_setr_pd(lk_invar[i], 0., 0., 0.);
+ v_cat_sitelk = _mm256_add_pd(v_cat_sitelk, v_inv_lk);
+ }
}
- }
+
+ __m256d v_weight = _mm256_set1_pd(rate_weights[i]);
+ v_sitelk = _mm256_add_pd (v_sitelk, _mm256_mul_pd(v_cat_sitelk, v_weight));
+
+ diagp += 16;
+ sum += 4;
}
+ _mm256_store_pd(site_lk, v_sitelk);
+}
- if (states == 4)
+PLL_EXPORT int core_likelihood_derivatives_avx(unsigned int states,
+ unsigned int states_padded,
+ unsigned int rate_cats,
+ unsigned int ef_sites,
+ const unsigned int * pattern_weights,
+ const double * rate_weights,
+ const int * invariant,
+ const double * prop_invar,
+ double ** freqs,
+ const double * sumtable,
+ const double * diagptable,
+ double * d_f,
+ double * dd_f)
+{
+
+ unsigned int i,j,n;
+
+ double * invar_lk = (double *) pll_aligned_alloc(
+ rate_cats * states * sizeof(double),
+ PLL_ALIGNMENT_AVX);
+ if (!invar_lk)
{
- diagp_start = diagptable;
+ pll_errno = PLL_ERROR_MEM_ALLOC;
+ snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
+ return PLL_FAILURE;
}
- else
- {
- t_diagp = (double *) pll_aligned_alloc(
- 3 * span_padded * sizeof(double),
- PLL_ALIGNMENT_AVX);
- if (!t_diagp)
+
+ /* pre-compute invariant site likelihoods*/
+ for(i = 0; i < states; ++i)
+ {
+ for(j = 0; j < rate_cats; ++j)
{
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
+ invar_lk[i * rate_cats + j] = freqs[j][i] * prop_invar[j];
}
+ }
- memset(t_diagp, 0, 3 * span_padded * sizeof(double));
-
- /* transpose diagptable */
- for(i = 0; i < rate_cats; ++i)
+ /* check for special cases in which we can save some computation later on */
+ int use_pinv = 0;
+ int eq_weights = 1;
+ for (i = 0; i < rate_cats; ++i)
{
- for(j = 0; j < states; ++j)
- {
- for(k = 0; k < 3; ++k)
- {
- t_diagp[i * states_padded * 3 + k * states_padded + j] =
- diagptable[i * states * 4 + j * 4 + k];
- }
- }
- }
+ /* check if proportion of invariant site is used */
+ use_pinv |= (prop_invar[i] > 0);
- diagp_start = t_diagp;
- }
+ /* check if rate weights are all equal (e.g. GAMMA) */
+ eq_weights &= (rate_weights[i] == rate_weights[0]);
+ }
/* here we will temporary store per-site LH, 1st and 2nd derivatives */
double site_lk[16] __attribute__( ( aligned ( PLL_ALIGNMENT_AVX ) ) ) ;
@@ -867,7 +812,7 @@ PLL_EXPORT int pll_core_likelihood_derivatives_avx(unsigned int states,
unsigned int offset = 0;
for (n = 0; n < ef_sites; ++n)
{
- const double * diagp = diagp_start;
+ const double * diagp = diagptable;
__m256d v_sitelk = _mm256_setzero_pd ();
for (i = 0; i < rate_cats; ++i)
@@ -898,50 +843,15 @@ PLL_EXPORT int pll_core_likelihood_derivatives_avx(unsigned int states,
}
else
{
- /* pointer to 3 "rows" of diagp with values for lk0, lk1 and lk2 */
- const double * r0 = diagp;
- const double * r1 = r0 + states_padded;
- const double * r2 = r1 + states_padded;
-
- /* unroll 1st iteration to save a couple of adds */
- __m256d v_sum = _mm256_load_pd(sum);
- __m256d v_diagp = _mm256_load_pd(r0);
- __m256d v_lk0 = _mm256_mul_pd(v_sum, v_diagp);
-
- v_diagp = _mm256_load_pd(r1);
- __m256d v_lk1 = _mm256_mul_pd(v_sum, v_diagp);
-
- v_diagp = _mm256_load_pd(r2);
- __m256d v_lk2 = _mm256_mul_pd(v_sum, v_diagp);
-
- /* iterate over remaining states (if any) */
- for (j = 4; j < states_padded; j+= 4)
+ for (j = 0; j < states; j++)
{
- v_sum = _mm256_load_pd(sum + j);
- v_diagp = _mm256_load_pd(r0 + j);
- v_lk0 = _mm256_add_pd (v_lk0, _mm256_mul_pd(v_sum, v_diagp));
-
- v_diagp = _mm256_load_pd(r1 + j);
- v_lk1 = _mm256_add_pd (v_lk1, _mm256_mul_pd(v_sum, v_diagp));
+ __m256d v_diagp = _mm256_load_pd(diagp);
+ __m256d v_sum = _mm256_set1_pd(sum[j]);
+ v_cat_sitelk = _mm256_add_pd (v_cat_sitelk, _mm256_mul_pd(v_sum, v_diagp));
- v_diagp = _mm256_load_pd(r2 + j);
- v_lk2 = _mm256_add_pd (v_lk2, _mm256_mul_pd(v_sum, v_diagp));
+ diagp += 4;
}
-
- /* reduce lk0 (=LH), lk1 (=1st deriv) and v_lk2 (=2nd deriv) */
- v_lk0 = _mm256_hadd_pd(v_lk0, v_lk0);
- double lk0 = ((double *)&v_lk0)[0] + ((double *)&v_lk0)[2];
-
- v_lk1 = _mm256_hadd_pd(v_lk1, v_lk1);
- double lk1 = ((double *)&v_lk1)[0] + ((double *)&v_lk1)[2];
-
- v_lk2 = _mm256_hadd_pd(v_lk2, v_lk2);
- double lk2 = ((double *)&v_lk2)[0] + ((double *)&v_lk2)[2];
-
- v_cat_sitelk = _mm256_setr_pd (lk0, lk1, lk2, 0.);
-
sum += states_padded;
- diagp += 3 * states_padded;
}
/* account for invariant sites */
@@ -1034,10 +944,7 @@ PLL_EXPORT int pll_core_likelihood_derivatives_avx(unsigned int states,
_mm256_store_pd(site_lk, v_ddf);
*dd_f += site_lk[0] + site_lk[1] + site_lk[2] + site_lk[3];
- if (t_diagp)
- pll_aligned_free(t_diagp);
- if (invar_lk)
- pll_aligned_free(invar_lk);
+ pll_aligned_free(invar_lk);
return PLL_SUCCESS;
}
diff --git a/src/core_derivatives_avx2.c b/src/core_derivatives_avx2.c
deleted file mode 100644
index 938a982..0000000
--- a/src/core_derivatives_avx2.c
+++ /dev/null
@@ -1,692 +0,0 @@
-/*
- Copyright (C) 2016 Tomas Flouri, Diego Darriba, Alexey Kozlov
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-PLL_EXPORT int pll_core_update_sumtable_ii_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * clvp,
- const double * clvc,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- double ** freqs,
- double *sumtable,
- unsigned int attrib)
-{
- unsigned int i, j, k, n;
-
- /* build sumtable */
- double * sum = sumtable;
-
- const double * t_clvp = clvp;
- const double * t_clvc = clvc;
- double * t_freqs;
-
- /* dedicated functions for 4x4 matrices */
- if (states == 4)
- {
- /* call AVX variant */
- return pll_core_update_sumtable_ii_avx(states,
- sites,
- rate_cats,
- clvp,
- clvc,
- parent_scaler,
- child_scaler,
- eigenvecs,
- inv_eigenvecs,
- freqs,
- sumtable,
- attrib);
- }
-
- unsigned int states_padded = (states+3) & 0xFFFFFFFC;
-
- /* padded eigenvecs */
- double * tt_eigenvecs = (double *) pll_aligned_alloc (
- (states_padded * states_padded * rate_cats) * sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- if (!tt_eigenvecs)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf (pll_errmsg, 200, "Cannot allocate memory for tt_eigenvecs");
- return PLL_FAILURE;
- }
-
- /* transposed padded inv_eigenvecs */
- double * tt_inv_eigenvecs = (double *) pll_aligned_alloc (
- (states_padded * states_padded * rate_cats) * sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- if (!tt_inv_eigenvecs)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf (pll_errmsg, 200, "Cannot allocate memory for tt_inv_eigenvecs");
- return PLL_FAILURE;
- }
-
- memset(tt_eigenvecs, 0, (states_padded * states_padded * rate_cats) * sizeof(double));
- memset(tt_inv_eigenvecs, 0, (states_padded * states_padded * rate_cats) * sizeof(double));
-
- /* add padding to eigenvecs matrices and multiply with frequencies */
- for (i = 0; i < rate_cats; ++i)
- {
- t_freqs = freqs[i];
- for (j = 0; j < states; ++j)
- for (k = 0; k < states; ++k)
- {
- tt_inv_eigenvecs[i * states_padded * states_padded + j * states_padded
- + k] = inv_eigenvecs[i][k * states + j] * t_freqs[k];
- tt_eigenvecs[i * states_padded * states_padded + j * states_padded
- + k] = eigenvecs[i][j * states + k];
- }
- }
-
- /* vectorized loop from update_sumtable() */
- for (n = 0; n < sites; n++)
- {
- const double * c_eigenvecs = tt_eigenvecs;
- const double * ct_inv_eigenvecs = tt_inv_eigenvecs;
- for (i = 0; i < rate_cats; ++i)
- {
- for (j = 0; j < states_padded; j += 4)
- {
- /* point to the four rows of the eigenvecs matrix */
- const double * em0 = c_eigenvecs;
- const double * em1 = em0 + states_padded;
- const double * em2 = em1 + states_padded;
- const double * em3 = em2 + states_padded;
- c_eigenvecs += 4*states_padded;
-
- /* point to the four rows of the inv_eigenvecs matrix */
- const double * im0 = ct_inv_eigenvecs;
- const double * im1 = im0 + states_padded;
- const double * im2 = im1 + states_padded;
- const double * im3 = im2 + states_padded;
- ct_inv_eigenvecs += 4*states_padded;
-
- __m256d v_lefterm0 = _mm256_setzero_pd ();
- __m256d v_righterm0 = _mm256_setzero_pd ();
- __m256d v_lefterm1 = _mm256_setzero_pd ();
- __m256d v_righterm1 = _mm256_setzero_pd ();
- __m256d v_lefterm2 = _mm256_setzero_pd ();
- __m256d v_righterm2 = _mm256_setzero_pd ();
- __m256d v_lefterm3 = _mm256_setzero_pd ();
- __m256d v_righterm3 = _mm256_setzero_pd ();
-
- __m256d v_eigen;
- __m256d v_clvp;
- __m256d v_clvc;
-
- for (k = 0; k < states_padded; k += 4)
- {
- v_clvp = _mm256_load_pd (t_clvp + k);
- v_clvc = _mm256_load_pd (t_clvc + k);
-
- /* row 0 */
- v_eigen = _mm256_load_pd (im0 + k);
- v_lefterm0 = _mm256_fmadd_pd(v_eigen, v_clvp, v_lefterm0);
-
-
- v_eigen = _mm256_load_pd (em0 + k);
- v_righterm0 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm0);
-
- /* row 1 */
- v_eigen = _mm256_load_pd (im1 + k);
- v_lefterm1 = _mm256_fmadd_pd(v_eigen, v_clvp, v_lefterm1);
-
- v_eigen = _mm256_load_pd (em1 + k);
- v_righterm1 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm1);
-
-
- /* row 2 */
- v_eigen = _mm256_load_pd (im2 + k);
- v_lefterm2 = _mm256_fmadd_pd(v_eigen, v_clvp, v_lefterm2);
-
- v_eigen = _mm256_load_pd (em2 + k);
- v_righterm2 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm2);
-
- /* row 3 */
- v_eigen = _mm256_load_pd (im3 + k);
- v_lefterm3 = _mm256_fmadd_pd(v_eigen, v_clvp, v_lefterm3);
-
- v_eigen = _mm256_load_pd (em3 + k);
- v_righterm3 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm3);
-
- }
-
- /* compute lefterm */
- __m256d xmm0 = _mm256_unpackhi_pd (v_lefterm0, v_lefterm1);
- __m256d xmm1 = _mm256_unpacklo_pd (v_lefterm0, v_lefterm1);
- __m256d xmm2 = _mm256_unpackhi_pd (v_lefterm2, v_lefterm3);
- __m256d xmm3 = _mm256_unpacklo_pd (v_lefterm2, v_lefterm3);
- xmm0 = _mm256_add_pd (xmm0, xmm1);
- xmm1 = _mm256_add_pd (xmm2, xmm3);
- xmm2 = _mm256_permute2f128_pd (xmm0, xmm1, _MM_SHUFFLE(0, 2, 0, 1));
- xmm3 = _mm256_blend_pd (xmm0, xmm1, 12);
- __m256d v_lefterm_sum = _mm256_add_pd (xmm2, xmm3);
-
- /* compute righterm */
- xmm0 = _mm256_unpackhi_pd (v_righterm0, v_righterm1);
- xmm1 = _mm256_unpacklo_pd (v_righterm0, v_righterm1);
- xmm2 = _mm256_unpackhi_pd (v_righterm2, v_righterm3);
- xmm3 = _mm256_unpacklo_pd (v_righterm2, v_righterm3);
- xmm0 = _mm256_add_pd (xmm0, xmm1);
- xmm1 = _mm256_add_pd (xmm2, xmm3);
- xmm2 = _mm256_permute2f128_pd (xmm0, xmm1, _MM_SHUFFLE(0, 2, 0, 1));
- xmm3 = _mm256_blend_pd (xmm0, xmm1, 12);
- __m256d v_righterm_sum = _mm256_add_pd (xmm2, xmm3);
-
- /* update sum */
- __m256d v_prod = _mm256_mul_pd (v_lefterm_sum, v_righterm_sum);
- _mm256_store_pd (sum + j, v_prod);
- }
-
- t_clvc += states_padded;
- t_clvp += states_padded;
- sum += states_padded;
- }
- }
-
- pll_aligned_free (tt_inv_eigenvecs);
- pll_aligned_free (tt_eigenvecs);
-
- return PLL_SUCCESS;
-}
-
-PLL_EXPORT int pll_core_update_sumtable_ti_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned char * left_tipchars,
- const unsigned int * parent_scaler,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- double ** freqs,
- unsigned int * tipmap,
- unsigned int tipmap_size,
- double *sumtable,
- unsigned int attrib)
-{
- if (states == 4)
- {
- /* call AVX version for the 4x4 case */
- return pll_core_update_sumtable_ti_avx(states,
- sites,
- rate_cats,
- parent_clv,
- left_tipchars,
- parent_scaler,
- eigenvecs,
- inv_eigenvecs,
- freqs,
- tipmap,
- tipmap_size,
- sumtable,
- attrib);
- }
-
- unsigned int states_padded = (states+3) & 0xFFFFFFFC;
- unsigned int span = states_padded * rate_cats;
- unsigned int maxstates = tipmap_size;
-
- unsigned int i, j, k, n;
- unsigned int tipstate;
-
- double * sum = sumtable;
- const double * t_clvc = parent_clv;
- const double * t_eigenvecs_padded;
-
- double * eigenvecs_padded = (double *) pll_aligned_alloc (
- (states_padded * states_padded * rate_cats) * sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- double * precomp_left = (double *) pll_aligned_alloc (
- (maxstates * states_padded * rate_cats) * sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- if (!eigenvecs_padded || !precomp_left)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf (pll_errmsg, 200, "Cannot allocate memory for tt_inv_eigenvecs");
- return PLL_FAILURE;
- }
-
- /* add padding to eigenvecs matrix -> for efficient vectorization */
- for (i = 0; i < rate_cats; ++i)
- {
- for (j = 0; j < states_padded; ++j)
- for (k = 0; k < states_padded; ++k)
- {
- eigenvecs_padded[i*states_padded*states_padded + j*states_padded + k] =
- (j < states && k < states) ? eigenvecs[i][j*states + k] : 0.;
- }
- }
-
- /* precompute left terms since they are the same for every site */
- double * t_precomp = precomp_left;
- for (n = 0; n < maxstates; ++n)
- {
- unsigned int state = tipmap ? tipmap[n] : n;
-
- int ss = __builtin_popcount(state) == 1 ? __builtin_ctz(state) : -1;
-
- for (i = 0; i < rate_cats; ++i)
- {
- for (j = 0; j < states_padded; j += 4)
- {
- __m256d v_lefterm;
-
- if (ss != -1)
- {
- /* special case for non-ambiguous state */
- __m256d v_freqs = _mm256_set1_pd(freqs[i][ss]);
- __m256d v_eigen = _mm256_load_pd(inv_eigenvecs[i] +
- ss*states + j);
- v_lefterm = _mm256_mul_pd(v_eigen, v_freqs);
- }
- else
- {
- v_lefterm = _mm256_setzero_pd();
- for (k = 0; k < states; ++k)
- {
- if ((state>>k) & 1)
- {
- __m256d v_freqs = _mm256_set1_pd(freqs[i][k]);
- __m256d v_eigen = _mm256_load_pd(inv_eigenvecs[i] +
- k*states + j);
-
- v_lefterm = _mm256_fmadd_pd(v_eigen, v_freqs, v_lefterm);
- }
- }
- }
-
- _mm256_store_pd(t_precomp, v_lefterm);
- t_precomp += 4;
- }
- }
- }
-
- /* build sumtable */
- for (n = 0; n < sites; n++)
- {
- tipstate = (unsigned int) left_tipchars[n];
-
- unsigned int loffset = tipstate * span;
-
- t_eigenvecs_padded = eigenvecs_padded;
- t_precomp = precomp_left + loffset;
-
- for (i = 0; i < rate_cats; ++i)
- {
- for (j = 0; j < states_padded; j += 4)
- {
- /* point to the four rows of the eigenvec matrix */
- const double * em0 = t_eigenvecs_padded;
- const double * em1 = em0 + states_padded;
- const double * em2 = em1 + states_padded;
- const double * em3 = em2 + states_padded;
- t_eigenvecs_padded += 4*states_padded;
-
- __m256d v_righterm0 = _mm256_setzero_pd();
- __m256d v_righterm1 = _mm256_setzero_pd();
- __m256d v_righterm2 = _mm256_setzero_pd();
- __m256d v_righterm3 = _mm256_setzero_pd();
-
- for (k = 0; k < states_padded; k += 4)
- {
- /* load 4 entries of CLV */
- __m256d v_clvc = _mm256_load_pd(t_clvc + k);
-
- /* row 0 */
- __m256d v_eigen = _mm256_load_pd(em0 + k);
- v_righterm0 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm0);
-
- /* row 1 */
- v_eigen = _mm256_load_pd(em1 + k);
- v_righterm1 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm1);
-
- /* row 2 */
- v_eigen = _mm256_load_pd(em2 + k);
- v_righterm2 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm2);
-
- /* row 3 */
- v_eigen = _mm256_load_pd(em3 + k);
- v_righterm3 = _mm256_fmadd_pd(v_eigen, v_clvc, v_righterm3);
- }
-
- /* reduce righterm */
- __m256d xmm0, xmm1, xmm2, xmm3;
- xmm0 = _mm256_unpackhi_pd(v_righterm0,v_righterm1);
- xmm1 = _mm256_unpacklo_pd(v_righterm0,v_righterm1);
-
- xmm2 = _mm256_unpackhi_pd(v_righterm2,v_righterm3);
- xmm3 = _mm256_unpacklo_pd(v_righterm2,v_righterm3);
-
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
-
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
-
- __m256d v_righterm = _mm256_add_pd(xmm2,xmm3);
-
- __m256d v_lefterm = _mm256_load_pd(t_precomp + j);
-
- __m256d v_sum = _mm256_mul_pd(v_lefterm, v_righterm);
- _mm256_store_pd(sum + j, v_sum);
- }
-
- t_clvc += states_padded;
- t_precomp += states_padded;
- sum += states_padded;
- }
- }
-
- pll_aligned_free(eigenvecs_padded);
- pll_aligned_free(precomp_left);
-
- return PLL_SUCCESS;
-}
-
-PLL_EXPORT
-int pll_core_likelihood_derivatives_avx2(unsigned int states,
- unsigned int states_padded,
- unsigned int rate_cats,
- unsigned int ef_sites,
- const unsigned int * pattern_weights,
- const double * rate_weights,
- const int * invariant,
- const double * prop_invar,
- double ** freqs,
- const double * sumtable,
- const double * diagptable,
- double * d_f,
- double * dd_f)
-{
- unsigned int i,j,k,n;
- unsigned int span_padded = rate_cats * states_padded;
-
- double * t_diagp = NULL;
- const double * diagp_start = NULL;
- double * invar_lk = NULL;
-
- /* check for special cases in which we can save some computation later on */
- int use_pinv = 0;
- int eq_weights = 1;
- for (i = 0; i < rate_cats; ++i)
- {
- /* check if proportion of invariant site is used */
- use_pinv |= (prop_invar[i] > 0);
-
- /* check if rate weights are all equal (e.g. GAMMA) */
- eq_weights &= (rate_weights[i] == rate_weights[0]);
- }
-
- if (use_pinv)
- {
- invar_lk = (double *) pll_aligned_alloc(rate_cats * states * sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- if (!invar_lk)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
-
- /* pre-compute invariant site likelihoods*/
- for(i = 0; i < states; ++i)
- {
- for(j = 0; j < rate_cats; ++j)
- {
- invar_lk[i * rate_cats + j] = freqs[j][i] * prop_invar[j];
- }
- }
- }
-
- if (states == 4)
- {
- diagp_start = diagptable;
- }
- else
- {
- t_diagp = (double *) pll_aligned_alloc(
- 3 * span_padded * sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- if (!t_diagp)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
-
- memset(t_diagp, 0, 3 * span_padded * sizeof(double));
-
- /* transpose diagptable */
- for(i = 0; i < rate_cats; ++i)
- {
- for(j = 0; j < states; ++j)
- {
- for(k = 0; k < 3; ++k)
- {
- t_diagp[i * states_padded * 3 + k * states_padded + j] =
- diagptable[i * states * 4 + j * 4 + k];
- }
- }
- }
-
- diagp_start = t_diagp;
- }
-
- /* here we will temporary store per-site LH, 1st and 2nd derivatives */
- double site_lk[16] __attribute__( ( aligned ( PLL_ALIGNMENT_AVX ) ) ) ;
-
- /* vectors for accumulating 1st and 2nd derivatives */
- __m256d v_df = _mm256_setzero_pd ();
- __m256d v_ddf = _mm256_setzero_pd ();
- __m256d v_all1 = _mm256_set1_pd(1.);
-
- const double *sum = sumtable;
- const int * invariant_ptr = invariant;
- unsigned int offset = 0;
- for (n = 0; n < ef_sites; ++n)
- {
- const double * diagp = diagp_start;
-
- __m256d v_sitelk = _mm256_setzero_pd ();
- for (i = 0; i < rate_cats; ++i)
- {
- __m256d v_cat_sitelk = _mm256_setzero_pd ();
-
- if (states == 4)
- {
- /* use unrolled loop */
- __m256d v_diagp = _mm256_load_pd(diagp);
- __m256d v_sum = _mm256_set1_pd(sum[0]);
- v_cat_sitelk = _mm256_fmadd_pd(v_sum, v_diagp, v_cat_sitelk);
-
- v_diagp = _mm256_load_pd(diagp + 4);
- v_sum = _mm256_set1_pd(sum[1]);
- v_cat_sitelk = _mm256_fmadd_pd(v_sum, v_diagp, v_cat_sitelk);
-
- v_diagp = _mm256_load_pd(diagp + 8);
- v_sum = _mm256_set1_pd(sum[2]);
- v_cat_sitelk = _mm256_fmadd_pd(v_sum, v_diagp, v_cat_sitelk);
-
- v_diagp = _mm256_load_pd(diagp + 12);
- v_sum = _mm256_set1_pd(sum[3]);
- v_cat_sitelk = _mm256_fmadd_pd(v_sum, v_diagp, v_cat_sitelk);
-
- diagp += 16;
- sum += 4;
- }
- else
- {
- /* pointer to 3 "rows" of diagp with values for lk0, lk1 and lk2 */
- const double * r0 = diagp;
- const double * r1 = r0 + states_padded;
- const double * r2 = r1 + states_padded;
-
- /* unroll 1st iteration to save a couple of adds */
- __m256d v_sum = _mm256_load_pd(sum);
- __m256d v_diagp = _mm256_load_pd(r0);
- __m256d v_lk0 = _mm256_mul_pd(v_sum, v_diagp);
-
- v_diagp = _mm256_load_pd(r1);
- __m256d v_lk1 = _mm256_mul_pd(v_sum, v_diagp);
-
- v_diagp = _mm256_load_pd(r2);
- __m256d v_lk2 = _mm256_mul_pd(v_sum, v_diagp);
-
- /* iterate over remaining states (if any) */
- for (j = 4; j < states_padded; j+= 4)
- {
- v_sum = _mm256_load_pd(sum + j);
- v_diagp = _mm256_load_pd(r0 + j);
- v_lk0 = _mm256_fmadd_pd (v_sum, v_diagp, v_lk0);
-
- v_diagp = _mm256_load_pd(r1 + j);
- v_lk1 = _mm256_fmadd_pd (v_sum, v_diagp, v_lk1);
-
- v_diagp = _mm256_load_pd(r2 + j);
- v_lk2 = _mm256_fmadd_pd (v_sum, v_diagp, v_lk2);
- }
-
- /* reduce lk0 (=LH), lk1 (=1st deriv) and v_lk2 (=2nd deriv) */
- v_lk0 = _mm256_hadd_pd(v_lk0, v_lk0);
- double lk0 = ((double *)&v_lk0)[0] + ((double *)&v_lk0)[2];
-
- v_lk1 = _mm256_hadd_pd(v_lk1, v_lk1);
- double lk1 = ((double *)&v_lk1)[0] + ((double *)&v_lk1)[2];
-
- v_lk2 = _mm256_hadd_pd(v_lk2, v_lk2);
- double lk2 = ((double *)&v_lk2)[0] + ((double *)&v_lk2)[2];
-
- v_cat_sitelk = _mm256_setr_pd (lk0, lk1, lk2, 0.);
-
- sum += states_padded;
- diagp += 3 * states_padded;
- }
-
- /* account for invariant sites */
- if (use_pinv && prop_invar[i] > 0)
- {
- __m256d v_inv_prop = _mm256_set1_pd(1. - prop_invar[i]);
- v_cat_sitelk = _mm256_mul_pd(v_cat_sitelk, v_inv_prop);
-
- if (invariant && *invariant_ptr != -1)
- {
- double site_invar_lk = invar_lk[(*invariant_ptr) * rate_cats + i];
- __m256d v_inv_lk = _mm256_setr_pd(site_invar_lk, 0., 0., 0.);
- v_cat_sitelk = _mm256_add_pd(v_cat_sitelk, v_inv_lk);
- }
- }
-
- /* apply rate category weights */
- if (eq_weights)
- {
- /* all rate weights are equal -> no multiplication needed */
- v_sitelk = _mm256_add_pd (v_sitelk, v_cat_sitelk);
- }
- else
- {
- __m256d v_weight = _mm256_set1_pd(rate_weights[i]);
- v_sitelk = _mm256_fmadd_pd(v_cat_sitelk, v_weight, v_sitelk);
- }
- }
-
- _mm256_store_pd(&site_lk[offset], v_sitelk);
- offset += 4;
-
- invariant_ptr++;
-
- /* build derivatives for 4 adjacent sites at once */
- if (offset == 16)
- {
- __m256d v_term0 = _mm256_setr_pd(site_lk[0], site_lk[4],
- site_lk[8], site_lk[12]);
- __m256d v_term1 = _mm256_setr_pd(site_lk[1], site_lk[5],
- site_lk[9], site_lk[13]);
- __m256d v_term2 = _mm256_setr_pd(site_lk[2], site_lk[6],
- site_lk[10], site_lk[14]);
-
- __m256d v_recip0 = _mm256_div_pd(v_all1, v_term0);
- __m256d v_deriv1 = _mm256_mul_pd(v_term1, v_recip0);
- __m256d v_deriv2 = _mm256_sub_pd(_mm256_mul_pd(v_deriv1, v_deriv1),
- _mm256_mul_pd(v_term2, v_recip0));
-
- /* assumption: no zero weights */
- if ((pattern_weights[n-3] | pattern_weights[n-2] |
- pattern_weights[n-1] | pattern_weights[n]) == 1)
- {
- /* all 4 weights are 1 -> no multiplication needed */
- v_df = _mm256_sub_pd (v_df, v_deriv1);
- v_ddf = _mm256_add_pd (v_ddf, v_deriv2);
- }
- else
- {
- __m256d v_patw = _mm256_setr_pd(pattern_weights[n-3], pattern_weights[n-2],
- pattern_weights[n-1], pattern_weights[n]);
-
- v_df = _mm256_fnmadd_pd (v_deriv1, v_patw, v_df);
- v_ddf = _mm256_fmadd_pd (v_deriv2, v_patw, v_ddf);
- }
- offset = 0;
- }
- }
-
- *d_f = *dd_f = 0.;
-
- /* remainder loop */
- while (offset > 0)
- {
- offset -= 4;
- n--;
- double deriv1 = (-site_lk[offset+1] / site_lk[offset]);
- double deriv2 = (deriv1 * deriv1 - (site_lk[offset+2] / site_lk[offset]));
- *d_f += pattern_weights[n] * deriv1;
- *dd_f += pattern_weights[n] * deriv2;
- }
-
- assert(offset == 0 && n == ef_sites / 4 * 4);
-
- /* reduce 1st derivative */
- _mm256_store_pd(site_lk, v_df);
- *d_f += site_lk[0] + site_lk[1] + site_lk[2] + site_lk[3];
-
- /* reduce 2nd derivative */
- _mm256_store_pd(site_lk, v_ddf);
- *dd_f += site_lk[0] + site_lk[1] + site_lk[2] + site_lk[3];
-
- if (t_diagp)
- pll_aligned_free(t_diagp);
- if (invar_lk)
- pll_aligned_free(invar_lk);
-
- return PLL_SUCCESS;
-}
diff --git a/src/core_derivatives_sse.c b/src/core_derivatives_sse.c
index b05b684..abefe08 100644
--- a/src/core_derivatives_sse.c
+++ b/src/core_derivatives_sse.c
@@ -26,61 +26,6 @@
work with SSE (states_padded is set to the corresponding value)
*/
-static int core_update_sumtable_ti_4x4_sse(unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned char * left_tipchars,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- double ** freqs_indices,
- unsigned int * tipmap,
- double * sumtable)
-{
- unsigned int i,j,k,n;
- unsigned int tipstate;
- unsigned int states = 4;
- double lterm = 0;
- double rterm = 0;
-
- const double * clvc = parent_clv;
- const double * ev;
- const double * invei;
- const double * freqs;
-
- double * sum = sumtable;
-
-
- /* build sumtable */
- for (n = 0; n < sites; n++)
- {
- for (i = 0; i < rate_cats; ++i)
- {
- ev = eigenvecs[i];
- invei = inv_eigenvecs[i];
- freqs = freqs_indices[i];
-
- for (j = 0; j < states; ++j)
- {
- tipstate = (unsigned int)left_tipchars[n];
- lterm = 0;
- rterm = 0;
-
- for (k = 0; k < states; ++k)
- {
- lterm += (tipstate & 1) * freqs[k] * invei[k*states+j];
- rterm += ev[j*states+k] * clvc[k];
- tipstate >>= 1;
- }
- sum[j] = lterm*rterm;
- }
-
- clvc += states;
- sum += states;
- }
- }
- return PLL_SUCCESS;
-}
-
PLL_EXPORT int pll_core_update_sumtable_ii_sse(unsigned int states,
unsigned int sites,
unsigned int rate_cats,
@@ -161,15 +106,15 @@ PLL_EXPORT int pll_core_update_sumtable_ti_sse(unsigned int states,
if (states == 4)
{
- return core_update_sumtable_ti_4x4_sse(sites,
- rate_cats,
- parent_clv,
- left_tipchars,
- eigenvecs,
- inv_eigenvecs,
- freqs_indices,
- tipmap,
- sumtable);
+ return pll_core_update_sumtable_ti_4x4_sse(sites,
+ rate_cats,
+ parent_clv,
+ left_tipchars,
+ eigenvecs,
+ inv_eigenvecs,
+ freqs_indices,
+ tipmap,
+ sumtable);
}
unsigned int states_padded = (states+1) & 0xFFFFFFFE;
@@ -204,3 +149,58 @@ PLL_EXPORT int pll_core_update_sumtable_ti_sse(unsigned int states,
}
return PLL_SUCCESS;
}
+
+PLL_EXPORT int pll_core_update_sumtable_ti_4x4_sse(unsigned int sites,
+ unsigned int rate_cats,
+ const double * parent_clv,
+ const unsigned char * left_tipchars,
+ double ** eigenvecs,
+ double ** inv_eigenvecs,
+ double ** freqs_indices,
+ unsigned int * tipmap,
+ double * sumtable)
+{
+ unsigned int i,j,k,n;
+ unsigned int tipstate;
+ unsigned int states = 4;
+ double lterm = 0;
+ double rterm = 0;
+
+ const double * clvc = parent_clv;
+ const double * ev;
+ const double * invei;
+ const double * freqs;
+
+ double * sum = sumtable;
+
+
+ /* build sumtable */
+ for (n = 0; n < sites; n++)
+ {
+ for (i = 0; i < rate_cats; ++i)
+ {
+ ev = eigenvecs[i];
+ invei = inv_eigenvecs[i];
+ freqs = freqs_indices[i];
+
+ for (j = 0; j < states; ++j)
+ {
+ tipstate = (unsigned int)left_tipchars[n];
+ lterm = 0;
+ rterm = 0;
+
+ for (k = 0; k < states; ++k)
+ {
+ lterm += (tipstate & 1) * freqs[k] * invei[k*states+j];
+ rterm += ev[j*states+k] * clvc[k];
+ tipstate >>= 1;
+ }
+ sum[j] = lterm*rterm;
+ }
+
+ clvc += states;
+ sum += states;
+ }
+ }
+ return PLL_SUCCESS;
+}
diff --git a/src/core_likelihood.c b/src/core_likelihood.c
index 690ba06..dba753b 100644
--- a/src/core_likelihood.c
+++ b/src/core_likelihood.c
@@ -46,7 +46,7 @@ PLL_EXPORT double pll_core_root_loglikelihood(unsigned int states,
unsigned int states_padded = states;
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
if (states == 4)
@@ -120,43 +120,6 @@ PLL_EXPORT double pll_core_root_loglikelihood(unsigned int states,
states_padded = (states+3) & 0xFFFFFFFC;
}
#endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- if (states == 4)
- {
- return pll_core_root_loglikelihood_4x4_avx(sites,
- rate_cats,
- clv,
- scaler,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl);
- }
- else
- {
- return pll_core_root_loglikelihood_avx2(states,
- sites,
- rate_cats,
- clv,
- scaler,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl);
- }
- /* this line is never called, but should we disable the else case above,
- then states_padded must be set to this value */
- states_padded = (states+3) & 0xFFFFFFFC;
- }
- #endif
/* iterate through sites */
@@ -178,7 +141,7 @@ PLL_EXPORT double pll_core_root_loglikelihood(unsigned int states,
{
inv_site_lk = (invar_indices[i] == -1) ?
0 : freqs[invar_indices[i]];
- term += rate_weights[j] * (term_r * (1 - prop_invar) +
+ term += rate_weights[j] * (term_r * (1 - prop_invar) +
inv_site_lk*prop_invar);
}
else
@@ -192,12 +155,10 @@ PLL_EXPORT double pll_core_root_loglikelihood(unsigned int states,
site_lk = term;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(site_lk);
+ site_lk = log(site_lk) * pattern_weights[i];
if (scaler && scaler[i])
site_lk += scaler[i] * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[i];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -240,7 +201,7 @@ double pll_core_edge_loglikelihood_ti_4x4(unsigned int sites,
unsigned int states = 4;
unsigned int states_padded = states;
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
return pll_core_edge_loglikelihood_ti_4x4_sse(sites,
@@ -273,27 +234,7 @@ double pll_core_edge_loglikelihood_ti_4x4(unsigned int sites,
invar_proportion,
invar_indices,
freqs_indices,
- persite_lnl,
- attrib);
- }
- #endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- return pll_core_edge_loglikelihood_ti_4x4_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- tipchars,
- pmatrix,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl,
- attrib);
+ persite_lnl);
}
#endif
@@ -341,12 +282,10 @@ double pll_core_edge_loglikelihood_ti_4x4(unsigned int sites,
scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -366,7 +305,6 @@ double pll_core_edge_loglikelihood_ti(unsigned int states,
const unsigned int * parent_scaler,
const unsigned char * tipchars,
const unsigned int * tipmap,
- unsigned int tipmap_size,
const double * pmatrix,
double ** frequencies,
const double * rate_weights,
@@ -393,7 +331,7 @@ double pll_core_edge_loglikelihood_ti(unsigned int states,
unsigned int states_padded = states;
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
if (states == 4)
@@ -452,87 +390,7 @@ double pll_core_edge_loglikelihood_ti(unsigned int states,
invar_proportion,
invar_indices,
freqs_indices,
- persite_lnl,
- attrib);
- }
- else if (states == 20)
- {
- return pll_core_edge_loglikelihood_ti_20x20_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- tipchars,
- tipmap,
- tipmap_size,
- pmatrix,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl);
- }
- else
- {
- return pll_core_edge_loglikelihood_ti_avx(states,
- sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- tipchars,
- tipmap,
- pmatrix,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl);
- }
- /* this line is never called, but should we disable the else case above,
- then states_padded must be set to this value */
- states_padded = (states+3) & 0xFFFFFFFC;
- }
- #endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- if (states == 4)
- {
- return pll_core_edge_loglikelihood_ti_4x4_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- tipchars,
- pmatrix,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl,
- attrib);
- }
- else if (states == 20)
- {
- return pll_core_edge_loglikelihood_ti_20x20_avx2(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- tipchars,
- tipmap,
- tipmap_size,
- pmatrix,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl);
+ persite_lnl);
}
else
{
@@ -601,12 +459,10 @@ double pll_core_edge_loglikelihood_ti(unsigned int states,
scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -650,11 +506,11 @@ double pll_core_edge_loglikelihood_ii(unsigned int states,
unsigned int scale_factors;
- /* TODO: We need states_padded in the AVX/SSE implementations
+ /* TODO: We need states_padded in the AVX/SSE implementations
*/
unsigned int states_padded = states;
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
if (states == 4)
@@ -715,8 +571,7 @@ double pll_core_edge_loglikelihood_ii(unsigned int states,
invar_proportion,
invar_indices,
freqs_indices,
- persite_lnl,
- attrib);
+ persite_lnl);
}
else
{
@@ -741,51 +596,7 @@ double pll_core_edge_loglikelihood_ii(unsigned int states,
states_padded = (states+3) & 0xFFFFFFFC;
}
#endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- if (states == 4)
- {
- return pll_core_edge_loglikelihood_ii_4x4_avx(sites,
- rate_cats,
- clvp,
- parent_scaler,
- clvc,
- child_scaler,
- pmatrix,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl,
- attrib);
- }
- else
- {
- return pll_core_edge_loglikelihood_ii_avx2(states,
- sites,
- rate_cats,
- clvp,
- parent_scaler,
- clvc,
- child_scaler,
- pmatrix,
- frequencies,
- rate_weights,
- pattern_weights,
- invar_proportion,
- invar_indices,
- freqs_indices,
- persite_lnl);
- }
- /* this line is never called, but should we disable the else case above,
- then states_padded must be set to this value */
- states_padded = (states+3) & 0xFFFFFFFC;
- }
- #endif
-
+
for (n = 0; n < sites; ++n)
{
pmat = pmatrix;
@@ -828,12 +639,10 @@ double pll_core_edge_loglikelihood_ii(unsigned int states,
scale_factors += (child_scaler) ? child_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
diff --git a/src/core_likelihood_avx.c b/src/core_likelihood_avx.c
index 63a803c..b87c9aa 100644
--- a/src/core_likelihood_avx.c
+++ b/src/core_likelihood_avx.c
@@ -19,7 +19,6 @@
Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
*/
-#include <limits.h>
#include "pll.h"
PLL_EXPORT double pll_core_root_loglikelihood_avx(unsigned int states,
@@ -85,7 +84,7 @@ PLL_EXPORT double pll_core_root_loglikelihood_avx(unsigned int states,
freqs = frequencies[freqs_indices[j]];
inv_site_lk = (invar_indices[i] == -1) ?
0 : freqs[invar_indices[i]];
- term += rate_weights[j] * (term_r * (1 - prop_invar) +
+ term += rate_weights[j] * (term_r * (1 - prop_invar) +
inv_site_lk*prop_invar);
}
else
@@ -95,12 +94,10 @@ PLL_EXPORT double pll_core_root_loglikelihood_avx(unsigned int states,
}
/* compute site log-likelihood and scale if necessary */
- term = log(term);
+ term = log(term) * pattern_weights[i];
if (scaler && scaler[i])
term += scaler[i] * log(PLL_SCALE_THRESHOLD);
- term *= pattern_weights[i];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = term;
@@ -161,7 +158,7 @@ double pll_core_root_loglikelihood_4x4_avx(unsigned int sites,
{
inv_site_lk = (invar_indices[i] == -1) ?
0 : freqs[invar_indices[i]];
- term += rate_weights[j] * (term_r * (1 - prop_invar) +
+ term += rate_weights[j] * (term_r * (1 - prop_invar) +
inv_site_lk*prop_invar);
}
else
@@ -173,12 +170,10 @@ double pll_core_root_loglikelihood_4x4_avx(unsigned int sites,
}
/* compute site log-likelihood and scale if necessary */
- term = log(term);
+ term = log(term) * pattern_weights[i];
if (scaler && scaler[i])
term += scaler[i] * log(PLL_SCALE_THRESHOLD);
- term *= pattern_weights[i];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = term;
@@ -201,8 +196,7 @@ double pll_core_edge_loglikelihood_ti_4x4_avx(unsigned int sites,
const double * invar_proportion,
const int * invar_indices,
const unsigned int * freqs_indices,
- double * persite_lnl,
- unsigned int attrib)
+ double * persite_lnl)
{
unsigned int n,i,m = 0;
double logl = 0;
@@ -215,6 +209,7 @@ double pll_core_edge_loglikelihood_ti_4x4_avx(unsigned int sites,
double terma, terma_r;
double site_lk, inv_site_lk;
+ unsigned int scale_factors;
unsigned int cstate;
unsigned int states_padded = 4;
unsigned int span = rate_cats*states_padded;
@@ -222,24 +217,6 @@ double pll_core_edge_loglikelihood_ti_4x4_avx(unsigned int sites,
__m256d xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7;
__m256i mask;
- unsigned int site_scale_factors;
- unsigned int * rate_scale_factors = NULL;
- int per_rate_scaling = (attrib & PLL_ATTRIB_RATE_SCALERS) ? 1 : 0;
-
- /* powers of scale threshold for undoing the scaling */
- __m256d v_scale_minlh[5] = {
- _mm256_set1_pd(1.0),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD)
- };
-
- if (per_rate_scaling)
- rate_scale_factors = (unsigned int*) calloc(rate_cats, sizeof(unsigned int));
-
/* precompute a lookup table of four values per entry (one for each state),
for all 16 states (including ambiguities) and for each rate category. */
double * lookup = pll_aligned_alloc(64*rate_cats*sizeof(double),
@@ -317,22 +294,6 @@ double pll_core_edge_loglikelihood_ti_4x4_avx(unsigned int sites,
unsigned int coffset = cstate*span;
- if (per_rate_scaling)
- {
- site_scale_factors = UINT_MAX;
- for (i = 0; i < rate_cats; ++i)
- {
- rate_scale_factors[i] = (parent_scaler) ? parent_scaler[n*rate_cats+i] : 0;
- if (rate_scale_factors[i] < site_scale_factors)
- site_scale_factors = rate_scale_factors[i];
- }
- }
- else
- {
- /* count number of scaling factors to account for */
- site_scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
- }
-
for (i = 0; i < rate_cats; ++i)
{
/* load precomputed lookup table into xmm3 */
@@ -342,197 +303,14 @@ double pll_core_edge_loglikelihood_ti_4x4_avx(unsigned int sites,
xmm2 = _mm256_load_pd(clvp);
xmm0 = _mm256_mul_pd(xmm1,xmm2);
- /* apply per-rate scalers, if necessary */
- if (per_rate_scaling)
- {
- int scalings = rate_scale_factors[i] - site_scale_factors > 4 ?
- 4 : (rate_scale_factors[i] - site_scale_factors);
-
- xmm0 = _mm256_mul_pd(xmm0, v_scale_minlh[scalings]);
- }
-
/* add up the elements of xmm0 */
xmm1 = _mm256_hadd_pd(xmm0,xmm0);
terma_r = ((double *)&xmm1)[0] + ((double *)&xmm1)[2];
- if (terma_r > 0.)
- {
- /* account for invariant sites */
- prop_invar = invar_proportion ? invar_proportion[freqs_indices[i]] : 0;
- if (prop_invar > 0)
- {
- inv_site_lk = (invar_indices[n] == -1) ?
- 0 : freqs[invar_indices[n]];
- terma += rate_weights[i] * (terma_r * (1 - prop_invar) +
- inv_site_lk * prop_invar);
- }
- else
- {
- terma += terma_r * rate_weights[i];
- }
- }
-
- clvp += states_padded;
- coffset += 4;
- }
-
- /* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
-
- /* apply per-site scaler, if necessary */
- if (site_scale_factors)
- site_lk += site_scale_factors * log(PLL_SCALE_THRESHOLD);
-
- site_lk *= pattern_weights[n];
-
- /* store per-site log-likelihood */
- if (persite_lnl)
- persite_lnl[m++] = site_lk;
-
- logl += site_lk;
- }
-
- pll_aligned_free(lookup);
- if (rate_scale_factors)
- free(rate_scale_factors);
-
- return logl;
-}
-
-PLL_EXPORT
-double pll_core_edge_loglikelihood_ti_20x20_avx(unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned int * parent_scaler,
- const unsigned char * tipchars,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- const double * pmatrix,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl)
-{
- unsigned int n,i,j,m = 0;
- double logl = 0;
- double prop_invar = 0;
-
- const double * clvp = parent_clv;
- const double * pmat;
- const double * freqs = NULL;
-
- double terma, terma_r;
- double site_lk, inv_site_lk;
-
- unsigned int cstate;
- unsigned int scale_factors;
- unsigned int states = 20;
- unsigned int states_padded = states;
-
- __m256d xmm0, xmm1, xmm2;
-
- size_t displacement = (states_padded - states) * (states_padded);
-
- unsigned int span = states_padded * rate_cats;
- unsigned int maxstates = tipmap_size;
-
- /* precompute a lookup table of four values per entry (one for each state),
- for all 16 states (including ambiguities) and for each rate category. */
- double * lookup = pll_aligned_alloc(maxstates*span*sizeof(double),
- PLL_ALIGNMENT_AVX);
- if (!lookup)
- {
- /* TODO: in the highly unlikely event that allocation fails, we should
- resort to a non-lookup-precomputation version of this function,
- available at commit e.g. a4fc873fdc65741e402cdc1c59919375143d97d1 */
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Cannot allocate space for precomputation.");
- return 0.;
- }
-
- double * ptr = lookup;
-
- /* precompute left-side values and store them in lookup table */
- for (j = 0; j < maxstates; ++j)
- {
- pmat = pmatrix;
-
- unsigned int state = tipmap[j];
-
- int ss = __builtin_popcount(state) == 1 ? __builtin_ctz(state) : -1;
-
- for (n = 0; n < rate_cats; ++n)
- {
- freqs = frequencies[freqs_indices[n]];
-
- for (i = 0; i < states; ++i)
- {
- double terml;
- if (ss != -1)
- {
- /* special case for non-ambiguous states */
- terml = pmat[ss];
- }
- else
- {
- terml = 0;
- for (m = 0; m < states; ++m)
- {
- if ((state>>m) & 1)
- {
- terml += pmat[m];
- }
- }
- }
-
- pmat += states;
-
- ptr[i] = terml * freqs[i];
- }
-
- ptr += states;
- }
- }
-
- for (n = 0; n < sites; ++n)
- {
- terma = 0;
-
- cstate = (unsigned int) tipchars[n];
- unsigned int loffset = cstate*span;
-
- for (i = 0; i < rate_cats; ++i)
- {
- xmm1 = _mm256_setzero_pd();
-
- /* iterate over quadruples of rows */
- for (j = 0; j < states_padded; j += 4)
- {
- /* load value from lookup table */
- xmm2 = _mm256_load_pd(lookup+loffset);
-
- /* multiply with clvp */
- xmm0 = _mm256_load_pd(clvp);
- xmm0 = _mm256_mul_pd(xmm2,xmm0);
-
- /* add up the elements of xmm1 to the accumulator */
- xmm1 = _mm256_add_pd(xmm1,xmm0);
-
- clvp += 4;
- loffset += 4;
- }
-
- xmm0 = _mm256_hadd_pd(xmm1,xmm1);
- terma_r = ((double *)&xmm0)[0] + ((double *)&xmm0)[2];
-
/* account for invariant sites */
prop_invar = invar_proportion ? invar_proportion[freqs_indices[i]] : 0;
if (prop_invar > 0)
{
- freqs = frequencies[freqs_indices[i]];
inv_site_lk = (invar_indices[n] == -1) ?
0 : freqs[invar_indices[n]];
terma += rate_weights[i] * (terma_r * (1 - prop_invar) +
@@ -543,27 +321,25 @@ double pll_core_edge_loglikelihood_ti_20x20_avx(unsigned int sites,
terma += terma_r * rate_weights[i];
}
- pmat -= displacement;
+ clvp += states_padded;
+ coffset += 4;
}
+
/* count number of scaling factors to acount for */
scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
- persite_lnl[n] = site_lk;
+ persite_lnl[m++] = site_lk;
logl += site_lk;
}
-
pll_aligned_free(lookup);
-
return logl;
}
@@ -636,7 +412,7 @@ double pll_core_edge_loglikelihood_ti_avx(unsigned int states,
/* iterate quadruples of columns */
for (k = 0; k < states_padded; k += 4)
{
-
+
/* set mask */
mask = _mm256_set_epi64x(
((cstate >> (lsb+3)) & 1) ? ~0 : 0,
@@ -667,7 +443,7 @@ double pll_core_edge_loglikelihood_ti_avx(unsigned int states,
row3 += 4;
}
- /* point pmatrix to the next four rows */
+ /* point pmatrix to the next four rows */
pmat = row3;
/* create a vector containing the sums of xmm0, xmm1, xmm2, xmm3 */
@@ -721,12 +497,10 @@ double pll_core_edge_loglikelihood_ti_avx(unsigned int states,
scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -780,7 +554,7 @@ double pll_core_edge_loglikelihood_ii_avx(unsigned int states,
{
freqs = frequencies[freqs_indices[i]];
terma_r = 0;
-
+
/* iterate over quadruples of rows */
for (j = 0; j < states_padded; j += 4)
{
@@ -794,7 +568,7 @@ double pll_core_edge_loglikelihood_ii_avx(unsigned int states,
const double * row1 = row0 + states_padded;
const double * row2 = row1 + states_padded;
const double * row3 = row2 + states_padded;
-
+
/* iterate quadruples of columns */
for (k = 0; k < states_padded; k += 4)
{
@@ -811,7 +585,7 @@ double pll_core_edge_loglikelihood_ii_avx(unsigned int states,
xmm6 = _mm256_mul_pd(xmm4,xmm5);
xmm1 = _mm256_add_pd(xmm1,xmm6);
row1 += 4;
-
+
/* row 2 */
xmm4 = _mm256_load_pd(row2);
xmm6 = _mm256_mul_pd(xmm4,xmm5);
@@ -825,7 +599,7 @@ double pll_core_edge_loglikelihood_ii_avx(unsigned int states,
row3 += 4;
}
- /* point pmatrix to the next four rows */
+ /* point pmatrix to the next four rows */
pmat = row3;
/* create a vector containing the sums of xmm0, xmm1, xmm2, xmm3 */
@@ -881,12 +655,10 @@ double pll_core_edge_loglikelihood_ii_avx(unsigned int states,
scale_factors += (child_scaler) ? child_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -910,8 +682,7 @@ double pll_core_edge_loglikelihood_ii_4x4_avx(unsigned int sites,
const double * invar_proportion,
const int * invar_indices,
const unsigned int * freqs_indices,
- double * persite_lnl,
- unsigned int attrib)
+ double * persite_lnl)
{
unsigned int n,i,m = 0;
double logl = 0;
@@ -925,52 +696,16 @@ double pll_core_edge_loglikelihood_ii_4x4_avx(unsigned int sites,
double terma, terma_r;
double site_lk, inv_site_lk;
+ unsigned int scale_factors;
unsigned int states = 4;
unsigned int states_padded = 4;
__m256d xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6;
-
- unsigned int site_scale_factors;
- unsigned int * rate_scale_factors = NULL;
- int per_rate_scaling = (attrib & PLL_ATTRIB_RATE_SCALERS) ? 1 : 0;
-
- /* powers of scale threshold for undoing the scaling */
- __m256d v_scale_minlh[5] = {
- _mm256_set1_pd(1.0),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD),
- _mm256_set1_pd(PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD *
- PLL_SCALE_THRESHOLD * PLL_SCALE_THRESHOLD)
- };
-
- if (per_rate_scaling)
- rate_scale_factors = (unsigned int*) calloc(rate_cats, sizeof(unsigned int));
-
+
for (n = 0; n < sites; ++n)
{
pmat = pmatrix;
terma = 0;
-
- if (per_rate_scaling)
- {
- site_scale_factors = UINT_MAX;
- for (i = 0; i < rate_cats; ++i)
- {
- rate_scale_factors[i] = (parent_scaler) ? parent_scaler[n*rate_cats+i] : 0;
- rate_scale_factors[i] += (child_scaler) ? child_scaler[n*rate_cats+i] : 0;
- if (rate_scale_factors[i] < site_scale_factors)
- site_scale_factors = rate_scale_factors[i];
- }
- }
- else
- {
- /* count number of scaling factors to account for */
- site_scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
- site_scale_factors += (child_scaler) ? child_scaler[n] : 0;
- }
-
for (i = 0; i < rate_cats; ++i)
{
freqs = frequencies[freqs_indices[i]];
@@ -1024,48 +759,37 @@ double pll_core_edge_loglikelihood_ii_4x4_avx(unsigned int sites,
xmm2 = _mm256_load_pd(clvp);
xmm0 = _mm256_mul_pd(xmm1,xmm2);
- /* apply per-rate scalers, if necessary */
- if (per_rate_scaling)
- {
- int scalings = rate_scale_factors[i] - site_scale_factors > 4 ?
- 4 : (rate_scale_factors[i] - site_scale_factors);
-
- xmm0 = _mm256_mul_pd(xmm0, v_scale_minlh[scalings]);
- }
-
/* add up the elements of xmm0 */
xmm1 = _mm256_hadd_pd(xmm0,xmm0);
terma_r = ((double *)&xmm1)[0] + ((double *)&xmm1)[2];
- if (terma_r > 0.)
+
+ /* account for invariant sites */
+ prop_invar = invar_proportion ? invar_proportion[freqs_indices[i]] : 0;
+ if (prop_invar > 0)
{
- /* account for invariant sites */
- prop_invar = invar_proportion ? invar_proportion[freqs_indices[i]] : 0;
- if (prop_invar > 0)
- {
- inv_site_lk = (invar_indices[n] == -1) ?
- 0 : freqs[invar_indices[n]];
- terma += rate_weights[i] * (terma_r * (1 - prop_invar) +
- inv_site_lk * prop_invar);
- }
- else
- {
- terma += terma_r * rate_weights[i];
- }
+ inv_site_lk = (invar_indices[n] == -1) ?
+ 0 : freqs[invar_indices[n]];
+ terma += rate_weights[i] * (terma_r * (1 - prop_invar) +
+ inv_site_lk * prop_invar);
+ }
+ else
+ {
+ terma += terma_r * rate_weights[i];
}
clvp += states_padded;
clvc += states_padded;
}
- /* compute site log-likelihood */
- site_lk = log(terma);
-
- /* apply per-site scaler, if necessary */
- if (site_scale_factors)
- site_lk += site_scale_factors * log(PLL_SCALE_THRESHOLD);
+ /* count number of scaling factors to acount for */
+ scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
+ scale_factors += (child_scaler) ? child_scaler[n] : 0;
- site_lk *= pattern_weights[n];
+ /* compute site log-likelihood and scale if necessary */
+ site_lk = log(terma) * pattern_weights[n];
+ if (scale_factors)
+ site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
/* store per-site log-likelihood */
if (persite_lnl)
@@ -1073,9 +797,5 @@ double pll_core_edge_loglikelihood_ii_4x4_avx(unsigned int sites,
logl += site_lk;
}
-
- if (rate_scale_factors)
- free(rate_scale_factors);
-
return logl;
}
diff --git a/src/core_likelihood_avx2.c b/src/core_likelihood_avx2.c
deleted file mode 100644
index f5f02dc..0000000
--- a/src/core_likelihood_avx2.c
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- Copyright (C) 2015 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-PLL_EXPORT double pll_core_root_loglikelihood_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * clv,
- const unsigned int * scaler,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl)
-{
- unsigned int i,j,k,m = 0;
- double logl = 0;
- double prop_invar = 0;
-
- const double * freqs = NULL;
-
- double term, term_r;
- double inv_site_lk;
-
- unsigned int states_padded = (states+3) & 0xFFFFFFFC;
-
- __m256d xmm0, xmm1, xmm3;
-
- for (i = 0; i < sites; ++i)
- {
- term = 0;
- for (j = 0; j < rate_cats; ++j)
- {
- freqs = frequencies[freqs_indices[j]];
- xmm3 = _mm256_setzero_pd();
-
- for (k = 0; k < states_padded; k += 4)
- {
- /* load frequencies for current rate matrix */
- xmm0 = _mm256_load_pd(freqs);
-
- /* load clv */
- xmm1 = _mm256_load_pd(clv);
-
- /* multiply with frequencies */
- xmm3 = _mm256_fmadd_pd(xmm0, xmm1, xmm3);
-
- freqs += 4;
- clv += 4;
- }
-
- /* add up the elements of xmm2 */
- xmm1 = _mm256_hadd_pd(xmm3,xmm3);
-
- term_r = ((double *)&xmm1)[0] + ((double *)&xmm1)[2];
-
- /* account for invariant sites */
- prop_invar = invar_proportion ? invar_proportion[freqs_indices[j]] : 0;
- if (prop_invar > 0)
- {
- freqs = frequencies[freqs_indices[j]];
- inv_site_lk = (invar_indices[i] == -1) ?
- 0 : freqs[invar_indices[i]];
- term += rate_weights[j] * (term_r * (1 - prop_invar) +
- inv_site_lk*prop_invar);
- }
- else
- {
- term += term_r * rate_weights[j];
- }
- }
-
- /* compute site log-likelihood and scale if necessary */
- term = log(term);
- if (scaler && scaler[i])
- term += scaler[i] * log(PLL_SCALE_THRESHOLD);
-
- term *= pattern_weights[i];
-
- /* store per-site log-likelihood */
- if (persite_lnl)
- persite_lnl[m++] = term;
-
- logl += term;
- }
- return logl;
-}
-
-PLL_EXPORT
-double pll_core_edge_loglikelihood_ti_20x20_avx2(unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned int * parent_scaler,
- const unsigned char * tipchars,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- const double * pmatrix,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl)
-{
- unsigned int n,i,j,m = 0;
- double logl = 0;
- double prop_invar = 0;
-
- const double * clvp = parent_clv;
- const double * pmat;
- const double * freqs = NULL;
-
- double terma, terma_r;
- double site_lk, inv_site_lk;
-
- unsigned int cstate;
- unsigned int scale_factors;
- unsigned int states = 20;
- unsigned int states_padded = states;
-
- __m256d xmm0, xmm1, xmm2;
-
- size_t displacement = (states_padded - states) * (states_padded);
-
- unsigned int span = states_padded * rate_cats;
- unsigned int maxstates = tipmap_size;
-
- /* precompute a lookup table of four values per entry (one for each state),
- for all 16 states (including ambiguities) and for each rate category. */
- double * lookup = pll_aligned_alloc(maxstates*span*sizeof(double),
- PLL_ALIGNMENT_AVX);
- if (!lookup)
- {
- /* TODO: in the highly unlikely event that allocation fails, we should
- resort to a non-lookup-precomputation version of this function,
- available at commit e.g. a4fc873fdc65741e402cdc1c59919375143d97d1 */
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Cannot allocate space for precomputation.");
- return 0.;
- }
-
- double * ptr = lookup;
-
- /* precompute left-side values and store them in lookup table */
- for (j = 0; j < maxstates; ++j)
- {
- pmat = pmatrix;
-
- unsigned int state = tipmap[j];
-
- int ss = __builtin_popcount(state) == 1 ? __builtin_ctz(state) : -1;
-
- for (n = 0; n < rate_cats; ++n)
- {
- freqs = frequencies[freqs_indices[n]];
-
- for (i = 0; i < states; ++i)
- {
- double terml;
- if (ss != -1)
- {
- /* special case for non-ambiguous states */
- terml = pmat[ss];
- }
- else
- {
- terml = 0;
- for (m = 0; m < states; ++m)
- {
- if ((state>>m) & 1)
- {
- terml += pmat[m];
- }
- }
- }
-
- pmat += states;
-
- ptr[i] = terml * freqs[i];
- }
-
- ptr += states;
- }
- }
-
- for (n = 0; n < sites; ++n)
- {
- terma = 0;
-
- cstate = (unsigned int) tipchars[n];
- unsigned int loffset = cstate*span;
-
- for (i = 0; i < rate_cats; ++i)
- {
- xmm1 = _mm256_setzero_pd();
-
- /* iterate over quadruples of rows */
- for (j = 0; j < states_padded; j += 4)
- {
- /* load value from lookup table */
- xmm2 = _mm256_load_pd(lookup+loffset);
-
- /* multiply with clvp */
- xmm0 = _mm256_load_pd(clvp);
- xmm1 = _mm256_fmadd_pd(xmm2, xmm0, xmm1);
-
- clvp += 4;
- loffset += 4;
- }
-
- /* add up the elements of xmm1 */
- xmm0 = _mm256_hadd_pd(xmm1,xmm1);
- terma_r = ((double *)&xmm0)[0] + ((double *)&xmm0)[2];
-
- /* account for invariant sites */
- prop_invar = invar_proportion ? invar_proportion[freqs_indices[i]] : 0;
- if (prop_invar > 0)
- {
- freqs = frequencies[freqs_indices[i]];
- inv_site_lk = (invar_indices[n] == -1) ?
- 0 : freqs[invar_indices[n]];
- terma += rate_weights[i] * (terma_r * (1 - prop_invar) +
- inv_site_lk * prop_invar);
- }
- else
- {
- terma += terma_r * rate_weights[i];
- }
-
- pmat -= displacement;
- }
- /* count number of scaling factors to acount for */
- scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
-
- /* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
- if (scale_factors)
- site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
-
- site_lk *= pattern_weights[n];
-
- /* store per-site log-likelihood */
- if (persite_lnl)
- persite_lnl[m++] = site_lk;
-
- logl += site_lk;
- }
-
- pll_aligned_free(lookup);
-
- return logl;
-}
-
-PLL_EXPORT
-double pll_core_edge_loglikelihood_ii_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned int * parent_scaler,
- const double * child_clv,
- const unsigned int * child_scaler,
- const double * pmatrix,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl)
-{
- unsigned int n,i,j,k,m = 0;
- double logl = 0;
- double prop_invar = 0;
-
- const double * clvp = parent_clv;
- const double * clvc = child_clv;
- const double * pmat;
- const double * freqs = NULL;
-
- double terma, terma_r;
- double site_lk, inv_site_lk;
-
- unsigned int scale_factors;
- unsigned int states_padded = (states+3) & 0xFFFFFFFC;
-
- __m256d xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7;
-
- size_t displacement = (states_padded - states) * (states_padded);
-
- for (n = 0; n < sites; ++n)
- {
- pmat = pmatrix;
- terma = 0;
- for (i = 0; i < rate_cats; ++i)
- {
- freqs = frequencies[freqs_indices[i]];
- terma_r = 0;
-
- /* iterate over quadruples of rows */
- for (j = 0; j < states_padded; j += 4)
- {
- xmm0 = _mm256_setzero_pd();
- xmm1 = _mm256_setzero_pd();
- xmm2 = _mm256_setzero_pd();
- xmm3 = _mm256_setzero_pd();
-
- /* point to the four rows */
- const double * row0 = pmat;
- const double * row1 = row0 + states_padded;
- const double * row2 = row1 + states_padded;
- const double * row3 = row2 + states_padded;
-
- /* iterate quadruples of columns */
- for (k = 0; k < states_padded; k += 4)
- {
- xmm5 = _mm256_load_pd(clvc+k);
-
- /* row 0 */
- xmm4 = _mm256_load_pd(row0);
- xmm0 = _mm256_fmadd_pd(xmm4, xmm5, xmm0);
- row0 += 4;
-
- /* row 1 */
- xmm4 = _mm256_load_pd(row1);
- xmm1 = _mm256_fmadd_pd(xmm4, xmm5, xmm1);
- row1 += 4;
-
- /* row 2 */
- xmm4 = _mm256_load_pd(row2);
- xmm2 = _mm256_fmadd_pd(xmm4, xmm5, xmm2);
- row2 += 4;
-
- /* row 3 */
- xmm4 = _mm256_load_pd(row3);
- xmm3 = _mm256_fmadd_pd(xmm4, xmm5, xmm3);
- row3 += 4;
- }
-
- /* point pmatrix to the next four rows */
- pmat = row3;
-
- /* create a vector containing the sums of xmm0, xmm1, xmm2, xmm3 */
- xmm4 = _mm256_unpackhi_pd(xmm0,xmm1);
- xmm5 = _mm256_unpacklo_pd(xmm0,xmm1);
-
- xmm6 = _mm256_unpackhi_pd(xmm2,xmm3);
- xmm7 = _mm256_unpacklo_pd(xmm2,xmm3);
-
- xmm0 = _mm256_add_pd(xmm4,xmm5);
- xmm1 = _mm256_add_pd(xmm6,xmm7);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
- xmm0 = _mm256_add_pd(xmm2,xmm3);
-
- /* multiply with frequencies */
- xmm1 = _mm256_load_pd(freqs);
- xmm2 = _mm256_mul_pd(xmm0,xmm1);
-
- /* multiply with clvp */
- xmm0 = _mm256_load_pd(clvp);
- xmm1 = _mm256_mul_pd(xmm2,xmm0);
-
- /* add up the elements of xmm1 */
- xmm0 = _mm256_hadd_pd(xmm1,xmm1);
- terma_r += ((double *)&xmm0)[0] + ((double *)&xmm0)[2];
-
- freqs += 4;
- clvp += 4;
- }
-
- /* account for invariant sites */
- prop_invar = invar_proportion ? invar_proportion[freqs_indices[i]] : 0;
- if (prop_invar > 0)
- {
- freqs = frequencies[freqs_indices[i]];
- inv_site_lk = (invar_indices[n] == -1) ?
- 0 : freqs[invar_indices[n]];
- terma += rate_weights[i] * (terma_r * (1 - prop_invar) +
- inv_site_lk * prop_invar);
- }
- else
- {
- terma += terma_r * rate_weights[i];
- }
-
- clvc += states_padded;
- pmat -= displacement;
- }
- /* count number of scaling factors to acount for */
- scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
- scale_factors += (child_scaler) ? child_scaler[n] : 0;
-
- /* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
- if (scale_factors)
- site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
-
- site_lk *= pattern_weights[n];
-
- /* store per-site log-likelihood */
- if (persite_lnl)
- persite_lnl[m++] = site_lk;
-
- logl += site_lk;
- }
- return logl;
-}
diff --git a/src/core_likelihood_sse.c b/src/core_likelihood_sse.c
index 6a17ea5..221226d 100644
--- a/src/core_likelihood_sse.c
+++ b/src/core_likelihood_sse.c
@@ -91,12 +91,10 @@ PLL_EXPORT double pll_core_root_loglikelihood_sse(unsigned int states,
}
/* compute site log-likelihood and scale if necessary */
- term = log(term);
+ term = log(term) * pattern_weights[i];
if (scaler && scaler[i])
term += scaler[i] * log(PLL_SCALE_THRESHOLD);
- term *= pattern_weights[i];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = term;
@@ -105,7 +103,6 @@ PLL_EXPORT double pll_core_root_loglikelihood_sse(unsigned int states,
}
return logl;
}
-
PLL_EXPORT double pll_core_root_loglikelihood_4x4_sse(unsigned int sites,
unsigned int rate_cats,
const double * clv,
@@ -171,12 +168,10 @@ PLL_EXPORT double pll_core_root_loglikelihood_4x4_sse(unsigned int sites,
}
/* compute site log-likelihood and scale if necessary */
- term = log(term);
+ term = log(term) * pattern_weights[i];
if (scaler && scaler[i])
term += scaler[i] * log(PLL_SCALE_THRESHOLD);
- term *= pattern_weights[i];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = term;
@@ -314,12 +309,10 @@ double pll_core_edge_loglikelihood_ti_sse(unsigned int states,
scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -446,12 +439,10 @@ double pll_core_edge_loglikelihood_ii_sse(unsigned int states,
scale_factors += (child_scaler) ? child_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -608,12 +599,10 @@ double pll_core_edge_loglikelihood_ii_4x4_sse(unsigned int sites,
scale_factors += (child_scaler) ? child_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
@@ -810,12 +799,10 @@ double pll_core_edge_loglikelihood_ti_4x4_sse(unsigned int sites,
scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
/* compute site log-likelihood and scale if necessary */
- site_lk = log(terma);
+ site_lk = log(terma) * pattern_weights[n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
- site_lk *= pattern_weights[n];
-
/* store per-site log-likelihood */
if (persite_lnl)
persite_lnl[m++] = site_lk;
diff --git a/src/core_partials.c b/src/core_partials.c
index 510b326..9451f75 100644
--- a/src/core_partials.c
+++ b/src/core_partials.c
@@ -90,7 +90,7 @@ PLL_EXPORT void pll_core_update_partial_tt(unsigned int states,
unsigned int j,k,n;
const double * offset;
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
if (states == 4)
@@ -126,35 +126,7 @@ PLL_EXPORT void pll_core_update_partial_tt(unsigned int states,
parent_scaler,
left_tipchars,
right_tipchars,
- lookup,
- attrib);
- else
- pll_core_update_partial_tt_avx(states,
- sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_tipchars,
- lookup,
- tipmap_size,
- attrib);
-
- return;
- }
- #endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- if (states == 4)
- pll_core_update_partial_tt_4x4_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_tipchars,
- lookup,
- attrib);
+ lookup);
else
pll_core_update_partial_tt_avx(states,
sites,
@@ -164,8 +136,7 @@ PLL_EXPORT void pll_core_update_partial_tt(unsigned int states,
left_tipchars,
right_tipchars,
lookup,
- tipmap_size,
- attrib);
+ tipmap_size);
return;
}
@@ -210,7 +181,7 @@ PLL_EXPORT void pll_core_update_partial_ti_4x4(unsigned int sites,
const double * lmat;
const double * rmat;
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
pll_core_update_partial_ti_4x4_sse(sites,
@@ -236,24 +207,7 @@ PLL_EXPORT void pll_core_update_partial_ti_4x4(unsigned int sites,
right_clv,
left_matrix,
right_matrix,
- right_scaler,
- attrib);
- return;
- }
- #endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- pll_core_update_partial_ti_4x4_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_clv,
- left_matrix,
- right_matrix,
- right_scaler,
- attrib);
+ right_scaler);
return;
}
#endif
@@ -317,7 +271,6 @@ PLL_EXPORT void pll_core_update_partial_ti(unsigned int states,
const double * right_matrix,
const unsigned int * right_scaler,
const unsigned int * tipmap,
- unsigned int tipmap_size,
unsigned int attrib)
{
int scaling;
@@ -327,7 +280,7 @@ PLL_EXPORT void pll_core_update_partial_ti(unsigned int states,
const double * lmat;
const double * rmat;
-#ifdef HAVE_SSE3
+#ifdef HAVE_SSE
if ((attrib & PLL_ATTRIB_ARCH_SSE))
{
if (states == 4)
@@ -351,46 +304,35 @@ PLL_EXPORT void pll_core_update_partial_ti(unsigned int states,
left_matrix,
right_matrix,
right_scaler,
- tipmap,
- tipmap_size);
+ tipmap);
return;
}
#endif
#ifdef HAVE_AVX
if ((attrib & PLL_ATTRIB_ARCH_AVX))
{
- pll_core_update_partial_ti_avx(states,
- sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_clv,
- left_matrix,
- right_matrix,
- right_scaler,
- tipmap,
- tipmap_size,
- attrib);
- return;
- }
-#endif
-#ifdef HAVE_AVX2
- if ((attrib & PLL_ATTRIB_ARCH_AVX2))
- {
- pll_core_update_partial_ti_avx(states,
- sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_clv,
- left_matrix,
- right_matrix,
- right_scaler,
- tipmap,
- tipmap_size,
- attrib);
+ if (states == 4)
+ pll_core_update_partial_ti_4x4_avx(sites,
+ rate_cats,
+ parent_clv,
+ parent_scaler,
+ left_tipchars,
+ right_clv,
+ left_matrix,
+ right_matrix,
+ right_scaler);
+ else
+ pll_core_update_partial_ti_avx(states,
+ sites,
+ rate_cats,
+ parent_clv,
+ parent_scaler,
+ left_tipchars,
+ right_clv,
+ left_matrix,
+ right_matrix,
+ right_scaler,
+ tipmap);
return;
}
#endif
@@ -479,7 +421,7 @@ PLL_EXPORT void pll_core_update_partial_ii(unsigned int states,
unsigned int span = states * rate_cats;
-#ifdef HAVE_SSE3
+#ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
pll_core_update_partial_ii_sse(states,
@@ -509,26 +451,7 @@ PLL_EXPORT void pll_core_update_partial_ii(unsigned int states,
left_matrix,
right_matrix,
left_scaler,
- right_scaler,
- attrib);
- return;
- }
-#endif
-#ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- pll_core_update_partial_ii_avx2(states,
- sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_clv,
- right_clv,
- left_matrix,
- right_matrix,
- left_scaler,
- right_scaler,
- attrib);
+ right_scaler);
return;
}
#endif
@@ -648,7 +571,7 @@ PLL_EXPORT void pll_core_create_lookup(unsigned int states,
unsigned int attrib)
{
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
if (states == 4)
@@ -686,25 +609,6 @@ PLL_EXPORT void pll_core_create_lookup(unsigned int states,
return;
}
#endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- if (states == 4)
- pll_core_create_lookup_4x4_avx(rate_cats,
- lookup,
- left_matrix,
- right_matrix);
- else
- pll_core_create_lookup_avx(states,
- rate_cats,
- lookup,
- left_matrix,
- right_matrix,
- tipmap,
- tipmap_size);
- return;
- }
- #endif
if (states == 4)
{
pll_core_create_lookup_4x4(rate_cats,
diff --git a/src/core_partials_avx.c b/src/core_partials_avx.c
index 486189d..fde9fb5 100644
--- a/src/core_partials_avx.c
+++ b/src/core_partials_avx.c
@@ -21,7 +21,7 @@
#include "pll.h"
-static void fill_parent_scaler(unsigned int scaler_size,
+static void fill_parent_scaler(unsigned int sites,
unsigned int * parent_scaler,
const unsigned int * left_scaler,
const unsigned int * right_scaler)
@@ -29,19 +29,19 @@ static void fill_parent_scaler(unsigned int scaler_size,
unsigned int i;
if (!left_scaler && !right_scaler)
- memset(parent_scaler, 0, sizeof(unsigned int) * scaler_size);
+ memset(parent_scaler, 0, sizeof(unsigned int) * sites);
else if (left_scaler && right_scaler)
{
- memcpy(parent_scaler, left_scaler, sizeof(unsigned int) * scaler_size);
- for (i = 0; i < scaler_size; ++i)
+ memcpy(parent_scaler, left_scaler, sizeof(unsigned int) * sites);
+ for (i = 0; i < sites; ++i)
parent_scaler[i] += right_scaler[i];
}
else
{
if (left_scaler)
- memcpy(parent_scaler, left_scaler, sizeof(unsigned int) * scaler_size);
+ memcpy(parent_scaler, left_scaler, sizeof(unsigned int) * sites);
else
- memcpy(parent_scaler, right_scaler, sizeof(unsigned int) * scaler_size);
+ memcpy(parent_scaler, right_scaler, sizeof(unsigned int) * sites);
}
}
@@ -62,17 +62,6 @@ PLL_EXPORT void pll_core_create_lookup_avx(unsigned int states,
return;
}
- if (states == 20)
- {
- pll_core_create_lookup_20x20_avx(rate_cats,
- ttlookup,
- left_matrix,
- right_matrix,
- tipmap,
- tipmap_size);
- return;
- }
-
unsigned int i,j,k,n,m;
unsigned int states_padded = (states+3) & 0xFFFFFFFC;
unsigned int maxstates = tipmap_size;
@@ -143,122 +132,6 @@ PLL_EXPORT void pll_core_create_lookup_avx(unsigned int states,
}
}
-PLL_EXPORT void pll_core_create_lookup_20x20_avx(unsigned int rate_cats,
- double * ttlookup,
- const double * left_matrix,
- const double * right_matrix,
- unsigned int * tipmap,
- unsigned int tipmap_size)
-{
- unsigned int i,j,k,n,m;
- unsigned int states = 20;
- unsigned int states_padded = 20;
- unsigned int maxstates = tipmap_size;
-
- unsigned int log2_maxstates = (unsigned int)ceil(log2(maxstates));
- unsigned int span_padded = states_padded*rate_cats;
-
- /* precompute first the entries that contain only one 1 */
- double terml = 0;
- double termr = 0;
-
- double * lookupl = pll_aligned_alloc(span_padded*maxstates*sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- double * lookupr = pll_aligned_alloc(span_padded*maxstates*sizeof(double),
- PLL_ALIGNMENT_AVX);
-
- const double * lmat;
- const double * rmat;
- double * lookup;
- double * ll = lookupl;
- double * lr = lookupr;
-
- for (j = 0; j < maxstates; ++j)
- {
- lmat = left_matrix;
- rmat = right_matrix;
-
- unsigned int state = tipmap[j];
-
- int ss = __builtin_popcount(state) == 1 ? __builtin_ctz(state) : -1;
-
- for (n = 0; n < rate_cats; ++n)
- {
- for (i = 0; i < states; ++i)
- {
- if (ss != -1)
- {
- /* special case for non-ambiguous states */
- terml = lmat[ss];
- termr = rmat[ss];
- }
- else
- {
- terml = 0;
- termr = 0;
- for (m = 0; m < states; ++m)
- {
- if ((state>>m) & 1)
- {
- terml += lmat[m];
- termr += rmat[m];
- }
- }
- }
-
- lmat += states_padded;
- rmat += states_padded;
-
- ll[i] = terml;
- lr[i] = termr;
- }
-
- ll += states_padded;
- lr += states_padded;
- }
- }
-
- assert(ll == lookupl + maxstates * span_padded);
- assert(lr == lookupr + maxstates * span_padded);
-
- /* go through all pairs j,k of states for the two tips; i is the inner
- node state */
- for (j = 0; j < maxstates; ++j)
- {
- for (k = 0; k < maxstates; ++k)
- {
- /* find offset of state-pair in the precomputation table */
- lookup = ttlookup;
- lookup += ((j << log2_maxstates) + k)*span_padded;
-
- ll = lookupl + j * span_padded;
- lr = lookupr + k * span_padded;
-
- /* precompute the likelihood for each state and each rate */
- for (n = 0; n < rate_cats; ++n)
- {
- for (i = 0; i < states; i += 4)
- {
- __m256d v_terml = _mm256_load_pd(ll+i);
- __m256d v_termr = _mm256_load_pd(lr+i);
-
- __m256d v_prod = _mm256_mul_pd(v_terml,v_termr);
-
- _mm256_store_pd(lookup+i, v_prod);
- }
-
- lookup += states_padded;
- ll += states_padded;
- lr += states_padded;
- }
- }
- }
-
- pll_aligned_free(lookupl);
- pll_aligned_free(lookupr);
-}
-
PLL_EXPORT void pll_core_create_lookup_4x4_avx(unsigned int rate_cats,
double * lookup,
const double * left_matrix,
@@ -372,14 +245,11 @@ PLL_EXPORT void pll_core_update_partial_ii_4x4_avx(unsigned int sites,
const double * left_matrix,
const double * right_matrix,
const unsigned int * left_scaler,
- const unsigned int * right_scaler,
- unsigned int attrib)
+ const unsigned int * right_scaler)
{
unsigned int states = 4;
unsigned int n,k,i;
- unsigned int scale_mode; /* 0 = none, 1 = per-site, 2 = per-rate */
- unsigned int scale_mask;
- unsigned int init_mask;
+ unsigned int scaling;
const double * lmat;
const double * rmat;
@@ -389,29 +259,15 @@ PLL_EXPORT void pll_core_update_partial_ii_4x4_avx(unsigned int sites,
unsigned int span = states * rate_cats;
- if (!parent_scaler)
- {
- /* scaling disabled / not required */
- scale_mode = init_mask = 0;
- }
- else
- {
- /* determine the scaling mode and init the vars accordingly */
- scale_mode = (attrib & PLL_ATTRIB_RATE_SCALERS) ? 2 : 1;
- init_mask = (scale_mode == 1) ? 0xF : 0;
- const size_t scaler_size = (scale_mode == 2) ? sites * rate_cats : sites;
- /* add up the scale vector of the two children if available */
- fill_parent_scaler(scaler_size, parent_scaler, left_scaler, right_scaler);
- }
-
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
+ /* add up the scale vector of the two children if available */
+ if (parent_scaler)
+ fill_parent_scaler(sites, parent_scaler, left_scaler, right_scaler);
for (n = 0; n < sites; ++n)
{
lmat = left_matrix;
rmat = right_matrix;
- scale_mask = init_mask;
+ scaling = (parent_scaler) ? 1 : 0;
for (k = 0; k < rate_cats; ++k)
{
@@ -485,34 +341,24 @@ PLL_EXPORT void pll_core_update_partial_ii_4x4_avx(unsigned int sites,
/* compute x*y */
xmm0 = _mm256_mul_pd(xmm4,ymm4);
- /* check if scaling is needed for the current rate category */
- __m256d v_cmp = _mm256_cmp_pd(xmm0, v_scale_threshold, _CMP_LT_OS);
- const unsigned int rate_mask = _mm256_movemask_pd(v_cmp);
-
- if (scale_mode == 2)
- {
- /* PER-RATE SCALING: if *all* entries of the *rate* CLV were below
- * the threshold then scale (all) entries by PLL_SCALE_FACTOR */
- if (rate_mask == 0xF)
- {
- xmm0 = _mm256_mul_pd(xmm0,v_scale_factor);
- parent_scaler[n*rate_cats + k] += 1;
- }
- }
- else
- scale_mask = scale_mask & rate_mask;
-
_mm256_store_pd(parent_clv, xmm0);
+ for (i = 0; i < states; ++i)
+ scaling = scaling && (parent_clv[i] < PLL_SCALE_THRESHOLD);
+
parent_clv += states;
left_clv += states;
right_clv += states;
}
-
- /* PER-SITE SCALING: if *all* entries of the *site* CLV were below
- * the threshold then scale (all) entries by PLL_SCALE_FACTOR */
- if (scale_mask == 0xF)
+ /* if *all* entries of the site CLV were below the threshold then scale
+ (all) entries by PLL_SCALE_FACTOR */
+ if (scaling)
{
+ __m256d v_scale_factor = _mm256_set_pd(PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR);
+
parent_clv -= span;
for (i = 0; i < span; i += 4)
{
@@ -534,8 +380,7 @@ PLL_EXPORT void pll_core_update_partial_tt_avx(unsigned int states,
const unsigned char * left_tipchars,
const unsigned char * right_tipchars,
const double * lookup,
- unsigned int tipstates_count,
- unsigned int attrib)
+ unsigned int tipstates_count)
{
unsigned int j,k,n;
unsigned int log2_maxstates = (unsigned int)ceil(log2(tipstates_count));
@@ -551,8 +396,7 @@ PLL_EXPORT void pll_core_update_partial_tt_avx(unsigned int states,
parent_scaler,
left_tipchars,
right_tipchars,
- lookup,
- attrib);
+ lookup);
return;
}
@@ -579,19 +423,15 @@ PLL_EXPORT void pll_core_update_partial_tt_4x4_avx(unsigned int sites,
unsigned int * parent_scaler,
const unsigned char * left_tipchars,
const unsigned char * right_tipchars,
- const double * lookup,
- unsigned int attrib)
+ const double * lookup)
{
unsigned int j,k,n;
unsigned int states = 4;
unsigned int span = states*rate_cats;
const double * offset;
- size_t scaler_size = (attrib & PLL_ATTRIB_RATE_SCALERS) ?
- sites*rate_cats : sites;
-
if (parent_scaler)
- memset(parent_scaler, 0, sizeof(unsigned int) * scaler_size);
+ memset(parent_scaler, 0, sizeof(unsigned int) * sites);
for (n = 0; n < sites; ++n)
{
@@ -601,12 +441,7 @@ PLL_EXPORT void pll_core_update_partial_tt_4x4_avx(unsigned int sites,
offset = lookup;
offset += ((j << 4) + k)*span;
- // memcpy(parent_clv, offset, span*sizeof(double));
- for (k = 0; k < span; k += 4)
- {
- __m256d v_clv = _mm256_load_pd(offset + k);
- _mm256_store_pd(parent_clv + k, v_clv);
- }
+ memcpy(parent_clv, offset, span*sizeof(double));
parent_clv += span;
}
@@ -622,9 +457,7 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
const double * left_matrix,
const double * right_matrix,
const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- unsigned int attrib)
+ const unsigned int * tipmap)
{
unsigned int i,j,k,n;
unsigned int scaling;
@@ -637,7 +470,7 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
unsigned int lstate;
- /* dedicated functions for 4x4 matrices (DNA) */
+ /* dedicated functions for 4x4 matrices */
if (states == 4)
{
pll_core_update_partial_ti_4x4_avx(sites,
@@ -648,25 +481,7 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
right_clv,
left_matrix,
right_matrix,
- right_scaler,
- attrib);
- return;
- }
-
- /* dedicated functions for 20x20 matrices (AA) */
- if (states == 20)
- {
- pll_core_update_partial_ti_20x20_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_clv,
- left_matrix,
- right_matrix,
- right_scaler,
- tipmap,
- tipmap_size);
+ right_scaler);
return;
}
@@ -677,7 +492,6 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
size_t displacement = (states_padded - states) * (states_padded);
__m256i mask;
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
/* compute CLV */
for (n = 0; n < sites; ++n)
@@ -685,7 +499,7 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
lmat = left_matrix;
rmat = right_matrix;
- scaling = (parent_scaler) ? 0xF : 0;
+ scaling = (parent_scaler) ? 1 : 0;
lstate = tipmap[left_tipchars[n]];
@@ -733,52 +547,48 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
((lstate >> (lsb+1)) & 1) ? ~0 : 0,
((lstate >> (lsb+0)) & 1) ? ~0 : 0);
- if ((lstate >> lsb) & 0b1111)
- {
- v_mat = _mm256_maskload_pd(lm0,mask);
- v_terma0 = _mm256_add_pd(v_terma0,v_mat);
-
- v_mat = _mm256_maskload_pd(lm1,mask);
- v_terma1 = _mm256_add_pd(v_terma1,v_mat);
-
- v_mat = _mm256_maskload_pd(lm2,mask);
- v_terma2 = _mm256_add_pd(v_terma2,v_mat);
-
- v_mat = _mm256_maskload_pd(lm3,mask);
- v_terma3 = _mm256_add_pd(v_terma3,v_mat);
- }
-
lsb += 4;
- lm0 += 4;
- lm1 += 4;
- lm2 += 4;
- lm3 += 4;
-
v_rclv = _mm256_load_pd(right_clv+j);
/* row 0 */
+ v_mat = _mm256_maskload_pd(lm0,mask);
+ v_terma0 = _mm256_add_pd(v_terma0,v_mat);
+
v_mat = _mm256_load_pd(rm0);
v_termb0 = _mm256_add_pd(v_termb0,
_mm256_mul_pd(v_mat,v_rclv));
+ lm0 += 4;
rm0 += 4;
/* row 1 */
+ v_mat = _mm256_maskload_pd(lm1,mask);
+ v_terma1 = _mm256_add_pd(v_terma1,v_mat);
+
v_mat = _mm256_load_pd(rm1);
v_termb1 = _mm256_add_pd(v_termb1,
_mm256_mul_pd(v_mat,v_rclv));
+ lm1 += 4;
rm1 += 4;
/* row 2 */
+ v_mat = _mm256_maskload_pd(lm2,mask);
+ v_terma2 = _mm256_add_pd(v_terma2,v_mat);
+
v_mat = _mm256_load_pd(rm2);
v_termb2 = _mm256_add_pd(v_termb2,
_mm256_mul_pd(v_mat,v_rclv));
+ lm2 += 4;
rm2 += 4;
/* row 3 */
+ v_mat = _mm256_maskload_pd(lm3,mask);
+ v_terma3 = _mm256_add_pd(v_terma3,v_mat);
+
v_mat = _mm256_load_pd(rm3);
v_termb3 = _mm256_add_pd(v_termb3,
_mm256_mul_pd(v_mat,v_rclv));
+ lm3 += 4;
rm3 += 4;
}
@@ -820,10 +630,6 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
__m256d v_prod = _mm256_mul_pd(v_terma_sum,v_termb_sum);
- /* check for scaling */
- __m256d v_cmp = _mm256_cmp_pd(v_prod, v_scale_threshold, _CMP_LT_OS);
- scaling = scaling & _mm256_movemask_pd(v_cmp);
-
_mm256_store_pd(parent_clv+i, v_prod);
}
@@ -834,14 +640,20 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
lmat -= displacement;
rmat -= displacement;
+ for (j = 0; j < states; ++j)
+ scaling = scaling && (parent_clv[j] < PLL_SCALE_THRESHOLD);
+
parent_clv += states_padded;
right_clv += states_padded;
}
/* if *all* entries of the site CLV were below the threshold then scale
(all) entries by PLL_SCALE_FACTOR */
- if (scaling == 0xF)
+ if (scaling)
{
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
+ __m256d v_scale_factor = _mm256_set_pd(PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR);
parent_clv -= span_padded;
for (i = 0; i < span_padded; i += 4)
@@ -864,16 +676,12 @@ PLL_EXPORT void pll_core_update_partial_ti_4x4_avx(unsigned int sites,
const double * right_clv,
const double * left_matrix,
const double * right_matrix,
- const unsigned int * right_scaler,
- unsigned int attrib)
+ const unsigned int * right_scaler)
{
unsigned int states = 4;
+ unsigned int scaling;
unsigned int i,k,n;
- unsigned int scale_mode; /* 0 = none, 1 = per-site, 2 = per-rate */
- unsigned int scale_mask;
- unsigned int init_mask;
-
const double * lmat;
const double * rmat;
@@ -943,31 +751,16 @@ PLL_EXPORT void pll_core_update_partial_ti_4x4_avx(unsigned int sites,
}
}
- if (!parent_scaler)
- {
- /* scaling disabled / not required */
- scale_mode = init_mask = 0;
- }
- else
- {
- /* determine the scaling mode and init the vars accordingly */
- scale_mode = (attrib & PLL_ATTRIB_RATE_SCALERS) ? 2 : 1;
- init_mask = (scale_mode == 1) ? 0xF : 0;
- const size_t scaler_size = (scale_mode == 2) ? sites * rate_cats : sites;
-
- /* update the parent scaler with the scaler of the right child */
- fill_parent_scaler(scaler_size, parent_scaler, NULL, right_scaler);
- }
-
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
+ /* update the parent scaler with the scaler of the right child */
+ if (parent_scaler)
+ fill_parent_scaler(sites, parent_scaler, NULL, right_scaler);
/* iterate over sites and compute CLV entries */
for (n = 0; n < sites; ++n)
{
rmat = right_matrix;
- scale_mask = init_mask;
+ scaling = (parent_scaler) ? 1 : 0;
lstate = left_tipchar[n];
@@ -1012,245 +805,23 @@ PLL_EXPORT void pll_core_update_partial_ti_4x4_avx(unsigned int sites,
/* compute x*y */
xmm0 = _mm256_mul_pd(xmm4,ymm4);
- /* check if scaling is needed for the current rate category */
- __m256d v_cmp = _mm256_cmp_pd(xmm0, v_scale_threshold, _CMP_LT_OS);
- const unsigned int rate_mask = _mm256_movemask_pd(v_cmp);
-
- if (scale_mode == 2)
- {
- /* PER-RATE SCALING: if *all* entries of the *rate* CLV were below
- * the threshold then scale (all) entries by PLL_SCALE_FACTOR */
- if (rate_mask == 0xF)
- {
- xmm0 = _mm256_mul_pd(xmm0, v_scale_factor);
- parent_scaler[n*rate_cats + k] += 1;
- }
- }
- else
- scale_mask = scale_mask & rate_mask;
-
_mm256_store_pd(parent_clv, xmm0);
+ for (i = 0; i < states; ++i)
+ scaling = scaling && (parent_clv[i] < PLL_SCALE_THRESHOLD);
+
parent_clv += states;
right_clv += states;
loffset += 4;
}
-
- /* PER-SITE SCALING: if *all* entries of the *site* CLV were below
- * the threshold then scale (all) entries by PLL_SCALE_FACTOR */
- if (scale_mask == 0xF)
- {
- parent_clv -= span;
- for (i = 0; i < span; i += 4)
- {
- __m256d v_prod = _mm256_load_pd(parent_clv + i);
- v_prod = _mm256_mul_pd(v_prod, v_scale_factor);
- _mm256_store_pd(parent_clv + i, v_prod);
- }
- parent_clv += span;
- parent_scaler[n] += 1;
- }
- }
- pll_aligned_free(lookup);
-}
-
-PLL_EXPORT void pll_core_update_partial_ti_20x20_avx(unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const unsigned char * left_tipchar,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size)
-{
- unsigned int states = 20;
- unsigned int states_padded = states;
- unsigned int maxstates = tipmap_size;
- unsigned int scaling;
- unsigned int i,j,k,n,m;
-
- const double * lmat;
- const double * rmat;
-
- unsigned int span = states_padded * rate_cats;
- unsigned int lstate;
-
- __m256d xmm0,xmm1,xmm2,xmm3;
-
- /* precompute a lookup table of four values per entry (one for each state),
- for all 16 states (including ambiguities) and for each rate category. */
- double * lookup = pll_aligned_alloc(maxstates*span*sizeof(double),
- PLL_ALIGNMENT_AVX);
- if (!lookup)
- {
- /* TODO: in the highly unlikely event that allocation fails, we should
- resort to a non-lookup-precomputation version of this function,
- available at commit e.g. a4fc873fdc65741e402cdc1c59919375143d97d1 */
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Cannot allocate space for precomputation.");
- return;
- }
-
- double * ptr = lookup;
-
- /* precompute left-side values and store them in lookup table */
- for (j = 0; j < maxstates; ++j)
- {
- lmat = left_matrix;
-
- unsigned int state = tipmap[j];
-
- int ss = __builtin_popcount(state) == 1 ? __builtin_ctz(state) : -1;
-
- for (n = 0; n < rate_cats; ++n)
- {
- for (i = 0; i < states; ++i)
- {
- double terml;
- if (ss != -1)
- {
- /* special case for non-ambiguous states */
- terml = lmat[ss];
- }
- else
- {
- terml = 0;
- for (m = 0; m < states; ++m)
- {
- if ((state>>m) & 1)
- {
- terml += lmat[m];
- }
- }
- }
-
- lmat += states;
-
- ptr[i] = terml;
- }
-
- ptr += states;
- }
- }
-
- /* update the parent scaler with the scaler of the right child */
- if (parent_scaler)
- fill_parent_scaler(sites, parent_scaler, NULL, right_scaler);
-
- size_t displacement = (states_padded - states) * (states_padded);
-
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
-
- /* iterate over sites and compute CLV entries */
- for (n = 0; n < sites; ++n)
- {
- rmat = right_matrix;
-
- scaling = (parent_scaler) ? 0xF : 0;
-
- lstate = (unsigned int) left_tipchar[n];
-
- unsigned int loffset = lstate*span;
-
- for (k = 0; k < rate_cats; ++k)
- {
- /* iterate over quadruples of rows */
- for (i = 0; i < states_padded; i += 4)
- {
-
- __m256d v_termb0 = _mm256_setzero_pd();
- __m256d v_termb1 = _mm256_setzero_pd();
- __m256d v_termb2 = _mm256_setzero_pd();
- __m256d v_termb3 = _mm256_setzero_pd();
-
- __m256d v_mat;
- __m256d v_rclv;
-
- /* point to the four rows of the right matrix */
- const double * rm0 = rmat;
- const double * rm1 = rm0 + states_padded;
- const double * rm2 = rm1 + states_padded;
- const double * rm3 = rm2 + states_padded;
-
- /* iterate over quadruples of columns */
- for (j = 0; j < states_padded; j += 4)
- {
- v_rclv = _mm256_load_pd(right_clv+j);
-
- /* row 0 */
- v_mat = _mm256_load_pd(rm0);
- v_termb0 = _mm256_add_pd(v_termb0,
- _mm256_mul_pd(v_mat,v_rclv));
- rm0 += 4;
-
- /* row 1 */
- v_mat = _mm256_load_pd(rm1);
- v_termb1 = _mm256_add_pd(v_termb1,
- _mm256_mul_pd(v_mat,v_rclv));
- rm1 += 4;
-
- /* row 2 */
- v_mat = _mm256_load_pd(rm2);
- v_termb2 = _mm256_add_pd(v_termb2,
- _mm256_mul_pd(v_mat,v_rclv));
- rm2 += 4;
-
- /* row 3 */
- v_mat = _mm256_load_pd(rm3);
- v_termb3 = _mm256_add_pd(v_termb3,
- _mm256_mul_pd(v_mat,v_rclv));
- rm3 += 4;
- }
-
- /* point pmatrix to the next four rows */
- rmat = rm3;
-
- /* load x from precomputed lookup table */
- __m256d v_terma_sum = _mm256_load_pd(lookup+loffset);
- loffset += 4;
-
- /* compute termb */
- xmm0 = _mm256_unpackhi_pd(v_termb0,v_termb1);
- xmm1 = _mm256_unpacklo_pd(v_termb0,v_termb1);
-
- xmm2 = _mm256_unpackhi_pd(v_termb2,v_termb3);
- xmm3 = _mm256_unpacklo_pd(v_termb2,v_termb3);
-
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
-
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
-
- __m256d v_termb_sum = _mm256_add_pd(xmm2,xmm3);
-
- __m256d v_prod = _mm256_mul_pd(v_terma_sum,v_termb_sum);
-
- /* check for scaling */
- __m256d v_cmp = _mm256_cmp_pd(v_prod, v_scale_threshold, _CMP_LT_OS);
- scaling = scaling & _mm256_movemask_pd(v_cmp);
-
- _mm256_store_pd(parent_clv+i, v_prod);
- }
-
- /* reset pointers to point to the start of the next p-matrix, as the
- vectorization assumes a square states_padded * states_padded matrix,
- even though the real matrix is states * states_padded */
- rmat -= displacement;
-
- parent_clv += states_padded;
- right_clv += states_padded;
- }
-
/* if *all* entries of the site CLV were below the threshold then scale
(all) entries by PLL_SCALE_FACTOR */
- if (scaling == 0xF)
+ if (scaling)
{
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
+ __m256d v_scale_factor = _mm256_set_pd(PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR);
parent_clv -= span;
for (i = 0; i < span; i += 4)
@@ -1276,8 +847,7 @@ PLL_EXPORT void pll_core_update_partial_ii_avx(unsigned int states,
const double * left_matrix,
const double * right_matrix,
const unsigned int * left_scaler,
- const unsigned int * right_scaler,
- unsigned int attrib)
+ const unsigned int * right_scaler)
{
unsigned int i,j,k,n;
unsigned int scaling;
@@ -1300,8 +870,7 @@ PLL_EXPORT void pll_core_update_partial_ii_avx(unsigned int states,
left_matrix,
right_matrix,
left_scaler,
- right_scaler,
- attrib);
+ right_scaler);
return;
}
@@ -1311,15 +880,12 @@ PLL_EXPORT void pll_core_update_partial_ii_avx(unsigned int states,
size_t displacement = (states_padded - states) * (states_padded);
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
-
/* compute CLV */
for (n = 0; n < sites; ++n)
{
lmat = left_matrix;
rmat = right_matrix;
- scaling = (parent_scaler) ? 0xF : 0;
-
+ scaling = (parent_scaler) ? 1 : 0;
for (k = 0; k < rate_cats; ++k)
{
/* iterate over quadruples of rows */
@@ -1436,11 +1002,8 @@ PLL_EXPORT void pll_core_update_partial_ii_avx(unsigned int states,
__m256d v_prod = _mm256_mul_pd(v_terma_sum,v_termb_sum);
- /* check for scaling */
- __m256d v_cmp = _mm256_cmp_pd(v_prod, v_scale_threshold, _CMP_LT_OS);
- scaling = scaling & _mm256_movemask_pd(v_cmp);
-
_mm256_store_pd(parent_clv+i, v_prod);
+
}
/* reset pointers to point to the start of the next p-matrix, as the
@@ -1449,16 +1012,21 @@ PLL_EXPORT void pll_core_update_partial_ii_avx(unsigned int states,
lmat -= displacement;
rmat -= displacement;
+ for (j = 0; j < states; ++j)
+ scaling = scaling && (parent_clv[j] < PLL_SCALE_THRESHOLD);
+
parent_clv += states_padded;
left_clv += states_padded;
right_clv += states_padded;
}
-
/* if *all* entries of the site CLV were below the threshold then scale
(all) entries by PLL_SCALE_FACTOR */
- if (scaling == 0xF)
+ if (scaling)
{
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
+ __m256d v_scale_factor = _mm256_set_pd(PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR,
+ PLL_SCALE_FACTOR);
parent_clv -= span_padded;
for (i = 0; i < span_padded; i += 4)
diff --git a/src/core_partials_avx2.c b/src/core_partials_avx2.c
deleted file mode 100644
index a16824b..0000000
--- a/src/core_partials_avx2.c
+++ /dev/null
@@ -1,702 +0,0 @@
-/*
- Copyright (C) 2016 Tomas Flouri, Kassian Kobert
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-static void fill_parent_scaler(unsigned int sites,
- unsigned int * parent_scaler,
- const unsigned int * left_scaler,
- const unsigned int * right_scaler)
-{
- unsigned int i;
-
- if (!left_scaler && !right_scaler)
- memset(parent_scaler, 0, sizeof(unsigned int) * sites);
- else if (left_scaler && right_scaler)
- {
- memcpy(parent_scaler, left_scaler, sizeof(unsigned int) * sites);
- for (i = 0; i < sites; ++i)
- parent_scaler[i] += right_scaler[i];
- }
- else
- {
- if (left_scaler)
- memcpy(parent_scaler, left_scaler, sizeof(unsigned int) * sites);
- else
- memcpy(parent_scaler, right_scaler, sizeof(unsigned int) * sites);
- }
-}
-
-
-PLL_EXPORT void pll_core_update_partial_ti_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const unsigned char * left_tipchars,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- unsigned int attrib)
-{
- unsigned int i,j,k,n;
- unsigned int scaling;
-
- const double * lmat;
- const double * rmat;
-
- unsigned int states_padded = (states+3) & 0xFFFFFFFC;
- unsigned int span_padded = states_padded * rate_cats;
-
- unsigned int lstate;
-
- /* dedicated functions for 4x4 matrices (DNA) */
- if (states == 4)
- {
- /* no AVX2 kernel so far; rollback to AVX */
- pll_core_update_partial_ti_4x4_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_clv,
- left_matrix,
- right_matrix,
- right_scaler,
- attrib);
- return;
- }
-
- /* dedicated functions for 20x20 matrices (AA) */
- if (states == 20)
- {
- pll_core_update_partial_ti_20x20_avx2(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_tipchars,
- right_clv,
- left_matrix,
- right_matrix,
- right_scaler,
- tipmap,
- tipmap_size);
- return;
- }
-
- /* add up the scale vector of the two children if available */
- if (parent_scaler)
- fill_parent_scaler(sites, parent_scaler, NULL, right_scaler);
-
- size_t displacement = (states_padded - states) * (states_padded);
-
- __m256i mask;
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
-
- /* compute CLV */
- for (n = 0; n < sites; ++n)
- {
- lmat = left_matrix;
- rmat = right_matrix;
-
- scaling = (parent_scaler) ? 0xF : 0;
-
- lstate = tipmap[left_tipchars[n]];
-
- for (k = 0; k < rate_cats; ++k)
- {
- /* iterate over quadruples of rows */
- for (i = 0; i < states_padded; i += 4)
- {
-
- __m256d v_terma0 = _mm256_setzero_pd();
- __m256d v_termb0 = _mm256_setzero_pd();
- __m256d v_terma1 = _mm256_setzero_pd();
- __m256d v_termb1 = _mm256_setzero_pd();
- __m256d v_terma2 = _mm256_setzero_pd();
- __m256d v_termb2 = _mm256_setzero_pd();
- __m256d v_terma3 = _mm256_setzero_pd();
- __m256d v_termb3 = _mm256_setzero_pd();
-
- __m256d v_mat;
- __m256d v_rclv;
-
- /* point to the four rows of the left matrix */
- const double * lm0 = lmat;
- const double * lm1 = lm0 + states_padded;
- const double * lm2 = lm1 + states_padded;
- const double * lm3 = lm2 + states_padded;
-
- /* point to the four rows of the right matrix */
- const double * rm0 = rmat;
- const double * rm1 = rm0 + states_padded;
- const double * rm2 = rm1 + states_padded;
- const double * rm3 = rm2 + states_padded;
-
- /* set position of least significant bit in character state */
- register int lsb = 0;
-
- /* iterate over quadruples of columns */
- for (j = 0; j < states_padded; j += 4)
- {
-
- /* set mask */
- mask = _mm256_set_epi64x(
- ((lstate >> (lsb+3)) & 1) ? ~0 : 0,
- ((lstate >> (lsb+2)) & 1) ? ~0 : 0,
- ((lstate >> (lsb+1)) & 1) ? ~0 : 0,
- ((lstate >> (lsb+0)) & 1) ? ~0 : 0);
-
- if ((lstate >> lsb) & 0b1111)
- {
- v_mat = _mm256_maskload_pd(lm0,mask);
- v_terma0 = _mm256_add_pd(v_terma0,v_mat);
-
- v_mat = _mm256_maskload_pd(lm1,mask);
- v_terma1 = _mm256_add_pd(v_terma1,v_mat);
-
- v_mat = _mm256_maskload_pd(lm2,mask);
- v_terma2 = _mm256_add_pd(v_terma2,v_mat);
-
- v_mat = _mm256_maskload_pd(lm3,mask);
- v_terma3 = _mm256_add_pd(v_terma3,v_mat);
- }
-
- lsb += 4;
-
- lm0 += 4;
- lm1 += 4;
- lm2 += 4;
- lm3 += 4;
-
- v_rclv = _mm256_load_pd(right_clv+j);
-
- /* row 0 */
- v_mat = _mm256_load_pd(rm0);
- v_termb0 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb0);
- rm0 += 4;
-
- /* row 1 */
- v_mat = _mm256_load_pd(rm1);
- v_termb1 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb1);
- rm1 += 4;
-
- /* row 2 */
- v_mat = _mm256_load_pd(rm2);
- v_termb2 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb2);
- rm2 += 4;
-
- /* row 3 */
- v_mat = _mm256_load_pd(rm3);
- v_termb3 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb3);
- rm3 += 4;
- }
-
- /* point pmatrix to the next four rows */
- lmat = lm3;
- rmat = rm3;
-
- __m256d xmm0 = _mm256_unpackhi_pd(v_terma0,v_terma1);
- __m256d xmm1 = _mm256_unpacklo_pd(v_terma0,v_terma1);
-
- __m256d xmm2 = _mm256_unpackhi_pd(v_terma2,v_terma3);
- __m256d xmm3 = _mm256_unpacklo_pd(v_terma2,v_terma3);
-
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
-
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
-
- __m256d v_terma_sum = _mm256_add_pd(xmm2,xmm3);
-
- /* compute termb */
-
- xmm0 = _mm256_unpackhi_pd(v_termb0,v_termb1);
- xmm1 = _mm256_unpacklo_pd(v_termb0,v_termb1);
-
- xmm2 = _mm256_unpackhi_pd(v_termb2,v_termb3);
- xmm3 = _mm256_unpacklo_pd(v_termb2,v_termb3);
-
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
-
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
-
- __m256d v_termb_sum = _mm256_add_pd(xmm2,xmm3);
-
- __m256d v_prod = _mm256_mul_pd(v_terma_sum,v_termb_sum);
-
- /* check for scaling */
- __m256d v_cmp = _mm256_cmp_pd(v_prod, v_scale_threshold, _CMP_LT_OS);
- scaling = scaling & _mm256_movemask_pd(v_cmp);
-
- _mm256_store_pd(parent_clv+i, v_prod);
-
- }
-
- /* reset pointers to point to the start of the next p-matrix, as the
- vectorization assumes a square states_padded * states_padded matrix,
- even though the real matrix is states * states_padded */
- lmat -= displacement;
- rmat -= displacement;
-
- parent_clv += states_padded;
- right_clv += states_padded;
- }
- /* if *all* entries of the site CLV were below the threshold then scale
- (all) entries by PLL_SCALE_FACTOR */
- if (scaling == 0xF)
- {
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
-
- parent_clv -= span_padded;
- for (i = 0; i < span_padded; i += 4)
- {
- __m256d v_prod = _mm256_load_pd(parent_clv + i);
- v_prod = _mm256_mul_pd(v_prod,v_scale_factor);
- _mm256_store_pd(parent_clv + i, v_prod);
- }
- parent_clv += span_padded;
- parent_scaler[n] += 1;
- }
- }
-}
-
-PLL_EXPORT
-void pll_core_update_partial_ti_20x20_avx2(unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const unsigned char * left_tipchar,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size)
-{
- unsigned int states = 20;
- unsigned int states_padded = states;
- unsigned int maxstates = tipmap_size;
- unsigned int scaling;
- unsigned int i,j,k,n,m;
-
- const double * lmat;
- const double * rmat;
-
- unsigned int span = states_padded * rate_cats;
- unsigned int lstate;
-
- __m256d xmm0,xmm1,xmm2,xmm3;
-
- /* precompute a lookup table of four values per entry (one for each state),
- for all 16 states (including ambiguities) and for each rate category. */
- double * lookup = pll_aligned_alloc(maxstates*span*sizeof(double),
- PLL_ALIGNMENT_AVX);
- if (!lookup)
- {
- /* TODO: in the highly unlikely event that allocation fails, we should
- resort to a non-lookup-precomputation version of this function,
- available at commit e.g. a4fc873fdc65741e402cdc1c59919375143d97d1 */
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Cannot allocate space for precomputation.");
- return;
- }
-
- double * ptr = lookup;
-
- /* precompute left-side values and store them in lookup table */
- for (j = 0; j < maxstates; ++j)
- {
- lmat = left_matrix;
-
- unsigned int state = tipmap[j];
-
- int ss = __builtin_popcount(state) == 1 ? __builtin_ctz(state) : -1;
-
- for (n = 0; n < rate_cats; ++n)
- {
- for (i = 0; i < states; ++i)
- {
- double terml;
- if (ss != -1)
- {
- /* special case for non-ambiguous states */
- terml = lmat[ss];
- }
- else
- {
- terml = 0;
- for (m = 0; m < states; ++m)
- {
- if ((state>>m) & 1)
- {
- terml += lmat[m];
- }
- }
- }
-
- lmat += states;
-
- ptr[i] = terml;
- }
-
- ptr += states;
- }
- }
-
- /* update the parent scaler with the scaler of the right child */
- if (parent_scaler)
- fill_parent_scaler(sites, parent_scaler, NULL, right_scaler);
-
- size_t displacement = (states_padded - states) * (states_padded);
-
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
-
- /* iterate over sites and compute CLV entries */
- for (n = 0; n < sites; ++n)
- {
- rmat = right_matrix;
-
- scaling = (parent_scaler) ? 0xF : 0;
-
- lstate = (unsigned int) left_tipchar[n];
-
- unsigned int loffset = lstate*span;
-
- for (k = 0; k < rate_cats; ++k)
- {
- /* iterate over quadruples of rows */
- for (i = 0; i < states_padded; i += 4)
- {
-
- __m256d v_termb0 = _mm256_setzero_pd();
- __m256d v_termb1 = _mm256_setzero_pd();
- __m256d v_termb2 = _mm256_setzero_pd();
- __m256d v_termb3 = _mm256_setzero_pd();
-
- __m256d v_mat;
- __m256d v_rclv;
-
- /* point to the four rows of the right matrix */
- const double * rm0 = rmat;
- const double * rm1 = rm0 + states_padded;
- const double * rm2 = rm1 + states_padded;
- const double * rm3 = rm2 + states_padded;
-
- /* iterate over quadruples of columns */
- for (j = 0; j < states_padded; j += 4)
- {
- v_rclv = _mm256_load_pd(right_clv+j);
-
- /* row 0 */
- v_mat = _mm256_load_pd(rm0);
- v_termb0 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb0);
- rm0 += 4;
-
- /* row 1 */
- v_mat = _mm256_load_pd(rm1);
- v_termb1 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb1);
- rm1 += 4;
-
- /* row 2 */
- v_mat = _mm256_load_pd(rm2);
- v_termb2 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb2);
- rm2 += 4;
-
- /* row 3 */
- v_mat = _mm256_load_pd(rm3);
- v_termb3 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb3);
- rm3 += 4;
- }
-
- /* point pmatrix to the next four rows */
- rmat = rm3;
-
- /* load x from precomputed lookup table */
- __m256d v_terma_sum = _mm256_load_pd(lookup+loffset);
- loffset += 4;
-
- /* compute termb */
- xmm0 = _mm256_unpackhi_pd(v_termb0,v_termb1);
- xmm1 = _mm256_unpacklo_pd(v_termb0,v_termb1);
-
- xmm2 = _mm256_unpackhi_pd(v_termb2,v_termb3);
- xmm3 = _mm256_unpacklo_pd(v_termb2,v_termb3);
-
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
-
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
-
- __m256d v_termb_sum = _mm256_add_pd(xmm2,xmm3);
-
- __m256d v_prod = _mm256_mul_pd(v_terma_sum,v_termb_sum);
-
- /* check for scaling */
- __m256d v_cmp = _mm256_cmp_pd(v_prod, v_scale_threshold, _CMP_LT_OS);
- scaling = scaling & _mm256_movemask_pd(v_cmp);
-
- _mm256_store_pd(parent_clv+i, v_prod);
- }
-
- /* reset pointers to point to the start of the next p-matrix, as the
- vectorization assumes a square states_padded * states_padded matrix,
- even though the real matrix is states * states_padded */
- rmat -= displacement;
-
- parent_clv += states_padded;
- right_clv += states_padded;
- }
-
- /* if *all* entries of the site CLV were below the threshold then scale
- (all) entries by PLL_SCALE_FACTOR */
- if (scaling == 0xF)
- {
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
-
- parent_clv -= span;
- for (i = 0; i < span; i += 4)
- {
- __m256d v_prod = _mm256_load_pd(parent_clv + i);
- v_prod = _mm256_mul_pd(v_prod,v_scale_factor);
- _mm256_store_pd(parent_clv + i, v_prod);
- }
- parent_clv += span;
- parent_scaler[n] += 1;
- }
- }
- pll_aligned_free(lookup);
-}
-
-PLL_EXPORT void pll_core_update_partial_ii_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const double * left_clv,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * left_scaler,
- const unsigned int * right_scaler,
- unsigned int attrib)
-{
- unsigned int i,j,k,n;
- unsigned int scaling;
-
- const double * lmat;
- const double * rmat;
-
- unsigned int states_padded = (states+3) & 0xFFFFFFFC;
- unsigned int span_padded = states_padded * rate_cats;
-
- /* dedicated functions for 4x4 matrices */
- if (states == 4)
- {
- /* TODO: Implement avx2 4x4 case */
- pll_core_update_partial_ii_4x4_avx(sites,
- rate_cats,
- parent_clv,
- parent_scaler,
- left_clv,
- right_clv,
- left_matrix,
- right_matrix,
- left_scaler,
- right_scaler,
- attrib);
- return;
- }
-
- /* add up the scale vector of the two children if available */
- if (parent_scaler)
- fill_parent_scaler(sites, parent_scaler, left_scaler, right_scaler);
-
- size_t displacement = (states_padded - states) * (states_padded);
-
- __m256d v_scale_threshold = _mm256_set1_pd(PLL_SCALE_THRESHOLD);
-
- /* compute CLV */
- for (n = 0; n < sites; ++n)
- {
- lmat = left_matrix;
- rmat = right_matrix;
- scaling = (parent_scaler) ? 0xF : 0;
-
- for (k = 0; k < rate_cats; ++k)
- {
- /* iterate over quadruples of rows */
- for (i = 0; i < states_padded; i += 4)
- {
-
- __m256d v_terma0 = _mm256_setzero_pd();
- __m256d v_termb0 = _mm256_setzero_pd();
- __m256d v_terma1 = _mm256_setzero_pd();
- __m256d v_termb1 = _mm256_setzero_pd();
- __m256d v_terma2 = _mm256_setzero_pd();
- __m256d v_termb2 = _mm256_setzero_pd();
- __m256d v_terma3 = _mm256_setzero_pd();
- __m256d v_termb3 = _mm256_setzero_pd();
-
- __m256d v_mat;
- __m256d v_lclv;
- __m256d v_rclv;
-
- /* point to the four rows of the left matrix */
- const double * lm0 = lmat;
- const double * lm1 = lm0 + states_padded;
- const double * lm2 = lm1 + states_padded;
- const double * lm3 = lm2 + states_padded;
-
- /* point to the four rows of the right matrix */
- const double * rm0 = rmat;
- const double * rm1 = rm0 + states_padded;
- const double * rm2 = rm1 + states_padded;
- const double * rm3 = rm2 + states_padded;
-
- /* iterate over quadruples of columns */
- for (j = 0; j < states_padded; j += 4)
- {
- v_lclv = _mm256_load_pd(left_clv+j);
- v_rclv = _mm256_load_pd(right_clv+j);
-
- /* row 0 */
- v_mat = _mm256_load_pd(lm0);
- v_terma0 = _mm256_fmadd_pd(v_mat, v_lclv, v_terma0);
-
- v_mat = _mm256_load_pd(rm0);
- v_termb0 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb0);
- lm0 += 4;
- rm0 += 4;
-
- /* row 1 */
- v_mat = _mm256_load_pd(lm1);
- v_terma1 = _mm256_fmadd_pd(v_mat, v_lclv, v_terma1);
-
- v_mat = _mm256_load_pd(rm1);
- v_termb1 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb1);
- lm1 += 4;
- rm1 += 4;
-
- /* row 2 */
- v_mat = _mm256_load_pd(lm2);
- v_terma2 = _mm256_fmadd_pd(v_mat, v_lclv, v_terma2);
-
- v_mat = _mm256_load_pd(rm2);
- v_termb2 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb2);
- lm2 += 4;
- rm2 += 4;
-
- /* row 3 */
- v_mat = _mm256_load_pd(lm3);
- v_terma3 = _mm256_fmadd_pd(v_mat, v_lclv, v_terma3);
-
- v_mat = _mm256_load_pd(rm3);
- v_termb3 = _mm256_fmadd_pd(v_mat, v_rclv, v_termb3);
-
- lm3 += 4;
- rm3 += 4;
- }
-
- /* point pmatrix to the next four rows */
- lmat = lm3;
- rmat = rm3;
-
- __m256d xmm0 = _mm256_unpackhi_pd(v_terma0,v_terma1);
- __m256d xmm1 = _mm256_unpacklo_pd(v_terma0,v_terma1);
-
- __m256d xmm2 = _mm256_unpackhi_pd(v_terma2,v_terma3);
- __m256d xmm3 = _mm256_unpacklo_pd(v_terma2,v_terma3);
-
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
-
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
-
- __m256d v_terma_sum = _mm256_add_pd(xmm2,xmm3);
-
- /* compute termb */
-
- xmm0 = _mm256_unpackhi_pd(v_termb0,v_termb1);
- xmm1 = _mm256_unpacklo_pd(v_termb0,v_termb1);
-
- xmm2 = _mm256_unpackhi_pd(v_termb2,v_termb3);
- xmm3 = _mm256_unpacklo_pd(v_termb2,v_termb3);
-
- xmm0 = _mm256_add_pd(xmm0,xmm1);
- xmm1 = _mm256_add_pd(xmm2,xmm3);
-
- xmm2 = _mm256_permute2f128_pd(xmm0,xmm1, _MM_SHUFFLE(0,2,0,1));
-
- xmm3 = _mm256_blend_pd(xmm0,xmm1,12);
-
- __m256d v_termb_sum = _mm256_add_pd(xmm2,xmm3);
-
- __m256d v_prod = _mm256_mul_pd(v_terma_sum,v_termb_sum);
-
- /* check for scaling */
- __m256d v_cmp = _mm256_cmp_pd(v_prod, v_scale_threshold, _CMP_LT_OS);
- scaling = scaling & _mm256_movemask_pd(v_cmp);
-
- _mm256_store_pd(parent_clv+i, v_prod);
- }
-
- /* reset pointers to point to the start of the next p-matrix, as the
- vectorization assumes a square states_padded * states_padded matrix,
- even though the real matrix is states * states_padded */
- lmat -= displacement;
- rmat -= displacement;
-
- parent_clv += states_padded;
- left_clv += states_padded;
- right_clv += states_padded;
- }
-
- /* if *all* entries of the site CLV were below the threshold then scale
- (all) entries by PLL_SCALE_FACTOR */
- if (scaling == 0xF)
- {
- __m256d v_scale_factor = _mm256_set1_pd(PLL_SCALE_FACTOR);
-
- parent_clv -= span_padded;
- for (i = 0; i < span_padded; i += 4)
- {
- __m256d v_prod = _mm256_load_pd(parent_clv + i);
- v_prod = _mm256_mul_pd(v_prod,v_scale_factor);
- _mm256_store_pd(parent_clv + i, v_prod);
- }
- parent_clv += span_padded;
- parent_scaler[n] += 1;
- }
- }
-}
diff --git a/src/core_partials_sse.c b/src/core_partials_sse.c
index 356e075..1d2c205 100644
--- a/src/core_partials_sse.c
+++ b/src/core_partials_sse.c
@@ -1018,8 +1018,7 @@ PLL_EXPORT void pll_core_update_partial_ti_sse(unsigned int states,
const double * left_matrix,
const double * right_matrix,
const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size)
+ const unsigned int * tipmap)
{
int scaling;
unsigned int i,j,k,n;
diff --git a/src/core_pmatrix.c b/src/core_pmatrix.c
index cccc246..b308971 100644
--- a/src/core_pmatrix.c
+++ b/src/core_pmatrix.c
@@ -47,7 +47,7 @@ PLL_EXPORT int pll_core_update_pmatrix(double ** pmatrix,
double * pmat;
- #ifdef HAVE_SSE3
+ #ifdef HAVE_SSE
if (attrib & PLL_ATTRIB_ARCH_SSE)
{
if (states == 4)
@@ -86,57 +86,6 @@ PLL_EXPORT int pll_core_update_pmatrix(double ** pmatrix,
inv_eigenvecs,
count);
}
- if (states == 20)
- {
- return pll_core_update_pmatrix_20x20_avx(pmatrix,
- rate_cats,
- rates,
- branch_lengths,
- matrix_indices,
- params_indices,
- prop_invar,
- eigenvals,
- eigenvecs,
- inv_eigenvecs,
- count);
- }
- /* this line is never called, but should we disable the else case above,
- then states_padded must be set to this value */
- states_padded = (states+3) & 0xFFFFFFFC;
- }
- #endif
- #ifdef HAVE_AVX2
- if (attrib & PLL_ATTRIB_ARCH_AVX2)
- {
- if (states == 4)
- {
- /* use AVX version here since FMA doesn't make much sense */
- return pll_core_update_pmatrix_4x4_avx(pmatrix,
- rate_cats,
- rates,
- branch_lengths,
- matrix_indices,
- params_indices,
- prop_invar,
- eigenvals,
- eigenvecs,
- inv_eigenvecs,
- count);
- }
- if (states == 20)
- {
- return pll_core_update_pmatrix_20x20_avx2(pmatrix,
- rate_cats,
- rates,
- branch_lengths,
- matrix_indices,
- params_indices,
- prop_invar,
- eigenvals,
- eigenvecs,
- inv_eigenvecs,
- count);
- }
/* this line is never called, but should we disable the else case above,
then states_padded must be set to this value */
states_padded = (states+3) & 0xFFFFFFFC;
@@ -192,26 +141,6 @@ PLL_EXPORT int pll_core_update_pmatrix(double ** pmatrix,
expd[j] = exp(evals[j] * rates[n] * branch_lengths[i]);
}
- /* check if all values of expd are approximately one */
- for (k=0, j=0; j < states; ++j)
- if ((expd[j] > PLL_ONE_MIN) && (expd[j] < PLL_ONE_MAX))
- ++k;
-
- /* if yes, it means we are multiplying the inverse eigenvectors matrix
- by the eigenvectors matrix, and essentially the resulting pmatrix is
- the identity matrix. This is done to prevent having numerical issues
- (negative entries in the pmatrix) which can occur due to the
- different floating point representations of one in expd */
- if (k == states)
- {
- /* set identity matrix */
- for (j = 0; j < states; ++j)
- for (k = 0; k < states; ++k)
- pmat[j*states_padded + k] = (j == k) ? 1 : 0;
-
- continue;
- }
-
for (j = 0; j < states; ++j)
for (k = 0; k < states; ++k)
temp[j*states+k] = inv_evecs[j*states+k] * expd[k];
@@ -229,11 +158,6 @@ PLL_EXPORT int pll_core_update_pmatrix(double ** pmatrix,
}
}
}
- #ifdef DEBUG
- for (j = 0; j < states; ++j)
- for (k = 0; k < states; ++k)
- assert(pmat[j*states_padded+k] >= 0);
- #endif
}
}
diff --git a/src/core_pmatrix_avx.c b/src/core_pmatrix_avx.c
index f7947c8..64d1f05 100644
--- a/src/core_pmatrix_avx.c
+++ b/src/core_pmatrix_avx.c
@@ -21,24 +21,6 @@
#include "pll.h"
-#define ONESTEP(x,baseptr) \
- ymm0 = _mm256_load_pd(baseptr+0); \
- ymm1 = _mm256_load_pd(baseptr+4); \
- ymm2 = _mm256_load_pd(baseptr+8); \
- ymm3 = _mm256_load_pd(baseptr+12); \
- ymm4 = _mm256_load_pd(baseptr+16); \
- \
- ymm5 = _mm256_mul_pd(xmm4,ymm0); \
- ymm6 = _mm256_mul_pd(xmm5,ymm1); \
- ymm7 = _mm256_mul_pd(xmm6,ymm2); \
- ymm8 = _mm256_mul_pd(xmm7,ymm3); \
- ymm9 = _mm256_mul_pd(xmm8,ymm4); \
- \
- xmm1 = _mm256_add_pd(ymm5,ymm6); \
- ymm5 = _mm256_add_pd(xmm1,ymm7); \
- ymm6 = _mm256_add_pd(ymm5,ymm8); \
- x = _mm256_add_pd(ymm6,ymm9); /* row x */
-
PLL_EXPORT int pll_core_update_pmatrix_4x4_avx(double ** pmatrix,
unsigned int rate_cats,
double * rates,
@@ -72,11 +54,8 @@ PLL_EXPORT int pll_core_update_pmatrix_4x4_avx(double ** pmatrix,
}
__m256d xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9;
- __m256d ymm0,ymm1,ymm2,ymm3,ymm4,ymm5,ymm6,ymm7,ymm8,ymm9;
-
+ __m256d ymm0,ymm1,ymm2,ymm3,ymm4,ymm5,ymm6,ymm7;
xmm0 = _mm256_setzero_pd();
- ymm8 = _mm256_set1_pd(PLL_ONE_MIN);
- ymm9 = _mm256_set1_pd(PLL_ONE_MAX);
for (i = 0; i < count; ++i)
{
@@ -134,157 +113,127 @@ PLL_EXPORT int pll_core_update_pmatrix_4x4_avx(double ** pmatrix,
exp(expd[1]),
exp(expd[0]));
+ /* multiply inverse eigenvectors with computed result */
+ xmm2 = _mm256_load_pd(inv_evecs+0);
+ xmm4 = _mm256_load_pd(inv_evecs+4);
+ xmm5 = _mm256_load_pd(inv_evecs+8);
+ xmm6 = _mm256_load_pd(inv_evecs+12);
- /* check if all values of expd are approximately one */
- xmm2 = _mm256_cmp_pd(xmm1, ymm8, _CMP_GT_OS);
- xmm4 = _mm256_cmp_pd(xmm1, ymm9, _CMP_LT_OS);
- xmm5 = _mm256_and_pd(xmm2,xmm4);
-
-
- /* if yes, it means we are multiplying the inverse eigenvectors matrix
- by the eigenvectors matrix, and essentially the resulting pmatrix is
- the identity matrix. This is done to prevent having numerical issues
- (negative entries in the pmatrix) which can occur due to the
- different floating point representations of one in expd. Otherwise,
- proceed as normal and multiply eigenvector matrices with expd */
- if (_mm256_movemask_pd(xmm5) == 0xF)
- {
- _mm256_store_pd(pmat+0,xmm0);
- _mm256_store_pd(pmat+4,xmm0);
- _mm256_store_pd(pmat+8,xmm0);
- _mm256_store_pd(pmat+12,xmm0);
-
- pmat[0] = pmat[5] = pmat[10] = pmat[15] = 1;
- }
- else
- {
- /* multiply inverse eigenvectors with computed result */
- xmm2 = _mm256_load_pd(inv_evecs+0);
- xmm4 = _mm256_load_pd(inv_evecs+4);
- xmm5 = _mm256_load_pd(inv_evecs+8);
- xmm6 = _mm256_load_pd(inv_evecs+12);
+ xmm7 = _mm256_mul_pd(xmm2,xmm1); /* temp row 0 */
+ xmm2 = _mm256_mul_pd(xmm4,xmm1); /* temp row 1 */
+ xmm4 = _mm256_mul_pd(xmm5,xmm1); /* temp row 2 */
+ xmm5 = _mm256_mul_pd(xmm6,xmm1); /* temp row 3 */
- xmm7 = _mm256_mul_pd(xmm2,xmm1); /* temp row 0 */
- xmm2 = _mm256_mul_pd(xmm4,xmm1); /* temp row 1 */
- xmm4 = _mm256_mul_pd(xmm5,xmm1); /* temp row 2 */
- xmm5 = _mm256_mul_pd(xmm6,xmm1); /* temp row 3 */
+ /* transpose eigenvector */
+ xmm6 = _mm256_load_pd(evecs+0);
+ xmm1 = _mm256_load_pd(evecs+4);
+ xmm8 = _mm256_load_pd(evecs+8);
+ xmm9 = _mm256_load_pd(evecs+12);
- /* transpose eigenvector */
- xmm6 = _mm256_load_pd(evecs+0);
- xmm1 = _mm256_load_pd(evecs+4);
- xmm8 = _mm256_load_pd(evecs+8);
- xmm9 = _mm256_load_pd(evecs+12);
+ /* transpose eigenvectors */
+ ymm0 = _mm256_unpacklo_pd(xmm6,xmm1);
+ ymm1 = _mm256_unpackhi_pd(xmm6,xmm1);
+ ymm2 = _mm256_unpacklo_pd(xmm8,xmm9);
+ ymm3 = _mm256_unpackhi_pd(xmm8,xmm9);
- /* transpose eigenvectors */
- ymm0 = _mm256_unpacklo_pd(xmm6,xmm1);
- ymm1 = _mm256_unpackhi_pd(xmm6,xmm1);
- ymm2 = _mm256_unpacklo_pd(xmm8,xmm9);
- ymm3 = _mm256_unpackhi_pd(xmm8,xmm9);
+ xmm6 = _mm256_permute2f128_pd(ymm0,ymm2,_MM_SHUFFLE(0,2,0,0));
+ xmm1 = _mm256_permute2f128_pd(ymm1,ymm3,_MM_SHUFFLE(0,2,0,0));
+ xmm8 = _mm256_permute2f128_pd(ymm0,ymm2,_MM_SHUFFLE(0,3,0,1));
+ xmm9 = _mm256_permute2f128_pd(ymm1,ymm3,_MM_SHUFFLE(0,3,0,1));
- xmm6 = _mm256_permute2f128_pd(ymm0,ymm2,_MM_SHUFFLE(0,2,0,0));
- xmm1 = _mm256_permute2f128_pd(ymm1,ymm3,_MM_SHUFFLE(0,2,0,0));
- xmm8 = _mm256_permute2f128_pd(ymm0,ymm2,_MM_SHUFFLE(0,3,0,1));
- xmm9 = _mm256_permute2f128_pd(ymm1,ymm3,_MM_SHUFFLE(0,3,0,1));
+ /* pmat row 0*/
- /* pmat row 0*/
+ ymm0 = _mm256_mul_pd(xmm7,xmm6);
+ ymm1 = _mm256_mul_pd(xmm7,xmm1);
+ ymm2 = _mm256_mul_pd(xmm7,xmm8);
+ ymm3 = _mm256_mul_pd(xmm7,xmm9);
- ymm0 = _mm256_mul_pd(xmm7,xmm6);
- ymm1 = _mm256_mul_pd(xmm7,xmm1);
- ymm2 = _mm256_mul_pd(xmm7,xmm8);
- ymm3 = _mm256_mul_pd(xmm7,xmm9);
+ /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
+ ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
+ ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
- /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
- ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
- ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
+ ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
+ ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
- ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
- ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
+ ymm0 = _mm256_add_pd(ymm4,ymm5);
+ ymm1 = _mm256_add_pd(ymm6,ymm7);
- ymm0 = _mm256_add_pd(ymm4,ymm5);
- ymm1 = _mm256_add_pd(ymm6,ymm7);
+ ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
+ ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
+ ymm0 = _mm256_add_pd(ymm2,ymm3);
- ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
- ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
- ymm0 = _mm256_add_pd(ymm2,ymm3);
+ _mm256_store_pd(pmat+0,ymm0);
- _mm256_store_pd(pmat+0,ymm0);
+ /* pmat row 1 */
- /* pmat row 1 */
+ ymm0 = _mm256_mul_pd(xmm2,xmm6);
+ ymm1 = _mm256_mul_pd(xmm2,xmm1);
+ ymm2 = _mm256_mul_pd(xmm2,xmm8);
+ ymm3 = _mm256_mul_pd(xmm2,xmm9);
- ymm0 = _mm256_mul_pd(xmm2,xmm6);
- ymm1 = _mm256_mul_pd(xmm2,xmm1);
- ymm2 = _mm256_mul_pd(xmm2,xmm8);
- ymm3 = _mm256_mul_pd(xmm2,xmm9);
+ /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
+ ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
+ ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
- /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
- ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
- ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
+ ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
+ ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
- ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
- ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
+ ymm0 = _mm256_add_pd(ymm4,ymm5);
+ ymm1 = _mm256_add_pd(ymm6,ymm7);
- ymm0 = _mm256_add_pd(ymm4,ymm5);
- ymm1 = _mm256_add_pd(ymm6,ymm7);
+ ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
+ ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
+ ymm0 = _mm256_add_pd(ymm2,ymm3);
- ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
- ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
- ymm0 = _mm256_add_pd(ymm2,ymm3);
+ _mm256_store_pd(pmat+4,ymm0);
- _mm256_store_pd(pmat+4,ymm0);
+ /* pmat row 2 */
- /* pmat row 2 */
+ ymm0 = _mm256_mul_pd(xmm4,xmm6);
+ ymm1 = _mm256_mul_pd(xmm4,xmm1);
+ ymm2 = _mm256_mul_pd(xmm4,xmm8);
+ ymm3 = _mm256_mul_pd(xmm4,xmm9);
- ymm0 = _mm256_mul_pd(xmm4,xmm6);
- ymm1 = _mm256_mul_pd(xmm4,xmm1);
- ymm2 = _mm256_mul_pd(xmm4,xmm8);
- ymm3 = _mm256_mul_pd(xmm4,xmm9);
+ /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
+ ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
+ ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
- /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
- ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
- ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
+ ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
+ ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
- ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
- ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
+ ymm0 = _mm256_add_pd(ymm4,ymm5);
+ ymm1 = _mm256_add_pd(ymm6,ymm7);
- ymm0 = _mm256_add_pd(ymm4,ymm5);
- ymm1 = _mm256_add_pd(ymm6,ymm7);
+ ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
+ ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
+ ymm0 = _mm256_add_pd(ymm2,ymm3);
- ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
- ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
- ymm0 = _mm256_add_pd(ymm2,ymm3);
+ _mm256_store_pd(pmat+8,ymm0);
- _mm256_store_pd(pmat+8,ymm0);
+ /* pmat row 3 */
- /* pmat row 3 */
+ ymm0 = _mm256_mul_pd(xmm5,xmm6);
+ ymm1 = _mm256_mul_pd(xmm5,xmm1);
+ ymm2 = _mm256_mul_pd(xmm5,xmm8);
+ ymm3 = _mm256_mul_pd(xmm5,xmm9);
- ymm0 = _mm256_mul_pd(xmm5,xmm6);
- ymm1 = _mm256_mul_pd(xmm5,xmm1);
- ymm2 = _mm256_mul_pd(xmm5,xmm8);
- ymm3 = _mm256_mul_pd(xmm5,xmm9);
+ /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
+ ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
+ ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
- /* create a vector with the sums of ymm0, ymm1, ymm2, ymm3 */
- ymm4 = _mm256_unpackhi_pd(ymm0,ymm1);
- ymm5 = _mm256_unpacklo_pd(ymm0,ymm1);
+ ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
+ ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
- ymm6 = _mm256_unpackhi_pd(ymm2,ymm3);
- ymm7 = _mm256_unpacklo_pd(ymm2,ymm3);
+ ymm0 = _mm256_add_pd(ymm4,ymm5);
+ ymm1 = _mm256_add_pd(ymm6,ymm7);
- ymm0 = _mm256_add_pd(ymm4,ymm5);
- ymm1 = _mm256_add_pd(ymm6,ymm7);
+ ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
+ ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
+ ymm0 = _mm256_add_pd(ymm2,ymm3);
- ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
- ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
- ymm0 = _mm256_add_pd(ymm2,ymm3);
+ _mm256_store_pd(pmat+12,ymm0);
- _mm256_store_pd(pmat+12,ymm0);
- }
}
- #ifdef DEBUG
- unsigned int j,k;
- for (j = 0; j < 4; ++j)
- for (k = 0; k < 4; ++k)
- assert(pmat[j*4+k] >= 0);
- #endif
pmat = pmat+16;
}
}
@@ -292,293 +241,3 @@ PLL_EXPORT int pll_core_update_pmatrix_4x4_avx(double ** pmatrix,
pll_aligned_free(expd);
return PLL_SUCCESS;
}
-
-PLL_EXPORT int pll_core_update_pmatrix_20x20_avx(double ** pmatrix,
- unsigned int rate_cats,
- double * rates,
- const double * branch_lengths,
- const unsigned int * matrix_indices,
- const unsigned int * params_indices,
- double * prop_invar,
- double ** eigenvals,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- unsigned int count)
-{
- unsigned int i,n,j,k;
- double pinvar;
-
- int * transposed;
- double * evecs;
- double * inv_evecs;
- double * evals;
- double * pmat;
- double * expd;
- double * temp;
- double ** tran_evecs;
-
- expd = (double *)pll_aligned_alloc(20*sizeof(double), PLL_ALIGNMENT_AVX);
- temp = (double *)pll_aligned_alloc(400*sizeof(double), PLL_ALIGNMENT_AVX);
-
- /* transposed eigen vectors */
- transposed = (int *)calloc((size_t)rate_cats, sizeof(int));
- tran_evecs= (double **)calloc((size_t)rate_cats, sizeof(double *));
-
- if (!expd || !temp || !transposed || !tran_evecs)
- {
- if (expd) pll_aligned_free(expd);
- if (temp) pll_aligned_free(temp);
- if (transposed) free(transposed);
- if (tran_evecs) free(tran_evecs);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
-
- /* transpose eigenvectors */
- /* TODO: The same trick can be applied for exponentiations */
- for (n = 0; n < rate_cats; ++n)
- {
- int index = params_indices[n];
-
- if (!transposed[index])
- {
- /* allocate space for transposed eigenvectors and check that
- allocation succeeds */
- double * tran = (double *)pll_aligned_alloc(400*sizeof(double),
- PLL_ALIGNMENT_AVX);
- if (!tran)
- {
- pll_aligned_free(expd);
- pll_aligned_free(temp);
- free(transposed);
- for (i = 0; i < n; ++i)
- if (tran_evecs[i]) pll_aligned_free(tran_evecs[i]);
- free(tran_evecs);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
-
- /* transpose eigen vectors */
- evecs = eigenvecs[index];
- for (i = 0; i < 20; ++i)
- {
- for (j = 0; j < 20; ++j)
- tran[i*20+j] = evecs[j*20+i];
- }
-
- /* update pointers and indicate that the eigen vector for the current
- rate matrix with index was updated */
- tran_evecs[index] = tran;
- transposed[index] = 1;
- }
- }
- free(transposed);
-
- __m256d xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8;
- __m256d ymm0,ymm1,ymm2,ymm3,ymm4,ymm5,ymm6,ymm7,ymm8,ymm9;
- __m256d zmm0,zmm1,zmm2,zmm3;
-
- ymm8 = _mm256_set1_pd(PLL_ONE_MIN);
- ymm9 = _mm256_set1_pd(PLL_ONE_MAX);
-
- double * tran = NULL;
- for (i = 0; i < count; ++i)
- {
- assert(branch_lengths[i] >= 0);
-
- xmm3 = _mm256_set1_pd(branch_lengths[i]);
- pmat = pmatrix[matrix_indices[i]];
-
- /* compute effective pmatrix location */
- for (n = 0; n < rate_cats; ++n)
- {
- pinvar = prop_invar[params_indices[n]];
- tran = tran_evecs[params_indices[n]];
- inv_evecs = inv_eigenvecs[params_indices[n]];
- evals = eigenvals[params_indices[n]];
-
- /* if branch length is zero then set the p-matrix to identity matrix */
- if (!branch_lengths[i])
- {
- xmm0 = _mm256_setzero_pd();
- for (j = 0; j < 20; ++j)
- {
- _mm256_store_pd(pmat+0,xmm0);
- _mm256_store_pd(pmat+4,xmm0);
- _mm256_store_pd(pmat+8,xmm0);
- _mm256_store_pd(pmat+12,xmm0);
- _mm256_store_pd(pmat+16,xmm0);
- pmat[j] = 1;
- pmat += 20;
- }
- continue;
- }
-
- #ifdef DEBUG
- double * dbg_pmat = pmat;
- #endif
-
- /* exponentiate eigenvalues */
- xmm2 = _mm256_set1_pd(rates[n]);
-
- if (pinvar > PLL_MISC_EPSILON)
- xmm6 = _mm256_set1_pd(1.0 - pinvar);
-
- for (k = 0; k < 5; ++k)
- {
- xmm1 = _mm256_load_pd(evals+k*4);
-
- /* scalar multiplication with rates */
- xmm4 = _mm256_mul_pd(xmm1,xmm2);
-
- /* scalar multiplication with branch lengths */
- xmm5 = _mm256_mul_pd(xmm4,xmm3);
-
- if (pinvar > PLL_MISC_EPSILON)
- {
- xmm5 = _mm256_div_pd(xmm5,xmm6);
- }
-
- _mm256_store_pd(expd+k*4,xmm5);
- }
-
- for (k = 0; k < 20; ++k)
- expd[k] = exp(expd[k]);
-
- /* load expd */
- xmm4 = _mm256_load_pd(expd+0);
- xmm5 = _mm256_load_pd(expd+4);
- xmm6 = _mm256_load_pd(expd+8);
- xmm7 = _mm256_load_pd(expd+12);
- xmm8 = _mm256_load_pd(expd+16);
-
- /* check if all values of expd are approximately one */
- ymm0 = _mm256_cmp_pd(xmm4, ymm8, _CMP_GT_OS);
- ymm1 = _mm256_cmp_pd(xmm4, ymm9, _CMP_LT_OS);
- ymm2 = _mm256_and_pd(ymm0,ymm1); /* expd[0..3] */
- ymm0 = _mm256_cmp_pd(xmm5, ymm8, _CMP_GT_OS);
- ymm1 = _mm256_cmp_pd(xmm5, ymm9, _CMP_LT_OS);
- ymm3 = _mm256_and_pd(ymm0,ymm1); /* expd[4..7] */
- ymm0 = _mm256_cmp_pd(xmm6, ymm8, _CMP_GT_OS);
- ymm1 = _mm256_cmp_pd(xmm6, ymm9, _CMP_LT_OS);
- ymm4 = _mm256_and_pd(ymm0,ymm1); /* expd[8..11] */
- ymm0 = _mm256_cmp_pd(xmm7, ymm8, _CMP_GT_OS);
- ymm1 = _mm256_cmp_pd(xmm7, ymm9, _CMP_LT_OS);
- ymm5 = _mm256_and_pd(ymm0,ymm1); /* expd[12..15] */
- ymm0 = _mm256_cmp_pd(xmm8, ymm8, _CMP_GT_OS);
- ymm1 = _mm256_cmp_pd(xmm8, ymm9, _CMP_LT_OS);
- ymm6 = _mm256_and_pd(ymm0,ymm1); /* expd[12..15] */
-
- /* AND the results of comnparisons and check the mask to see if all
- values of expd are approximately one. If they are, it means we are
- multiplying the inverse eigenvectors matrix by the eigenvectors
- matrix, and essentially the resulting pmatrix is the identity matrix.
- This is done to prevent having numerical issues (negative entries in
- the pmatrix) which can occur due to the different floating point
- representations of one in expd. Otherwise, proceed as normal and
- multiply eigenvector matrices with expd */
- ymm0 = _mm256_and_pd(ymm2,ymm3);
- ymm1 = _mm256_and_pd(ymm0,ymm4);
- ymm0 = _mm256_and_pd(ymm1,ymm5);
- ymm1 = _mm256_and_pd(ymm0,ymm6);
- if (_mm256_movemask_pd(ymm1) == 0xF)
- {
- xmm0 = _mm256_setzero_pd();
- for (j = 0; j < 20; ++j)
- {
- _mm256_store_pd(pmat+0,xmm0);
- _mm256_store_pd(pmat+4,xmm0);
- _mm256_store_pd(pmat+8,xmm0);
- _mm256_store_pd(pmat+12,xmm0);
- _mm256_store_pd(pmat+16,xmm0);
- pmat[j] = 1;
- pmat += 20;
- }
- continue;
- }
-
- /* compute temp matrix */
- for (k = 0; k < 400; k += 20)
- {
- ymm0 = _mm256_load_pd(inv_evecs+k+0);
- ymm1 = _mm256_load_pd(inv_evecs+k+4);
- ymm2 = _mm256_load_pd(inv_evecs+k+8);
- ymm3 = _mm256_load_pd(inv_evecs+k+12);
- ymm4 = _mm256_load_pd(inv_evecs+k+16);
-
- ymm5 = _mm256_mul_pd(xmm4,ymm0);
- ymm6 = _mm256_mul_pd(xmm5,ymm1);
- ymm7 = _mm256_mul_pd(xmm6,ymm2);
- ymm8 = _mm256_mul_pd(xmm7,ymm3);
- ymm9 = _mm256_mul_pd(xmm8,ymm4);
-
- _mm256_store_pd(temp+k+0,ymm5);
- _mm256_store_pd(temp+k+4,ymm6);
- _mm256_store_pd(temp+k+8,ymm7);
- _mm256_store_pd(temp+k+12,ymm8);
- _mm256_store_pd(temp+k+16,ymm9);
- }
-
- for (j = 0; j < 400; j += 20)
- {
- xmm4 = _mm256_load_pd(temp+j+0);
- xmm5 = _mm256_load_pd(temp+j+4);
- xmm6 = _mm256_load_pd(temp+j+8);
- xmm7 = _mm256_load_pd(temp+j+12);
- xmm8 = _mm256_load_pd(temp+j+16);
-
- /* process four rows at a time */
- for (k = 0; k < 400; k += 80)
- {
- /* row 0 */
- ONESTEP(zmm0,tran+k+0);
-
- /* row 1 */
- ONESTEP(zmm1,tran+k+20);
-
- /* row 2 */
- ONESTEP(zmm2,tran+k+40);
-
- /* row 3 */
- ONESTEP(zmm3,tran+k+60);
-
- /* create a vector with the sums of zmm0, zmm1, zmm2, zmm3 */
- ymm4 = _mm256_unpackhi_pd(zmm0,zmm1);
- ymm5 = _mm256_unpacklo_pd(zmm0,zmm1);
-
- ymm6 = _mm256_unpackhi_pd(zmm2,zmm3);
- ymm7 = _mm256_unpacklo_pd(zmm2,zmm3);
-
- ymm0 = _mm256_add_pd(ymm4,ymm5);
- ymm1 = _mm256_add_pd(ymm6,ymm7);
-
- ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
- ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
- ymm0 = _mm256_add_pd(ymm2,ymm3);
-
- _mm256_store_pd(pmat,ymm0);
-
- pmat += 4;
- }
- }
- #ifdef DEBUG
- for (j = 0; j < 20; ++j)
- for (k = 0; k < 20; ++k)
- assert(dbg_pmat[j*20+k] >= 0);
- #endif
- }
- }
-
- pll_aligned_free(expd);
- pll_aligned_free(temp);
-
- for (i = 0; i < rate_cats; ++i)
- if (tran_evecs[i]) pll_aligned_free(tran_evecs[i]);
-
- free(tran_evecs);
- return PLL_SUCCESS;
-}
diff --git a/src/core_pmatrix_avx2.c b/src/core_pmatrix_avx2.c
deleted file mode 100644
index 5545068..0000000
--- a/src/core_pmatrix_avx2.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- Copyright (C) 2015 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-#define ONESTEP(x,baseptr) \
- ymm0 = _mm256_load_pd(baseptr+0); \
- ymm1 = _mm256_load_pd(baseptr+4); \
- ymm2 = _mm256_load_pd(baseptr+8); \
- ymm3 = _mm256_load_pd(baseptr+12); \
- ymm4 = _mm256_load_pd(baseptr+16); \
- \
- x = _mm256_mul_pd(xmm4,ymm0); \
- x = _mm256_fmadd_pd(xmm5,ymm1,x); \
- x = _mm256_fmadd_pd(xmm6,ymm2,x); \
- x = _mm256_fmadd_pd(xmm7,ymm3,x); \
- x = _mm256_fmadd_pd(xmm8,ymm4,x); \
-
-PLL_EXPORT
-int pll_core_update_pmatrix_20x20_avx2(double ** pmatrix,
- unsigned int rate_cats,
- double * rates,
- const double * branch_lengths,
- const unsigned int * matrix_indices,
- const unsigned int * params_indices,
- double * prop_invar,
- double ** eigenvals,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- unsigned int count)
-{
- unsigned int i,n,j,k;
- double pinvar;
-
- int * transposed;
- double * evecs;
- double * inv_evecs;
- double * evals;
- double * pmat;
- double * expd;
- double * temp;
- double ** tran_evecs;
-
- expd = (double *)pll_aligned_alloc(20*sizeof(double), PLL_ALIGNMENT_AVX);
- temp = (double *)pll_aligned_alloc(400*sizeof(double), PLL_ALIGNMENT_AVX);
-
- /* transposed eigen vectors */
- transposed = (int *)calloc((size_t)rate_cats, sizeof(int));
- tran_evecs= (double **)calloc((size_t)rate_cats, sizeof(double *));
-
- if (!expd || !temp || !transposed || !tran_evecs)
- {
- if (expd) pll_aligned_free(expd);
- if (temp) pll_aligned_free(temp);
- if (transposed) free(transposed);
- if (tran_evecs) free(tran_evecs);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
-
- /* transpose eigenvectors */
- /* TODO: The same trick can be applied for exponentiations */
- for (n = 0; n < rate_cats; ++n)
- {
- int index = params_indices[n];
-
- if (!transposed[index])
- {
- /* allocate space for transposed eigenvectors and check that
- allocation succeeds */
- double * tran = (double *)pll_aligned_alloc(400*sizeof(double),
- PLL_ALIGNMENT_AVX);
- if (!tran)
- {
- pll_aligned_free(expd);
- pll_aligned_free(temp);
- free(transposed);
- for (i = 0; i < n; ++i)
- if (tran_evecs[i]) pll_aligned_free(tran_evecs[i]);
- free(tran_evecs);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
-
- /* transpose eigen vectors */
- evecs = eigenvecs[index];
- for (i = 0; i < 20; ++i)
- {
- for (j = 0; j < 20; ++j)
- tran[i*20+j] = evecs[j*20+i];
- }
-
- /* update pointers and indicate that the eigen vector for the current
- rate matrix with index was updated */
- tran_evecs[index] = tran;
- transposed[index] = 1;
- }
- }
- free(transposed);
-
- __m256d xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8;
- __m256d ymm0,ymm1,ymm2,ymm3,ymm4,ymm5,ymm6,ymm7,ymm8,ymm9;
- __m256d zmm0,zmm1,zmm2,zmm3;
-
- double * tran = NULL;
- for (i = 0; i < count; ++i)
- {
- assert(branch_lengths[i] >= 0);
-
- xmm3 = _mm256_set1_pd(branch_lengths[i]);
- pmat = pmatrix[matrix_indices[i]];
-
- /* compute effective pmatrix location */
- for (n = 0; n < rate_cats; ++n)
- {
- pinvar = prop_invar[params_indices[n]];
- tran = tran_evecs[params_indices[n]];
- inv_evecs = inv_eigenvecs[params_indices[n]];
- evals = eigenvals[params_indices[n]];
-
- /* if branch length is zero then set the p-matrix to identity matrix */
- if (!branch_lengths[i])
- {
- xmm0 = _mm256_setzero_pd();
- for (j = 0; j < 20; ++j)
- {
- _mm256_store_pd(pmat+0,xmm0);
- _mm256_store_pd(pmat+4,xmm0);
- _mm256_store_pd(pmat+8,xmm0);
- _mm256_store_pd(pmat+12,xmm0);
- _mm256_store_pd(pmat+16,xmm0);
- pmat[j] = 1;
- pmat += 20;
- }
- continue;
- }
-
- /* exponentiate eigenvalues */
- xmm2 = _mm256_set1_pd(rates[n]);
-
- if (pinvar > PLL_MISC_EPSILON)
- xmm6 = _mm256_set1_pd(1.0 - pinvar);
-
- for (k = 0; k < 5; ++k)
- {
- xmm1 = _mm256_load_pd(evals+k*4);
-
- /* scalar multiplication with rates */
- xmm4 = _mm256_mul_pd(xmm1,xmm2);
-
- /* scalar multiplication with branch lengths */
- xmm5 = _mm256_mul_pd(xmm4,xmm3);
-
- if (pinvar > PLL_MISC_EPSILON)
- {
- xmm5 = _mm256_div_pd(xmm5,xmm6);
- }
-
- _mm256_store_pd(expd+k*4,xmm5);
- }
-
- for (k = 0; k < 20; ++k)
- expd[k] = exp(expd[k]);
-
- /* load expd */
- xmm4 = _mm256_load_pd(expd+0);
- xmm5 = _mm256_load_pd(expd+4);
- xmm6 = _mm256_load_pd(expd+8);
- xmm7 = _mm256_load_pd(expd+12);
- xmm8 = _mm256_load_pd(expd+16);
-
- /* compute temp matrix */
- for (k = 0; k < 400; k += 20)
- {
- ymm0 = _mm256_load_pd(inv_evecs+k+0);
- ymm1 = _mm256_load_pd(inv_evecs+k+4);
- ymm2 = _mm256_load_pd(inv_evecs+k+8);
- ymm3 = _mm256_load_pd(inv_evecs+k+12);
- ymm4 = _mm256_load_pd(inv_evecs+k+16);
-
- ymm5 = _mm256_mul_pd(xmm4,ymm0);
- ymm6 = _mm256_mul_pd(xmm5,ymm1);
- ymm7 = _mm256_mul_pd(xmm6,ymm2);
- ymm8 = _mm256_mul_pd(xmm7,ymm3);
- ymm9 = _mm256_mul_pd(xmm8,ymm4);
-
- _mm256_store_pd(temp+k+0,ymm5);
- _mm256_store_pd(temp+k+4,ymm6);
- _mm256_store_pd(temp+k+8,ymm7);
- _mm256_store_pd(temp+k+12,ymm8);
- _mm256_store_pd(temp+k+16,ymm9);
- }
-
- for (j = 0; j < 400; j += 20)
- {
- xmm4 = _mm256_load_pd(temp+j+0);
- xmm5 = _mm256_load_pd(temp+j+4);
- xmm6 = _mm256_load_pd(temp+j+8);
- xmm7 = _mm256_load_pd(temp+j+12);
- xmm8 = _mm256_load_pd(temp+j+16);
-
- /* process four rows at a time */
- for (k = 0; k < 400; k += 80)
- {
- /* row 0 */
- ONESTEP(zmm0,tran+k+0);
-
- /* row 1 */
- ONESTEP(zmm1,tran+k+20);
-
- /* row 2 */
- ONESTEP(zmm2,tran+k+40);
-
- /* row 3 */
- ONESTEP(zmm3,tran+k+60);
-
- /* create a vector with the sums of zmm0, zmm1, zmm2, zmm3 */
- ymm4 = _mm256_unpackhi_pd(zmm0,zmm1);
- ymm5 = _mm256_unpacklo_pd(zmm0,zmm1);
-
- ymm6 = _mm256_unpackhi_pd(zmm2,zmm3);
- ymm7 = _mm256_unpacklo_pd(zmm2,zmm3);
-
- ymm0 = _mm256_add_pd(ymm4,ymm5);
- ymm1 = _mm256_add_pd(ymm6,ymm7);
-
- ymm2 = _mm256_permute2f128_pd(ymm0,ymm1, _MM_SHUFFLE(0,2,0,1));
- ymm3 = _mm256_blend_pd(ymm0,ymm1,12);
- ymm0 = _mm256_add_pd(ymm2,ymm3);
-
- _mm256_store_pd(pmat,ymm0);
-
- pmat += 4;
- }
- }
- }
- }
-
- pll_aligned_free(expd);
- pll_aligned_free(temp);
-
- for (i = 0; i < rate_cats; ++i)
- if (tran_evecs[i]) pll_aligned_free(tran_evecs[i]);
-
- free(tran_evecs);
- return PLL_SUCCESS;
-}
diff --git a/src/core_pmatrix_sse.c b/src/core_pmatrix_sse.c
index c563da8..a638056 100644
--- a/src/core_pmatrix_sse.c
+++ b/src/core_pmatrix_sse.c
@@ -89,11 +89,7 @@ PLL_EXPORT int pll_core_update_pmatrix_4x4_sse(double ** pmatrix,
__m128d xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8, xmm9;
__m128d xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, xmm16;
- __m128d v_onemin, v_onemax;
-
xmm0 = _mm_setzero_pd();
- v_onemin = _mm_set1_pd(PLL_ONE_MIN);
- v_onemax = _mm_set1_pd(PLL_ONE_MAX);
for (i = 0; i < count; ++i)
{
@@ -156,75 +152,41 @@ PLL_EXPORT int pll_core_update_pmatrix_4x4_sse(double ** pmatrix,
_mm_store_pd(expd+0,xmm7);
_mm_store_pd(expd+2,xmm8);
- /* check if all values of expd are approximately one */
- xmm12 = _mm_set_pd(exp(expd[1]), exp(expd[0]));
- xmm13 = _mm_set_pd(exp(expd[3]), exp(expd[2]));
- /* */
- xmm1 = _mm_cmpgt_pd(xmm12,v_onemin);
- xmm2 = _mm_cmplt_pd(xmm13,v_onemax);
- xmm4 = _mm_and_pd(xmm1,xmm2);
+ /* transpose eigenvector */
- if (_mm_movemask_pd(xmm4) == 0x3)
- {
- _mm_store_pd(pmat+0, xmm0);
- _mm_store_pd(pmat+2, xmm0);
- _mm_store_pd(pmat+4, xmm0);
- _mm_store_pd(pmat+6, xmm0);
- _mm_store_pd(pmat+8, xmm0);
- _mm_store_pd(pmat+10,xmm0);
- _mm_store_pd(pmat+12,xmm0);
- _mm_store_pd(pmat+14,xmm0);
-
- pmat[0] = pmat[5] = pmat[10] = pmat[15] = 1;
- }
- else
- {
- /* transpose eigenvector */
-
- xmm1 = _mm_load_pd(evecs+0);
- xmm2 = _mm_load_pd(evecs+4);
- xmm4 = _mm_unpacklo_pd(xmm1,xmm2); /* row 0 (0,1) */
- xmm5 = _mm_unpackhi_pd(xmm1,xmm2); /* row 1 (0,1) */
-
- xmm1 = _mm_load_pd(evecs+2);
- xmm2 = _mm_load_pd(evecs+6);
- xmm6 = _mm_unpacklo_pd(xmm1,xmm2); /* row 2 (0,1) */
- xmm7 = _mm_unpackhi_pd(xmm1,xmm2); /* row 3 (0,1) */
-
- xmm1 = _mm_load_pd(evecs+8);
- xmm2 = _mm_load_pd(evecs+12);
- xmm8 = _mm_unpacklo_pd(xmm1,xmm2); /* row 0 (2,3) */
- xmm9 = _mm_unpackhi_pd(xmm1,xmm2); /* row 1 (2,3) */
-
- xmm1 = _mm_load_pd(evecs+10);
- xmm2 = _mm_load_pd(evecs+14);
- xmm10 = _mm_unpacklo_pd(xmm1,xmm2); /* row 2 (2,3) */
- xmm11 = _mm_unpackhi_pd(xmm1,xmm2); /* row 3 (2,3) */
-
- /* load exponentiated eigenvalues */
- /*
- xmm1 = _mm_set_pd(exp(expd[1]),
- exp(expd[0]));
- xmm2 = _mm_set_pd(exp(expd[3]),
- exp(expd[2]));
- */
- xmm1 = xmm12;
- xmm2 = xmm13;
-
- /* compute pmatrix */
- ONESTEP(0);
- ONESTEP(4);
- ONESTEP(8);
- ONESTEP(12);
- }
+ xmm1 = _mm_load_pd(evecs+0);
+ xmm2 = _mm_load_pd(evecs+4);
+ xmm4 = _mm_unpacklo_pd(xmm1,xmm2); /* row 0 (0,1) */
+ xmm5 = _mm_unpackhi_pd(xmm1,xmm2); /* row 1 (0,1) */
+
+ xmm1 = _mm_load_pd(evecs+2);
+ xmm2 = _mm_load_pd(evecs+6);
+ xmm6 = _mm_unpacklo_pd(xmm1,xmm2); /* row 2 (0,1) */
+ xmm7 = _mm_unpackhi_pd(xmm1,xmm2); /* row 3 (0,1) */
+
+ xmm1 = _mm_load_pd(evecs+8);
+ xmm2 = _mm_load_pd(evecs+12);
+ xmm8 = _mm_unpacklo_pd(xmm1,xmm2); /* row 0 (2,3) */
+ xmm9 = _mm_unpackhi_pd(xmm1,xmm2); /* row 1 (2,3) */
+
+ xmm1 = _mm_load_pd(evecs+10);
+ xmm2 = _mm_load_pd(evecs+14);
+ xmm10 = _mm_unpacklo_pd(xmm1,xmm2); /* row 2 (2,3) */
+ xmm11 = _mm_unpackhi_pd(xmm1,xmm2); /* row 3 (2,3) */
+
+ /* load exponentiated eigenvalues */
+ xmm1 = _mm_set_pd(exp(expd[1]),
+ exp(expd[0]));
+ xmm2 = _mm_set_pd(exp(expd[3]),
+ exp(expd[2]));
+
+ /* compute pmatrix */
+ ONESTEP(0);
+ ONESTEP(4);
+ ONESTEP(8);
+ ONESTEP(12);
}
- #ifdef DEBUG
- unsigned int j,k;
- for (j = 0; j < 4; ++j)
- for (k = 0; k < 4; ++k)
- assert(pmat[j*4+k] >= 0);
- #endif
pmat = pmat+16;
}
}
diff --git a/src/derivatives.c b/src/derivatives.c
index d2672b1..56b7b2d 100644
--- a/src/derivatives.c
+++ b/src/derivatives.c
@@ -22,19 +22,15 @@
#include "pll.h"
static int sumtable_tipinner(pll_partition_t * partition,
- unsigned int parent_clv_index,
- unsigned int child_clv_index,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
- const unsigned int * params_indices,
- double *sumtable)
+ unsigned int parent_clv_index,
+ unsigned int child_clv_index,
+ const unsigned int * params_indices,
+ double *sumtable)
{
unsigned int i, retval;
unsigned int tip_clv_index;
unsigned int inner_clv_index;
unsigned int sites = partition->sites;
- const unsigned int * scaler;
-
double ** eigenvecs = (double **)malloc(partition->rate_cats *
sizeof(double *));
double ** inv_eigenvecs = (double **)malloc(partition->rate_cats *
@@ -68,13 +64,11 @@ static int sumtable_tipinner(pll_partition_t * partition,
{
tip_clv_index = parent_clv_index;
inner_clv_index = child_clv_index;
- scaler = child_scaler;
}
else
{
tip_clv_index = child_clv_index;
inner_clv_index = parent_clv_index;
- scaler = parent_scaler;
}
retval = pll_core_update_sumtable_ti(partition->states,
@@ -82,12 +76,10 @@ static int sumtable_tipinner(pll_partition_t * partition,
partition->rate_cats,
partition->clv[inner_clv_index],
partition->tipchars[tip_clv_index],
- scaler,
eigenvecs,
inv_eigenvecs,
freqs,
partition->tipmap,
- partition->maxstates,
sumtable,
partition->attributes);
@@ -101,8 +93,6 @@ static int sumtable_tipinner(pll_partition_t * partition,
static int sumtable_innerinner(pll_partition_t * partition,
unsigned int parent_clv_index,
unsigned int child_clv_index,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
const unsigned int * params_indices,
double *sumtable)
{
@@ -143,8 +133,6 @@ static int sumtable_innerinner(pll_partition_t * partition,
partition->rate_cats,
partition->clv[parent_clv_index],
partition->clv[child_clv_index],
- parent_scaler,
- child_scaler,
eigenvecs,
inv_eigenvecs,
freqs,
@@ -164,71 +152,48 @@ static int sumtable_innerinner(pll_partition_t * partition,
PLL_EXPORT int pll_update_sumtable(pll_partition_t * partition,
unsigned int parent_clv_index,
unsigned int child_clv_index,
- int parent_scaler_index,
- int child_scaler_index,
const unsigned int * params_indices,
double *sumtable)
{
int retval;
- unsigned int * parent_scaler;
- unsigned int * child_scaler;
-
- /* get parent scaler */
- if (parent_scaler_index == PLL_SCALE_BUFFER_NONE)
- parent_scaler = NULL;
- else
- parent_scaler = partition->scale_buffer[parent_scaler_index];
-
- if (child_scaler_index == PLL_SCALE_BUFFER_NONE)
- child_scaler = NULL;
- else
- child_scaler = partition->scale_buffer[child_scaler_index];
-
-
if (partition->attributes & PLL_ATTRIB_PATTERN_TIP)
- {
- if ((parent_clv_index < partition->tips) &&
- (child_clv_index < partition->tips))
- {
- /* tip-tip case */
- assert(0);
- }
- else if ((parent_clv_index < partition->tips) ||
- (child_clv_index < partition->tips))
- {
- /* tip-inner */
- retval = sumtable_tipinner(partition,
- parent_clv_index,
- child_clv_index,
- parent_scaler,
- child_scaler,
- params_indices,
- sumtable);
- }
- else
- {
- /* inner-inner */
- retval = sumtable_innerinner(partition,
- parent_clv_index,
- child_clv_index,
- parent_scaler,
- child_scaler,
- params_indices,
- sumtable);
- }
- }
- else
- {
- /* inner-inner */
- retval = sumtable_innerinner(partition,
- parent_clv_index,
- child_clv_index,
- parent_scaler,
- child_scaler,
- params_indices,
- sumtable);
- }
+ {
+ if ((parent_clv_index < partition->tips) &&
+ (child_clv_index < partition->tips))
+ {
+ /* tip-tip case */
+ assert(0);
+ }
+ else if ((parent_clv_index < partition->tips) ||
+ (child_clv_index < partition->tips))
+ {
+ /* tip-inner */
+ retval = sumtable_tipinner(partition,
+ parent_clv_index,
+ child_clv_index,
+ params_indices,
+ sumtable);
+ }
+ else
+ {
+ /* inner-inner */
+ retval = sumtable_innerinner(partition,
+ parent_clv_index,
+ child_clv_index,
+ params_indices,
+ sumtable);
+ }
+ }
+ else
+ {
+ /* inner-inner */
+ retval = sumtable_innerinner(partition,
+ parent_clv_index,
+ child_clv_index,
+ params_indices,
+ sumtable);
+ }
return retval;
}
diff --git a/src/fast_parsimony.c b/src/fast_parsimony.c
deleted file mode 100644
index c19e237..0000000
--- a/src/fast_parsimony.c
+++ /dev/null
@@ -1,774 +0,0 @@
-/*
- Copyright (C) 2016 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-#define PLL_BITVECTOR_SIZE 32
-
-static int alloc_pars_structs(pll_parsimony_t * parsimony,
- unsigned int bitvectors)
-{
- unsigned int i,j;
-
- /* TODO: Test this for compatibility with rooted and unrooted trees */
- unsigned int nodes_count = parsimony->tips + parsimony->inner_nodes;
-
- parsimony->node_cost = (unsigned int *)calloc(nodes_count,
- sizeof(unsigned int));
- if (!parsimony->node_cost)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200,
- "Cannot allocate parsimony cost array.");
- return PLL_FAILURE;
- }
-
- /* allocate parsimony vector container */
- parsimony->packedvector = (unsigned int **)malloc(nodes_count *
- sizeof(unsigned int *));
- if (!parsimony->packedvector)
- {
- free(parsimony->node_cost);
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf (pll_errmsg, 200,
- "Cannot allocate parsimony vector container.");
- return PLL_FAILURE;
- }
-
- /* allocate individual vectors */
- unsigned int ** vector = parsimony->packedvector;
- for (i = 0; i < nodes_count; ++i)
- {
- vector[i] = (unsigned int *)pll_aligned_alloc(parsimony->states *
- bitvectors *
- sizeof(unsigned int),
- parsimony->alignment);
- if (!vector[i])
- {
- free(parsimony->node_cost);
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf (pll_errmsg, 200,
- "Cannot allocate parsimony vector.");
-
- /* free all allocated vectors */
- for (j = 0; j < i; ++j)
- pll_aligned_free(vector[i]);
- free(vector);
-
- return PLL_FAILURE;
- }
- }
- return PLL_SUCCESS;
-}
-
-static int check_informative_extended(pll_partition_t * partition,
- unsigned int index,
- unsigned int * singleton)
-{
- unsigned int c;
- int count = 0;
- unsigned int * map;
- unsigned int i,j;
- unsigned int range = (1 << partition->states);
-
- /* TODO: Move allocation outside of function such that it happens only once */
- //map = (int *)malloc(1024*1024*sizeof(int));
- map = (unsigned int *)malloc(range*sizeof(unsigned int));
-
- memset(map,0,range*sizeof(unsigned int));
-
- for (i = 0; i < partition->tips; ++i)
- {
- c = 0;
-
- double * clv = partition->clv[i] +
- index*partition->states_padded*partition->rate_cats;
-
- for (j = 0; j < partition->states; ++j)
- c = (c << 1) | (unsigned int)(clv[j]);
-
- map[c]++;
- }
-
- /* TODO: change to only required range */
- for (i=0; i< range; ++i)
- if (map[i] > 1)
- count++;
- else if (map[i] == 1)
- (*singleton)++;
-
- free(map);
-
- if (count <= 1)
- return 0;
-
- return 1;
-}
-
-static int check_informative(pll_partition_t * partition,
- unsigned int index,
- unsigned int * singleton)
-{
- unsigned int i,j;
- unsigned int map[256];
- int count = 0;
- unsigned int c;
-
- /* in case the site is non-informative, count the number of states appearing
- only once, and which is equal to the number of mutations */
- *singleton = 0;
-
- for (i = 0; i < 256; ++i)
- map[i] = 0;
-
- /* if tips states are presented by characters */
- if (partition->attributes & PLL_ATTRIB_PATTERN_TIP)
- {
- for (i = 0; i < partition->tips; ++i)
- {
- c = partition->tipchars[i][index];
- map[c]++;
- }
- }
- else
- {
- /* otherwise, tips are represented by conditional probabilities */
-
- /* TODO: Currently this is extremely time-consuming as we have to allocate
- an array of 2^states elements each time we call check_informative_extended
- (i.e. for every character). For more than 20 states, this process becomes
- extremely slow, and we need to think of a better way (or completely disallow
- the non pattern tip case */
- assert(partition->states <= 20);
- if (partition->states > 8)
- return check_informative_extended(partition, index, singleton);
-
- for (i = 0; i < partition->tips; ++i)
- {
- c = 0;
-
- double * clv = partition->clv[i] +
- index*partition->states_padded*partition->rate_cats;
-
- for (j = 0; j < partition->states; ++j)
- c = (c << 1) | (unsigned int)(clv[j]);
-
- map[c]++;
- }
- }
-
-
- /* TODO: change to only required range */
- for (i=0; i<256; ++i)
- if (map[i] > 1)
- count++;
- else if (map[i] == 1)
- (*singleton)++;
-
- if (count <= 1)
- return 0;
-
- return 1;
-}
-
-static int fill_parsimony_vectors(pll_partition_t * partition,
- pll_parsimony_t * parsimony)
-{
- unsigned int c;
- unsigned int i,j,k;
- unsigned int bitcount = 0;
- unsigned int bitvectors;
-
- unsigned int states = parsimony->states;
-
- /*
- Example: assume the following tree and encoding
-
- /\ A = 0001 seq1 = TTAACT
- / \ C = 0010 seq2 = TTCAGG
- /\ /\ G = 0100 seq3 = CCGACT
- 1 23 4 T = 1000 seq4 = CCTAGG
- informative = 110011
-
- Create 32-bit state vectors for each tip:
-
- node1:
- vecA 00110011111111111111111111111111
- vecC 00001011111111111111111111111111
- vecG 00000011111111111111111111111111
- vecT 11000111111111111111111111111111
-
- node2:
- vecA 00010011111111111111111111111111
- vecC 00100011111111111111111111111111
- vecG 00001111111111111111111111111111
- vecT 11000011111111111111111111111111
-
- node3:
- vecA 00010011111111111111111111111111
- vecC 11001011111111111111111111111111
- vecG 00100011111111111111111111111111
- vecT 00000111111111111111111111111111
-
- node4:
- vecA 00010011111111111111111111111111
- vecC 11000011111111111111111111111111
- vecG 00001111111111111111111111111111
- vecT 00100011111111111111111111111111
- */
-
- /* compute total number of bits required */
- for (i=0; i<parsimony->sites; ++i)
- if (parsimony->informative[i])
- bitcount += partition->pattern_weights[i];
-
- /* number of 32-bit bit-vectors required */
- bitvectors = (bitcount / PLL_BITVECTOR_SIZE) +
- (bitcount % PLL_BITVECTOR_SIZE != 0);
-
-#ifdef HAVE_SSE3
- if (parsimony->attributes & PLL_ATTRIB_ARCH_SSE)
- bitvectors = (bitvectors+3) & 0xFFFFFFFC;
-#endif
-
-#ifdef HAVE_AVX
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX)
- bitvectors = (bitvectors+7) & 0xFFFFFFF8;
-#endif
-
-#ifdef HAVE_AVX2
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX2)
- bitvectors = (bitvectors+7) & 0xFFFFFFF8;
-#endif
-
- /* allocate necessary data structures */
- if (!alloc_pars_structs(parsimony, bitvectors))
- return PLL_FAILURE;
-
- unsigned int ** statevec = (unsigned int **)malloc(states *
- sizeof(unsigned int *));
- unsigned int * val = (unsigned int *)calloc(states,sizeof(unsigned int));
- if (!val || !statevec)
- {
- if (val) free(val);
- if (statevec) free(statevec);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf (pll_errmsg, 200,
- "Cannot allocate bitvector data.");
- return PLL_FAILURE;
- }
-
- /* TODO: Separate tip pattern and clv case */
- for (i = 0; i < parsimony->tips; ++i)
- {
- for (k = 0; k < parsimony->states; ++k) val[k] = 0;
- bitcount = 0;
-
- for (j = 0; j < parsimony->states; ++j)
- statevec[j] = parsimony->packedvector[i]+bitvectors*j;
-
- unsigned int vec_index = 0;
- for (j = 0; j < parsimony->sites; ++j)
- {
- if (parsimony->informative[j])
- {
- /* TODO: check for tip map */
- unsigned int m;
- for (m = 0; m < partition->pattern_weights[j]; ++m)
- {
- if (parsimony->attributes & PLL_ATTRIB_PATTERN_TIP)
- {
- c = partition->tipchars[i][j];
- if (states != 4) c = partition->tipmap[c];
- for (k = 0; k < parsimony->states; ++k, c >>= 1)
- if (c & 1)
- val[k] |= (1 << bitcount);
- }
- else
- {
- double * clv = partition->clv[i] +
- j*partition->states_padded * partition->rate_cats;
-
- for (k = 0; k < states; ++k)
- if ((int)(clv[k]))
- {
- val[k] |= (1 << bitcount);
- }
- }
-
- bitcount++;
-
- if (bitcount == PLL_BITVECTOR_SIZE)
- {
- for (k = 0; k < states; ++k)
- {
- statevec[k][vec_index] = val[k];
- val[k] = 0;
- }
-
- vec_index++;
- bitcount = 0;
- }
- }
-
- }
- }
-
- /* fill up the remaining bit entries in the current vector with ones */
- if (bitcount && (bitcount != PLL_BITVECTOR_SIZE))
- {
- for (; bitcount < PLL_BITVECTOR_SIZE; ++bitcount)
- for (k = 0; k < states; ++k)
- val[k] |= (1 << bitcount);
-
- for (k = 0; k < states; ++k)
- statevec[k][vec_index] = val[k];
-
- vec_index++;
- }
-
- /* fill up the remaining bit vectors due to padding with ones */
- for (; vec_index < bitvectors; ++vec_index)
- for (k = 0; k < states; ++k)
- statevec[k][vec_index] = ~0u;
- }
- parsimony->packedvector_count = bitvectors;
-
- free(statevec);
- free(val);
-
- return PLL_SUCCESS;
-}
-
-static int pll_set_informative(pll_partition_t * partition,
- pll_parsimony_t * parsimony)
-{
- unsigned int i;
- unsigned int singletons = 0;
- unsigned int count = 0;
-
- /* allocate array for indicating whether a site is informative or not */
- parsimony->informative = (int *)malloc(parsimony->sites * sizeof(int));
- if (!parsimony->informative)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf (pll_errmsg, 200,
- "Cannot allocate informative array.");
- return PLL_FAILURE;
- }
-
- /* identify and mark informative sites */
- for (i = 0; i < parsimony->sites; ++i)
- {
- if (check_informative(partition,i,&singletons))
- parsimony->informative[i] = 1;
- else
- {
- parsimony->informative[i] = 0;
- count++;
- parsimony->const_cost += singletons *
- partition->pattern_weights[i];
- }
- }
-
- parsimony->informative_count = parsimony->sites - count;
-
- return PLL_SUCCESS;
-}
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_4x4(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i;
-
- unsigned int * node1[4];
- unsigned int * node2[4];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- node1[i] = vector[node1_score_index] + i*vector_count;
- node2[i] = vector[node2_score_index] + i*vector_count;
- }
-
- unsigned int xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6;
-
- /* set all bits to one */
- xmm1 = ~0u;
-
- for (i = 0; i < parsimony->packedvector_count; ++i)
- {
- /* compute AND bit vectors for state 0 */
- xmm2 = node1[0][i] & node2[0][i];
-
- /* compute AND bit vectors for state 1 */
- xmm3 = node1[1][i] & node2[1][i];
-
- /* compute AND bit vectors for state 2 */
- xmm4 = node1[2][i] & node2[2][i];
-
- /* compute AND bit vectors for state 3 */
- xmm5 = node1[3][i] & node2[3][i];
-
- /* OR the ANDs of states 0,1,2,3 */
- xmm6 = xmm2 | xmm3 | xmm4 | xmm5;
-
- xmm0 = ~xmm6 & xmm1;
-
- score += (unsigned int)__builtin_popcount(xmm0);
- }
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
-
-PLL_EXPORT void pll_fastparsimony_update_vector_4x4(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i;
- unsigned int * parent[4];
- unsigned int * child1[4];
- unsigned int * child2[4];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- parent[i] = vector[op->parent_score_index] + i*vector_count;
- child1[i] = vector[op->child1_score_index] + i*vector_count;
- child2[i] = vector[op->child2_score_index] + i*vector_count;
- }
-
- unsigned int xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9;
-
- /* set all bits to one */
- xmm9 = ~0u;
-
- for (i = 0; i < parsimony->packedvector_count; ++i)
- {
- /* load, and, or bit vectors for state 0 */
-
- xmm0 = child1[0][i] & child2[0][i];
- xmm1 = child1[0][i] | child2[0][i];
-
- /* load, and, or bit vectors for state 1 */
-
- xmm2 = child1[1][i] & child2[1][i];
- xmm3 = child1[1][i] | child2[1][i];
-
- /* load, and, or bit vectors for state 2 */
-
- xmm4 = child1[2][i] & child2[2][i];
- xmm5 = child1[2][i] | child2[2][i];
-
- /* load, and, or bit vectors for state 3 */
-
- xmm6 = child1[3][i] & child2[3][i];
- xmm7 = child1[3][i] | child2[3][i];
-
- /* OR the ANDs of states 0,1,2,3 */
-
- xmm8 = xmm0 | xmm2 | xmm4 | xmm6;
-
- /* store them */
- parent[0][i] = xmm0 | (~xmm8 & xmm1);
- parent[1][i] = xmm2 | (~xmm8 & xmm3);
- parent[2][i] = xmm4 | (~xmm8 & xmm5);
- parent[3][i] = xmm6 | (~xmm8 & xmm7);
-
- score += (unsigned int)__builtin_popcount(~xmm8 & xmm9);
- }
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-PLL_EXPORT pll_parsimony_t * pll_fastparsimony_init(pll_partition_t * partition)
-{
- pll_parsimony_t * parsimony;
-
- /* TODO: Currently only upto 20 states are supported with non pattern-tip
- compression */
- if (partition->states > 20 &&
- (partition->attributes & PLL_ATTRIB_PATTERN_TIP) == 0)
- {
- pll_errno = PLL_ERROR_STEPWISE_UNSUPPORTED;
- snprintf(pll_errmsg,
- 200,
- "Use PLL_ATTRIB_PATTERN_TIP for more than 20 states.");
- return NULL;
- }
-
- parsimony = (pll_parsimony_t *)calloc(1,sizeof(pll_parsimony_t));
-
- parsimony->tips = partition->tips;
- parsimony->inner_nodes = partition->tips-1;
- parsimony->sites = partition->sites;
- parsimony->attributes = partition->attributes;
- parsimony->states = partition->states;
- parsimony->alignment = partition->alignment;
-
- if (!pll_set_informative(partition,parsimony))
- return NULL;
-
- if (!fill_parsimony_vectors(partition,parsimony))
- return NULL;
-
- return parsimony;
-}
-
-PLL_EXPORT void pll_fastparsimony_update_vector(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
- unsigned int vector_count = parsimony->packedvector_count;
- unsigned int ** vector = parsimony->packedvector;
-
- unsigned int * child1;
- unsigned int * child2;
- unsigned int * parent;
-
- unsigned int score = 0;
-
- /* set all bits to one */
- unsigned int vones = ~0u;
-
- for (i = 0; i < parsimony->packedvector_count; ++i)
- {
-
- /* OR the ANDs of all states */
- unsigned int orvand = 0;
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- for (j = 0; j < states; ++j)
- {
- orvand |= (child1[i] & child2[i]);
-
- child1 += vector_count;
- child2 += vector_count;
- }
-
- /* store vectors at parent */
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- parent = vector[op->parent_score_index];
- for (j = 0; j < states; ++j)
- {
- parent[i] = (child1[i] & child2[i]) |
- (~orvand & (child1[i] | child2[i]));
-
- child1 += vector_count;
- child2 += vector_count;
- parent += vector_count;
-
- }
-
- score += (unsigned int)__builtin_popcount(~orvand & vones);
- }
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-static unsigned int fastparsimony_edge_score(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
- unsigned int vector_count = parsimony->packedvector_count;
- unsigned int ** vector = parsimony->packedvector;
-
- unsigned int * node1;
- unsigned int * node2;
-
- unsigned int score = 0;
-
- /* set all bits to one */
- unsigned int vones = ~0u;
-
- for (i = 0; i < parsimony->packedvector_count; ++i)
- {
- /* OR the ANDs of all states */
- unsigned int orvand = 0;
- node1 = vector[node1_score_index];
- node2 = vector[node2_score_index];
- for (j = 0; j < states; ++j)
- {
- orvand |= (node1[i] & node2[i]);
-
- node1 += vector_count;
- node2 += vector_count;
- }
-
- score += (unsigned int )__builtin_popcount(~orvand & vones);
- }
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
-
-static void fastparsimony_update_vectors_4x4(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * ops,
- unsigned int count)
-{
- unsigned int i;
- const pll_pars_buildop_t * op;
-
- for (i = 0; i < count; ++i)
- {
- op = &(ops[i]);
-#ifdef HAVE_SSE3
- if (parsimony->attributes & PLL_ATTRIB_ARCH_SSE)
- pll_fastparsimony_update_vector_4x4_sse(parsimony,op);
- else
-#endif
-#ifdef HAVE_AVX
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX)
- pll_fastparsimony_update_vector_4x4_avx(parsimony,op);
- else
-#endif
-#ifdef HAVE_AVX2
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX2)
- pll_fastparsimony_update_vector_4x4_avx2(parsimony,op);
- else
-#endif
- pll_fastparsimony_update_vector_4x4(parsimony,op);
- }
-}
-
-static int fastparsimony_update_vectors(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * ops,
- unsigned int count)
-{
- unsigned int i;
- const pll_pars_buildop_t * op;
-
- for (i = 0; i < count; ++i)
- {
- op = &(ops[i]);
-#ifdef HAVE_SSE3
- if (parsimony->attributes & PLL_ATTRIB_ARCH_SSE)
- pll_fastparsimony_update_vector_sse(parsimony,op);
- else
-#endif
-#ifdef HAVE_AVX
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX)
- pll_fastparsimony_update_vector_avx(parsimony,op);
- else
-#endif
-#ifdef HAVE_AVX2
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX2)
- pll_fastparsimony_update_vector_avx2(parsimony,op);
- else
-#endif
- pll_fastparsimony_update_vector(parsimony,op);
- }
- return PLL_SUCCESS;
-}
-
-PLL_EXPORT void pll_fastparsimony_update_vectors(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * ops,
- unsigned int count)
-{
- if (parsimony->states == 4)
- fastparsimony_update_vectors_4x4(parsimony,ops,count);
- else
- fastparsimony_update_vectors(parsimony,ops,count);
-}
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- if (parsimony->states == 4)
- {
-#ifdef HAVE_SSE3
- if (parsimony->attributes & PLL_ATTRIB_ARCH_SSE)
- return pll_fastparsimony_edge_score_4x4_sse(parsimony,
- node1_score_index,
- node2_score_index);
-#endif
-#ifdef HAVE_AVX
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX)
- return pll_fastparsimony_edge_score_4x4_avx(parsimony,
- node1_score_index,
- node2_score_index);
-#endif
-#ifdef HAVE_AVX2
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX2)
- return pll_fastparsimony_edge_score_4x4_avx2(parsimony,
- node1_score_index,
- node2_score_index);
-#endif
- return pll_fastparsimony_edge_score_4x4(parsimony,
- node1_score_index,
- node2_score_index);
- }
-
-#ifdef HAVE_SSE3
- if (parsimony->attributes & PLL_ATTRIB_ARCH_SSE)
- return pll_fastparsimony_edge_score_sse(parsimony,
- node1_score_index,
- node2_score_index);
- else
-#endif
-#ifdef HAVE_AVX
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX)
- return pll_fastparsimony_edge_score_avx(parsimony,
- node1_score_index,
- node2_score_index);
- else
-#endif
-#ifdef HAVE_AVX2
- if (parsimony->attributes & PLL_ATTRIB_ARCH_AVX2)
- return pll_fastparsimony_edge_score_avx2(parsimony,
- node1_score_index,
- node2_score_index);
- else
-#endif
- return fastparsimony_edge_score(parsimony,
- node1_score_index,
- node2_score_index);
-
-}
-
-
-PLL_EXPORT unsigned int pll_fastparsimony_root_score(pll_parsimony_t * parsimony,
- unsigned int root_index)
-{
- return parsimony->node_cost[root_index] +
- parsimony->const_cost;
-}
diff --git a/src/fast_parsimony_avx.c b/src/fast_parsimony_avx.c
deleted file mode 100644
index 56999e8..0000000
--- a/src/fast_parsimony_avx.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- Copyright (C) 2016 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-PLL_EXPORT
-unsigned int pll_fastparsimony_edge_score_4x4_avx(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * node1[8];
- unsigned int * node2[8];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- node1[i] = vector[node1_score_index] + i*vector_count;
- node2[i] = vector[node2_score_index] + i*vector_count;
- }
-
- __m256d xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7;
-
- /* set all bits to one */
- xmm7 = (__m256d)_mm256_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- /* load, and, or bit vectors for state 0 */
- xmm0 = _mm256_load_pd((double *)(void *)(node1[0]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(node2[0]+i));
-
- xmm2 = _mm256_and_pd(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 1 */
- xmm0 = _mm256_load_pd((double *)(void *)(node1[1]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(node2[1]+i));
-
- xmm3 = _mm256_and_pd(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 2 */
- xmm0 = _mm256_load_pd((double *)(void *)(node1[2]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(node2[2]+i));
-
- xmm4 = _mm256_and_pd(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 3 */
- xmm0 = _mm256_load_pd((double *)(void *)(node1[3]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(node2[3]+i));
-
- xmm5 = _mm256_and_pd(xmm0,xmm1);
-
-
- /* OR the ANDs of states 0 and 1 */
- xmm0 = _mm256_or_pd(xmm2,xmm3);
- /* OR the ANDs of states 2 and 3 */
- xmm1 = _mm256_or_pd(xmm4,xmm5);
- /* OR The two vectors */
- xmm6 = _mm256_or_pd(xmm0,xmm1);
-
-
- xmm0 = _mm256_andnot_pd(xmm6, xmm7);
-
- _mm256_store_pd((double *)(void *)bits, xmm0);
-
-#if 0
- /* seems there is no difference in speed between popcnt32 and popcnt64 */
-
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
-
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
-
-PLL_EXPORT
-void pll_fastparsimony_update_vector_4x4_avx(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * parent[8];
- unsigned int * child1[8];
- unsigned int * child2[8];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- parent[i] = vector[op->parent_score_index] + i*vector_count;
- child1[i] = vector[op->child1_score_index] + i*vector_count;
- child2[i] = vector[op->child2_score_index] + i*vector_count;
- }
-
- __m256d xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9,xmm10,xmm11;
-
- /* set all bits to one */
- xmm11 = (__m256d)_mm256_set1_epi32(-1);
-
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- /* load, and, or bit vectors for state 0 */
- xmm0 = _mm256_load_pd((double *)(void *)(child1[0]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(child2[0]+i));
-
- xmm2 = _mm256_and_pd(xmm0,xmm1);
- xmm3 = _mm256_or_pd(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 1 */
- xmm0 = _mm256_load_pd((double *)(void *)(child1[1]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(child2[1]+i));
-
- xmm4 = _mm256_and_pd(xmm0,xmm1);
- xmm5 = _mm256_or_pd(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 2 */
- xmm0 = _mm256_load_pd((double *)(void *)(child1[2]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(child2[2]+i));
-
- xmm6 = _mm256_and_pd(xmm0,xmm1);
- xmm7 = _mm256_or_pd(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 3 */
- xmm0 = _mm256_load_pd((double *)(void *)(child1[3]+i));
- xmm1 = _mm256_load_pd((double *)(void *)(child2[3]+i));
-
- xmm8 = _mm256_and_pd(xmm0,xmm1);
- xmm9 = _mm256_or_pd(xmm0,xmm1);
-
-
- /* OR the ANDs of states 0 and 1 */
- xmm0 = _mm256_or_pd(xmm2,xmm4);
- /* OR the ANDs of states 2 and 3 */
- xmm1 = _mm256_or_pd(xmm6,xmm8);
- /* OR The two vectors */
- xmm10 = _mm256_or_pd(xmm0,xmm1);
-
-
- /* store them */
- xmm0 = _mm256_andnot_pd(xmm10,xmm3);
- xmm1 = _mm256_or_pd(xmm2,xmm0);
- _mm256_store_pd((double *)(void *)(parent[0]+i),xmm1);
-
- xmm0 = _mm256_andnot_pd(xmm10,xmm5);
- xmm1 = _mm256_or_pd(xmm4,xmm0);
- _mm256_store_pd((double *)(void *)(parent[1]+i),xmm1);
-
- xmm0 = _mm256_andnot_pd(xmm10,xmm7);
- xmm1 = _mm256_or_pd(xmm6,xmm0);
- _mm256_store_pd((double *)(void *)(parent[2]+i),xmm1);
-
- xmm0 = _mm256_andnot_pd(xmm10,xmm9);
- xmm1 = _mm256_or_pd(xmm8,xmm0);
- _mm256_store_pd((double *)(void *)(parent[3]+i),xmm1);
-
-
- xmm0 = _mm256_andnot_pd(xmm10, xmm11);
-
- _mm256_store_pd((double *)(void *)bits, xmm0);
-
-#if 0
- /* seems there is no difference in speed between popcnt32 and popcnt64 */
-
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
-
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
-
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-PLL_EXPORT
-void pll_fastparsimony_update_vector_avx(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * parent;
- unsigned int * child1;
- unsigned int * child2;
-
- unsigned int vector_count = parsimony->packedvector_count;
- unsigned int ** vector = parsimony->packedvector;
-
- unsigned int score = 0;
-
- __m256d xmm0,xmm1,xmm2,xmm3,xmm4,xmm5;
-
- /* set all bits to one */
- xmm5 = (__m256d)_mm256_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- xmm4 = _mm256_setzero_pd();
-
- /* load, and, or bit vectors for each state */
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- for (j = 0; j < states; ++j)
- {
- xmm0 = _mm256_load_pd((double *)(void *)(child1+i));
- xmm1 = _mm256_load_pd((double *)(void *)(child2+i));
-
- xmm2 = _mm256_and_pd(xmm0,xmm1);
-
- /* combine (OR) all ANDs for all states */
- xmm4 = _mm256_or_pd(xmm4,xmm2);
-
- child1 += vector_count;
- child2 += vector_count;
- }
-
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- parent = vector[op->parent_score_index];
- for (j=0; j<states; ++j)
- {
- /* load, and, or bit vectors for state j */
- xmm0 = _mm256_load_pd((double *)(void *)(child1+i));
- xmm1 = _mm256_load_pd((double *)(void *)(child2+i));
-
- xmm2 = _mm256_and_pd(xmm0,xmm1); /* vand */
- xmm3 = _mm256_or_pd(xmm0,xmm1); /* vor */
-
- xmm0 = _mm256_andnot_pd(xmm4,xmm3);
- xmm1 = _mm256_or_pd(xmm2,xmm0);
- _mm256_store_pd((double *)(void *)(parent+i),xmm1);
-
- child1 += vector_count;
- child2 += vector_count;
- parent += vector_count;
- }
- xmm0 = _mm256_andnot_pd(xmm4,xmm5);
-
- _mm256_store_pd((double *)(void *)bits, xmm0);
-
-#if 0
- /* seems there is no difference in speed between popcnt32 and popcnt64 */
-
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
-
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-PLL_EXPORT
-unsigned int pll_fastparsimony_edge_score_avx(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * node1;
- unsigned int * node2;
-
- unsigned int vector_count = parsimony->packedvector_count;
- unsigned int ** vector = parsimony->packedvector;
-
- unsigned int score = 0;
-
- __m256d xmm0,xmm1,xmm2,xmm4,xmm5;
-
- /* set all bits to one */
- xmm5 = (__m256d)_mm256_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- xmm4 = _mm256_setzero_pd();
-
- /* load, and, or bit vectors for each state */
- node1 = vector[node1_score_index];
- node2 = vector[node2_score_index];
- for (j = 0; j < states; ++j)
- {
- xmm0 = _mm256_load_pd((double *)(void *)(node1+i));
- xmm1 = _mm256_load_pd((double *)(void *)(node2+i));
-
- xmm2 = _mm256_and_pd(xmm0,xmm1);
-
- /* combine (OR) all ANDs for all states */
- xmm4 = _mm256_or_pd(xmm4,xmm2);
-
- node1 += vector_count;
- node2 += vector_count;
- }
-
- xmm0 = _mm256_andnot_pd(xmm4,xmm5);
-
- _mm256_store_pd((double *)(void *)bits, xmm0);
-
-#if 0
- /* seems there is no difference in speed between popcnt32 and popcnt64 */
-
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
diff --git a/src/fast_parsimony_avx2.c b/src/fast_parsimony_avx2.c
deleted file mode 100644
index 9c58b1b..0000000
--- a/src/fast_parsimony_avx2.c
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- Copyright (C) 2016 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-PLL_EXPORT
-unsigned int pll_fastparsimony_edge_score_4x4_avx2(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * node1[8];
- unsigned int * node2[8];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- node1[i] = vector[node1_score_index] + i*vector_count;
- node2[i] = vector[node2_score_index] + i*vector_count;
- }
-
- __m256i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7;
-
- /* set all bits to one */
- xmm7 = _mm256_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- /* load, and, or bit vectors for state 0 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(node1[0]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(node2[0]+i));
-
- xmm2 = _mm256_and_si256(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 1 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(node1[1]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(node2[1]+i));
-
- xmm3 = _mm256_and_si256(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 2 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(node1[2]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(node2[2]+i));
-
- xmm4 = _mm256_and_si256(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 3 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(node1[3]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(node2[3]+i));
-
- xmm5 = _mm256_and_si256(xmm0,xmm1);
-
-
- /* OR the ANDs of states 0 and 1 */
- xmm0 = _mm256_or_si256(xmm2,xmm3);
- /* OR the ANDs of states 2 and 3 */
- xmm1 = _mm256_or_si256(xmm4,xmm5);
- /* OR The two vectors */
- xmm6 = _mm256_or_si256(xmm0,xmm1);
-
-
- xmm0 = _mm256_andnot_si256(xmm6, xmm7);
-
- _mm256_store_si256((__m256i *)(void *)bits, xmm0);
-
-#if 0
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- //score += __builtin_popcount(((unsigned long long)bits)[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
-
-PLL_EXPORT
-void pll_fastparsimony_update_vector_4x4_avx2(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * parent[8];
- unsigned int * child1[8];
- unsigned int * child2[8];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- parent[i] = vector[op->parent_score_index] + i*vector_count;
- child1[i] = vector[op->child1_score_index] + i*vector_count;
- child2[i] = vector[op->child2_score_index] + i*vector_count;
- }
-
- __m256i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9,xmm10,xmm11;
-
- /* set all bits to one */
- xmm11 = _mm256_set1_epi32(-1);
-
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- /* load, and, or bit vectors for state 0 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(child1[0]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(child2[0]+i));
-
- xmm2 = _mm256_and_si256(xmm0,xmm1);
- xmm3 = _mm256_or_si256(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 1 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(child1[1]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(child2[1]+i));
-
- xmm4 = _mm256_and_si256(xmm0,xmm1);
- xmm5 = _mm256_or_si256(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 2 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(child1[2]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(child2[2]+i));
-
- xmm6 = _mm256_and_si256(xmm0,xmm1);
- xmm7 = _mm256_or_si256(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 3 */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(child1[3]+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(child2[3]+i));
-
- xmm8 = _mm256_and_si256(xmm0,xmm1);
- xmm9 = _mm256_or_si256(xmm0,xmm1);
-
-
- /* OR the ANDs of states 0 and 1 */
- xmm0 = _mm256_or_si256(xmm2,xmm4);
- /* OR the ANDs of states 2 and 3 */
- xmm1 = _mm256_or_si256(xmm6,xmm8);
- /* OR The two vectors */
- xmm10 = _mm256_or_si256(xmm0,xmm1);
-
-
- /* store them */
- xmm0 = _mm256_andnot_si256(xmm10,xmm3);
- xmm1 = _mm256_or_si256(xmm2,xmm0);
- _mm256_store_si256((__m256i *)(void *)(parent[0]+i),xmm1);
-
- xmm0 = _mm256_andnot_si256(xmm10,xmm5);
- xmm1 = _mm256_or_si256(xmm4,xmm0);
- _mm256_store_si256((__m256i *)(void *)(parent[1]+i),xmm1);
-
- xmm0 = _mm256_andnot_si256(xmm10,xmm7);
- xmm1 = _mm256_or_si256(xmm6,xmm0);
- _mm256_store_si256((__m256i *)(void *)(parent[2]+i),xmm1);
-
- xmm0 = _mm256_andnot_si256(xmm10,xmm9);
- xmm1 = _mm256_or_si256(xmm8,xmm0);
- _mm256_store_si256((__m256i *)(void *)(parent[3]+i),xmm1);
-
-
- xmm0 = _mm256_andnot_si256(xmm10, xmm11);
-
- _mm256_store_si256((__m256i *)(void *)bits, xmm0);
-#if 0
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- //score += __builtin_popcount(((unsigned long long)bits)[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
-
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-PLL_EXPORT
-void pll_fastparsimony_update_vector_avx2(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * parent;
- unsigned int * child1;
- unsigned int * child2;
-
- unsigned int vector_count = parsimony->packedvector_count;
- unsigned int ** vector = parsimony->packedvector;
-
- unsigned int score = 0;
-
- __m256i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5;
-
- /* set all bits to one */
- xmm5 = _mm256_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- xmm4 = _mm256_setzero_si256();
-
- /* load, and, or bit vectors for each state */
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- for (j = 0; j < states; ++j)
- {
- xmm0 = _mm256_load_si256((__m256i *)(void *)(child1+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(child2+i));
-
- xmm2 = _mm256_and_si256(xmm0,xmm1);
-
- /* combine (OR) all ANDs for all states */
- xmm4 = _mm256_or_si256(xmm4,xmm2);
-
- child1 += vector_count;
- child2 += vector_count;
- }
-
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- parent = vector[op->parent_score_index];
- for (j=0; j<states; ++j)
- {
- /* load, and, or bit vectors for state j */
- xmm0 = _mm256_load_si256((__m256i *)(void *)(child1+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(child2+i));
-
- xmm2 = _mm256_and_si256(xmm0,xmm1); /* vand */
- xmm3 = _mm256_or_si256(xmm0,xmm1); /* vor */
-
- xmm0 = _mm256_andnot_si256(xmm4,xmm3);
- xmm1 = _mm256_or_si256(xmm2,xmm0);
- _mm256_store_si256((__m256i *)(void *)(parent+i),xmm1);
-
- child1 += vector_count;
- child2 += vector_count;
- parent += vector_count;
- }
- xmm0 = _mm256_andnot_si256(xmm4,xmm5);
-
- _mm256_store_si256((__m256i *)(void *)bits, xmm0);
-
-#if 0
- /* seems there is no difference in speed between popcnt32 and popcnt64 */
-
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
-
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-PLL_EXPORT
-unsigned int pll_fastparsimony_edge_score_avx2(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
-
- unsigned int bits[32] __attribute__ ((aligned(PLL_ALIGNMENT_AVX)));
-
- unsigned int * node1;
- unsigned int * node2;
-
- unsigned int vector_count = parsimony->packedvector_count;
- unsigned int ** vector = parsimony->packedvector;
-
- unsigned int score = 0;
-
- __m256i xmm0,xmm1,xmm2,xmm4,xmm5;
-
- /* set all bits to one */
- xmm5 = _mm256_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 8)
- {
- xmm4 = _mm256_setzero_si256();
-
- /* load, and, or bit vectors for each state */
- node1 = vector[node1_score_index];
- node2 = vector[node2_score_index];
- for (j = 0; j < states; ++j)
- {
- xmm0 = _mm256_load_si256((__m256i *)(void *)(node1+i));
- xmm1 = _mm256_load_si256((__m256i *)(void *)(node2+i));
-
- xmm2 = _mm256_and_si256(xmm0,xmm1);
-
- /* combine (OR) all ANDs for all states */
- xmm4 = _mm256_or_si256(xmm4,xmm2);
-
- node1 += vector_count;
- node2 += vector_count;
- }
-
- xmm0 = _mm256_andnot_si256(xmm4,xmm5);
-
- _mm256_store_si256((__m256i *)(void *)bits, xmm0);
-
-#if 0
- /* seems there is no difference in speed between popcnt32 and popcnt64 */
-
- unsigned long long * p = (unsigned long long *)bits;
- score += __builtin_popcountl(p[0]);
- score += __builtin_popcountl(p[1]);
- score += __builtin_popcountl(p[2]);
- score += __builtin_popcountl(p[3]);
-#else
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- score += (unsigned int)__builtin_popcount(bits[4]);
- score += (unsigned int)__builtin_popcount(bits[5]);
- score += (unsigned int)__builtin_popcount(bits[6]);
- score += (unsigned int)__builtin_popcount(bits[7]);
-#endif
- }
-
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
diff --git a/src/fast_parsimony_sse.c b/src/fast_parsimony_sse.c
deleted file mode 100644
index 42daef8..0000000
--- a/src/fast_parsimony_sse.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- Copyright (C) 2016 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-PLL_EXPORT
-unsigned int pll_fastparsimony_edge_score_4x4_sse(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i;
-
- unsigned int bits[16] __attribute__ ((aligned(PLL_ALIGNMENT_SSE)));
-
- unsigned int * node1[4];
- unsigned int * node2[4];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- node1[i] = vector[node1_score_index] + i*vector_count;
- node2[i] = vector[node2_score_index] + i*vector_count;
- }
-
- __m128i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7;
-
- /* set all bits to one */
- xmm7 = _mm_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 4)
- {
- /* load, and, or bit vectors for state 0 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(node1[0]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(node2[0]+i));
-
- xmm2 = _mm_and_si128(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 1 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(node1[1]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(node2[1]+i));
-
- xmm3 = _mm_and_si128(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 2 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(node1[2]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(node2[2]+i));
-
- xmm4 = _mm_and_si128(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 3 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(node1[3]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(node2[3]+i));
-
- xmm5 = _mm_and_si128(xmm0,xmm1);
-
-
- /* OR the ANDs of states 0 and 1 */
- xmm0 = _mm_or_si128(xmm2,xmm3);
- /* OR the ANDs of states 2 and 3 */
- xmm1 = _mm_or_si128(xmm4,xmm5);
- /* OR The two vectors */
- xmm6 = _mm_or_si128(xmm0,xmm1);
-
-
- xmm0 = _mm_andnot_si128(xmm6, xmm7);
-
- _mm_store_si128((__m128i *)(void *)bits, xmm0);
-
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- }
-
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
-
-PLL_EXPORT
-void pll_fastparsimony_update_vector_4x4_sse(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i;
-
- unsigned int bits[16] __attribute__ ((aligned(PLL_ALIGNMENT_SSE)));
-
- unsigned int * parent[4];
- unsigned int * child1[4];
- unsigned int * child2[4];
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- /* point to the parsimony vectors for each node and for each state */
- for (i = 0; i < 4; ++i)
- {
- parent[i] = vector[op->parent_score_index] + i*vector_count;
- child1[i] = vector[op->child1_score_index] + i*vector_count;
- child2[i] = vector[op->child2_score_index] + i*vector_count;
- }
-
- __m128i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5,xmm6,xmm7,xmm8,xmm9,xmm10,xmm11;
-
- /* set all bits to one */
- xmm11 = _mm_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 4)
- {
- /* load, and, or bit vectors for state 0 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(child1[0]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(child2[0]+i));
-
- xmm2 = _mm_and_si128(xmm0,xmm1);
- xmm3 = _mm_or_si128(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 1 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(child1[1]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(child2[1]+i));
-
- xmm4 = _mm_and_si128(xmm0,xmm1);
- xmm5 = _mm_or_si128(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 2 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(child1[2]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(child2[2]+i));
-
- xmm6 = _mm_and_si128(xmm0,xmm1);
- xmm7 = _mm_or_si128(xmm0,xmm1);
-
- /* load, and, or bit vectors for state 3 */
- xmm0 = _mm_load_si128((__m128i *)(void *)(child1[3]+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(child2[3]+i));
-
- xmm8 = _mm_and_si128(xmm0,xmm1);
- xmm9 = _mm_or_si128(xmm0,xmm1);
-
-
- /* OR the ANDs of states 0 and 1 */
- xmm0 = _mm_or_si128(xmm2,xmm4);
- /* OR the ANDs of states 2 and 3 */
- xmm1 = _mm_or_si128(xmm6,xmm8);
- /* OR The two vectors */
- xmm10 = _mm_or_si128(xmm0,xmm1);
-
-
- /* store them */
- xmm0 = _mm_andnot_si128(xmm10,xmm3);
- xmm1 = _mm_or_si128(xmm2,xmm0);
- _mm_store_si128((__m128i *)(void *)(parent[0]+i),xmm1);
-
- xmm0 = _mm_andnot_si128(xmm10,xmm5);
- xmm1 = _mm_or_si128(xmm4,xmm0);
- _mm_store_si128((__m128i *)(void *)(parent[1]+i),xmm1);
-
- xmm0 = _mm_andnot_si128(xmm10,xmm7);
- xmm1 = _mm_or_si128(xmm6,xmm0);
- _mm_store_si128((__m128i *)(void *)(parent[2]+i),xmm1);
-
- xmm0 = _mm_andnot_si128(xmm10,xmm9);
- xmm1 = _mm_or_si128(xmm8,xmm0);
- _mm_store_si128((__m128i *)(void *)(parent[3]+i),xmm1);
-
-
- xmm0 = _mm_andnot_si128(xmm10, xmm11);
-
- _mm_store_si128((__m128i *)(void *)bits, xmm0);
-
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- }
-
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
-
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-PLL_EXPORT
-void pll_fastparsimony_update_vector_sse(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
-
- unsigned int bits[16] __attribute__ ((aligned(PLL_ALIGNMENT_SSE)));
-
- unsigned int * parent;
- unsigned int * child1;
- unsigned int * child2;
-
- unsigned int ** vector = parsimony->packedvector;
- unsigned int vector_count = parsimony->packedvector_count;
-
- unsigned int score = 0;
-
- __m128i xmm0,xmm1,xmm2,xmm3,xmm4,xmm5;
-
- /* set all bits to one */
- xmm5 = _mm_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 4)
- {
- xmm4 = _mm_setzero_si128();
-
- /* load, and, or bit vectors for state 0 */
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- for (j = 0; j < states; ++j)
- {
- xmm0 = _mm_load_si128((__m128i *)(void *)(child1+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(child2+i));
-
- xmm2 = _mm_and_si128(xmm0,xmm1);
-
- /* combine (OR) all ANDs for all states */
- xmm4 = _mm_or_si128(xmm4,xmm2);
-
- child1 += vector_count;
- child2 += vector_count;
- }
-
- child1 = vector[op->child1_score_index];
- child2 = vector[op->child2_score_index];
- parent = vector[op->parent_score_index];
- for (j=0; j<states; ++j)
- {
- /* load, and, or bit vectors for state j */
- xmm0 = _mm_load_si128((__m128i *)(void *)(child1+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(child2+i));
-
- xmm2 = _mm_and_si128(xmm0,xmm1); /* vand */
- xmm3 = _mm_or_si128(xmm0,xmm1); /* vor */
-
- xmm0 = _mm_andnot_si128(xmm4,xmm3);
- xmm1 = _mm_or_si128(xmm2,xmm0);
- _mm_store_si128((__m128i *)(void *)(parent+i),xmm1);
-
- child1 += vector_count;
- child2 += vector_count;
- parent += vector_count;
- }
- xmm0 = _mm_andnot_si128(xmm4,xmm5);
-
- _mm_store_si128((__m128i *)(void *)bits, xmm0);
-
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- }
-
- unsigned int score1 = parsimony->node_cost[op->child1_score_index];
- unsigned int score2 = parsimony->node_cost[op->child2_score_index];
-
- parsimony->node_cost[op->parent_score_index] = score+score1+score2;
-}
-
-PLL_EXPORT
-unsigned int pll_fastparsimony_edge_score_sse(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index)
-{
- unsigned int i,j;
- unsigned int states = parsimony->states;
-
- unsigned int bits[16] __attribute__ ((aligned(PLL_ALIGNMENT_SSE)));
-
- unsigned int * node1;
- unsigned int * node2;
-
- unsigned int vector_count = parsimony->packedvector_count;
- unsigned int ** vector = parsimony->packedvector;
-
- unsigned int score = 0;
-
- __m128i xmm0,xmm1,xmm2,xmm4,xmm5;
-
- /* set all bits to one */
- xmm5 = _mm_set1_epi32(-1);
-
- for (i = 0; i < parsimony->packedvector_count; i += 4)
- {
- xmm4 = _mm_setzero_si128();
-
- /* load, and, or bit vectors for each state */
- node1 = vector[node1_score_index];
- node2 = vector[node2_score_index];
- for (j = 0; j < states; ++j)
- {
- xmm0 = _mm_load_si128((__m128i *)(void *)(node1+i));
- xmm1 = _mm_load_si128((__m128i *)(void *)(node2+i));
-
- xmm2 = _mm_and_si128(xmm0,xmm1);
-
- /* combine (OR) all ANDs for all states */
- xmm4 = _mm_or_si128(xmm4,xmm2);
-
- node1 += vector_count;
- node2 += vector_count;
- }
-
- xmm0 = _mm_andnot_si128(xmm4,xmm5);
-
- _mm_store_si128((__m128i *)(void *)bits, xmm0);
-
- score += (unsigned int)__builtin_popcount(bits[0]);
- score += (unsigned int)__builtin_popcount(bits[1]);
- score += (unsigned int)__builtin_popcount(bits[2]);
- score += (unsigned int)__builtin_popcount(bits[3]);
- }
-
- unsigned int score1 = parsimony->node_cost[node1_score_index];
- unsigned int score2 = parsimony->node_cost[node2_score_index];
-
- return score+score1+score2+parsimony->const_cost;
-}
diff --git a/src/lex_phylip.l b/src/lex_phylip.l
index 58fe93c..e798568 100644
--- a/src/lex_phylip.l
+++ b/src/lex_phylip.l
@@ -64,33 +64,30 @@ static char * append(size_t * dstlen, const char * src, size_t srclen)
%%
<quot>{
-\\\" { append(&string_length, "\"", 1); }
-\' { append(&string_length, "\'", 1); }
-\" { BEGIN(INITIAL); return STRING; }
+\\\" append(&string_length, "\"", 1);
+\' append(&string_length, "\'", 1);
+\" {BEGIN(INITIAL);return STRING;}
}
<apos>{
-\\\' { append(&string_length, "\'", 1); }
-\" { append(&string_length, "\"", 1); }
-\' { BEGIN(INITIAL); return STRING; }
+\\\' append(&string_length, "\'", 1);
+\" append(&string_length, "\"", 1);
+\' {BEGIN(INITIAL);return STRING;}
}
<apos,quot>{
-\\n { append(&string_length, "\n", 1); }
-\\t { append(&string_length, "\t", 1); }
-\\\\ { append(&string_length, "\\", 1); }
-([^\"\'\\]|\n)+ { append(&string_length, pll_phylip_text, pll_phylip_leng); }
+\\n append(&string_length, "\n", 1);
+\\t append(&string_length, "\t", 1);
+\\\\ append(&string_length, "\\", 1);
+([^\"\'\\]|\n)+ append(&string_length, pll_phylip_text, pll_phylip_leng);
}
-\" { string_length = 0; pll_phylip_lval.s = NULL; BEGIN(quot); }
-\' { string_length =0; pll_phylip_lval.s = NULL; ;BEGIN(apos); }
-([^\t\n\r ])+ { pll_phylip_lval.s=xstrndup(pll_phylip_text,pll_phylip_leng);
- return STRING; }
-[ \t\n\r]*\#[^\n]* {
- ; }
-[ \t\n\r] { ; }
-. { snprintf(pll_errmsg, 200,
- "Syntax error (%c)\n", pll_phylip_text[0]);
- pll_errno = PLL_ERROR_PHYLIP_SYNTAX;
- return PLL_FAILURE; }
+\" {string_length =0; pll_phylip_lval.s = NULL; ;BEGIN(quot);}
+\' {string_length =0; pll_phylip_lval.s = NULL; ;BEGIN(apos);}
+([a-zA-Z_0-9]|(\.|\-|\^|\?))+ {pll_phylip_lval.s = xstrndup(pll_phylip_text, pll_phylip_leng); return STRING;}
+[ \t\n\r]*\#[^\n]* ;
+[ \t\n\r] ;
+. {snprintf(pll_errmsg, 200, "Syntax error (%c)\n", pll_phylip_text[0]);
+ pll_errno = PLL_ERROR_PHYLIP_SYNTAX;
+ return PLL_FAILURE;}
%%
diff --git a/src/lex_rtree.l b/src/lex_rtree.l
index 91157ac..3182564 100644
--- a/src/lex_rtree.l
+++ b/src/lex_rtree.l
@@ -79,44 +79,38 @@ static char * append(size_t * dstlen, const char * src, size_t srclen)
%%
<quot>{
-\\\" { append(&string_length, "\\\"", 2); }
-\' { append(&string_length, "\'", 1); }
-\" { BEGIN(INITIAL); return STRING; }
+\\\" {append(&string_length, "\\\"", 2);}
+\' {append(&string_length, "\'", 1);}
+\" {BEGIN(INITIAL);return STRING;}
}
<apos>{
-\\\' { append(&string_length, "\\\'", 2); }
-\" { append(&string_length, "\"", 1); }
-\' { BEGIN(INITIAL); return STRING; }
+\\\' {append(&string_length, "\\\'", 2);}
+\" {append(&string_length, "\"", 1);}
+\' {BEGIN(INITIAL);return STRING;}
}
<apos,quot>{
-\\n { append(&string_length, "\\n", 2); }
-\\t { append(&string_length, "\\t", 2); }
-\\ { append(&string_length, "\\", 1); }
-\\\\ { append(&string_length, "\\\\", 2); }
-([^\"\'\\]|\n)+ { append(&string_length, pll_rtree_text, pll_rtree_leng); }
+\\n {append(&string_length, "\\n", 2);}
+\\t {append(&string_length, "\\t", 2);}
+\\ {append(&string_length, "\\", 1);}
+\\\\ {append(&string_length, "\\\\", 2);}
+([^\"\'\\]|\n)+ {append(&string_length, pll_rtree_text, pll_rtree_leng);}
}
-\: { return COLON; }
-\; { return SEMICOLON; }
-\) { return CPAR; }
-\( { return OPAR; }
-\, { return COMMA; }
-\" { string_length = 0; BEGIN(quot); }
-\' { string_length = 0; BEGIN(apos); }
-\n { pll_rtree_colstart = pll_rtree_colend = 0; }
-[-+]?[0-9]+ { pll_rtree_lval.d = xstrndup(pll_rtree_text,pll_rtree_leng);
- return NUMBER; }
-[+-]?(([0-9]+[\.]?[0-9]*)|([0-9]*[\.]?[0-9]+))([eE][+-]?[0-9]+)? {
- pll_rtree_lval.d = xstrndup(pll_rtree_text,pll_rtree_leng);
- return NUMBER; }
-[^ \'\",\(\):;\[\]\t\n\r][^ \t\n\r\)\(\[\]\,:;]* {
- pll_rtree_lval.s = xstrndup(pll_rtree_text,pll_rtree_leng);
- return STRING; }
-[ \t\r] { ; }
-. { snprintf(pll_errmsg, 200,
- "Syntax error (%c)\n", pll_rtree_text[0]);
- pll_errno = PLL_ERROR_NEWICK_SYNTAX;
- return PLL_FAILURE; }
+\: return COLON;
+\; return SEMICOLON;
+\) return CPAR;
+\( return OPAR;
+\, return COMMA;
+\" {string_length = 0; BEGIN(quot);}
+\' {string_length = 0; BEGIN(apos);}
+\n {pll_rtree_colstart = pll_rtree_colend = 0;}
+[\+|\-]?[0-9]+ {pll_rtree_lval.d = xstrndup(pll_rtree_text, pll_rtree_leng); return NUMBER;}
+[\+|\-]?[0-9]+\.[0-9]+([e|E][\+|\-]?[0-9]+)? {pll_rtree_lval.d = xstrndup(pll_rtree_text, pll_rtree_leng); return NUMBER;}
+[^ \'\",\(\):;\[\]\t\n\r][^ \t\n\r\)\(\[\]\,:;]* {pll_rtree_lval.s = xstrndup(pll_rtree_text, pll_rtree_leng); return STRING;}
+[ \t\r] ;
+. {snprintf(pll_errmsg, 200, "Syntax error (%c)\n", pll_rtree_text[0]);
+ pll_errno = PLL_ERROR_NEWICK_SYNTAX;
+ return PLL_FAILURE;}
%%
diff --git a/src/lex_utree.l b/src/lex_utree.l
index c820aca..3cc91ae 100644
--- a/src/lex_utree.l
+++ b/src/lex_utree.l
@@ -79,44 +79,38 @@ static char * append(size_t * dstlen, const char * src, size_t srclen)
%%
<quot>{
-\\\" { append(&string_length, "\\\"", 2); }
-\' { append(&string_length, "\'", 1); }
-\" { BEGIN(INITIAL); return STRING; }
+\\\" {append(&string_length, "\\\"", 2);}
+\' {append(&string_length, "\'", 1);}
+\" {BEGIN(INITIAL);return STRING;}
}
<apos>{
-\\\' { append(&string_length, "\\\'", 2); }
-\" { append(&string_length, "\"", 1); }
-\' { BEGIN(INITIAL);return STRING;}
+\\\' {append(&string_length, "\\\'", 2);}
+\" {append(&string_length, "\"", 1);}
+\' {BEGIN(INITIAL);return STRING;}
}
<apos,quot>{
-\\n { append(&string_length, "\\n", 2); }
-\\t { append(&string_length, "\\t", 2); }
-\\ { append(&string_length, "\\", 1); }
-\\\\ { append(&string_length, "\\\\", 2); }
-([^\"\'\\]|\n)+ { append(&string_length, pll_utree_text, pll_utree_leng); }
+\\n {append(&string_length, "\\n", 2);}
+\\t {append(&string_length, "\\t", 2);}
+\\ {append(&string_length, "\\", 1);}
+\\\\ {append(&string_length, "\\\\", 2);}
+([^\"\'\\]|\n)+ {append(&string_length, pll_utree_text, pll_utree_leng);}
}
-\: { return COLON; }
-\; { return SEMICOLON; }
-\) { return CPAR; }
-\( { return OPAR; }
-\, { return COMMA; }
-\" { string_length = 0; BEGIN(quot); }
-\' { string_length = 0; BEGIN(apos); }
-\n { pll_utree_colstart = pll_utree_colend = 0; }
-[-+]?[0-9]+ { pll_utree_lval.d = xstrndup(pll_utree_text,pll_utree_leng);
- return NUMBER; }
-[+-]?(([0-9]+[\.]?[0-9]*)|([0-9]*[\.]?[0-9]+))([eE][+-]?[0-9]+)? {
- pll_utree_lval.d = xstrndup(pll_utree_text,pll_utree_leng);
- return NUMBER; }
-[^ \'\",\(\):;\[\]\t\n\r][^ \t\n\r\)\(\[\]\,:;]* {
- pll_utree_lval.s = xstrndup(pll_utree_text,pll_utree_leng);
- return STRING; }
-[ \t\r] { ; }
-. { snprintf(pll_errmsg, 200,
- "Syntax error (%c)\n", pll_utree_text[0]);
- pll_errno = PLL_ERROR_NEWICK_SYNTAX;
- return PLL_FAILURE; }
+\: return COLON;
+\; return SEMICOLON;
+\) return CPAR;
+\( return OPAR;
+\, return COMMA;
+\" {string_length = 0; BEGIN(quot);}
+\' {string_length = 0; BEGIN(apos);}
+\n {pll_utree_colstart = pll_utree_colend = 0;}
+[\+|\-]?[0-9]+ {pll_utree_lval.d = xstrndup(pll_utree_text, pll_utree_leng); return NUMBER;}
+[\+|\-]?[0-9]+\.[0-9]+([e|E][\+|\-]?[0-9]+)? {pll_utree_lval.d = xstrndup(pll_utree_text, pll_utree_leng); return NUMBER;}
+[^ \'\",\(\):;\[\]\t\n\r][^ \t\n\r\)\(\[\]\,:;]* {pll_utree_lval.s = xstrndup(pll_utree_text, pll_utree_leng); return STRING;}
+[ \t\r] ;
+. {snprintf(pll_errmsg, 200, "Syntax error (%c)\n", pll_utree_text[0]);
+ pll_errno = PLL_ERROR_NEWICK_SYNTAX;
+ return PLL_FAILURE;}
%%
diff --git a/src/likelihood.c b/src/likelihood.c
index 0f82bd3..f6301f6 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -68,9 +68,6 @@ static double root_loglikelihood_asc_bias(pll_partition_t * partition,
unsigned int sum_w_inv = 0;
int asc_bias_type = partition->attributes & PLL_ATTRIB_AB_MASK;
- /* point clvp to state sites */
- clv += partition->sites * partition->rate_cats * partition->states_padded;
-
/* 1. compute per-site logl for each state */
for (i = 0; i < states; ++i)
{
@@ -149,7 +146,7 @@ PLL_EXPORT double pll_compute_root_loglikelihood(pll_partition_t * partition,
partition->attributes);
-
+
/* ascertainment bias correction */
if (partition->attributes & PLL_ATTRIB_AB_MASK)
@@ -184,19 +181,12 @@ static double edge_loglikelihood_asc_bias_ti(pll_partition_t * partition,
unsigned int states = partition->states;
unsigned int states_padded = partition->states_padded;
unsigned int scale_factors;
- unsigned int * pattern_weights = partition->pattern_weights;
- double * rate_weights = partition->rate_weights;
+ double * weights = partition->rate_weights;
double logl_correction = 0;
unsigned int sum_w_inv = 0;
int asc_bias_type = partition->attributes & PLL_ATTRIB_AB_MASK;
- /* point clvp to state sites */
- clvp += partition->sites * partition->rate_cats * partition->states_padded;
- pattern_weights += partition->sites;
- if (parent_scaler)
- parent_scaler += partition->sites;
-
/* 1. compute per-site logl for each state */
for (n = 0; n < partition->states; ++n)
{
@@ -212,18 +202,18 @@ static double edge_loglikelihood_asc_bias_ti(pll_partition_t * partition,
pmatrix += states_padded;
}
- terma += terma_r * rate_weights[i];
+ terma += terma_r * weights[i];
clvp += states_padded;
}
/* count number of scaling factors to acount for */
- scale_factors = (parent_scaler) ? parent_scaler[n] : 0;
+ scale_factors = (parent_scaler) ? parent_scaler[partition->sites + n] : 0;
- sum_w_inv += pattern_weights[n];
+ sum_w_inv += partition->pattern_weights[partition->sites + n];
if (asc_bias_type == PLL_ATTRIB_AB_STAMATAKIS)
{
/* 2a. site_lk is the lnl weighted by the number of occurences */
- site_lk = log(terma) * pattern_weights[n];
+ site_lk = log(terma) * partition->pattern_weights[partition->sites + n];
if (scale_factors)
site_lk += scale_factors * log(PLL_SCALE_THRESHOLD);
}
@@ -290,7 +280,6 @@ static double edge_loglikelihood_tipinner(pll_partition_t * partition,
parent_scaler,
partition->tipchars[child_clv_index],
partition->tipmap,
- partition->maxstates,
partition->pmatrix[matrix_index],
partition->frequencies,
partition->rate_weights,
@@ -340,17 +329,15 @@ static double edge_loglikelihood_asc_bias_ii(pll_partition_t * partition,
double * rate_weights = partition->rate_weights;
/* point clv, clvc, scalers and pattern weights to state sites */
- unsigned int offset = partition->sites *
+ unsigned int offset = partition->sites *
partition->rate_cats *
partition->states_padded;
pattern_weights += partition->sites;
clvp += offset;
clvc += offset;
- if (parent_scaler)
- parent_scaler += partition->sites;
- if (child_scaler)
- child_scaler += partition->sites;
+ parent_scaler += partition->sites;
+ child_scaler += partition->sites;
double logl_correction = 0;
unsigned int sum_w_inv = 0;
@@ -409,7 +396,7 @@ static double edge_loglikelihood_asc_bias_ii(pll_partition_t * partition,
partition->pattern_weight_sum,
sum_w_inv,
asc_bias_type);
-
+
return logl;
}
@@ -511,3 +498,4 @@ PLL_EXPORT double pll_compute_edge_loglikelihood(pll_partition_t * partition,
return logl;
}
+
diff --git a/src/maps.c b/src/maps.c
index 004af7c..0f9b5e9 100644
--- a/src/maps.c
+++ b/src/maps.c
@@ -103,10 +103,10 @@ const unsigned int pll_map_aa[256] =
/*
map for fasta parsing
- legal symbols: ?*- 0123456789 abcdefghijklmnopqrstuvxyz (also upper case)
- fatal symbols: period (.), ascii 0-8, ascii 14-31
- silently stripped: tab (9), newline (10 and 13), vt (11), formfeed (12)
- stripped: !"#$&'()+,/:;<=>@^_`æøåÆØŧ¨´
+ legal symbols: *abcdefghiklmnpqrstuvxyz (all except j and o), also upper case
+ fatal symbols: .-
+ fatal: ascii 0-26 except tab (9), newline (10 and 13), vt (11), formfeed (12)
+ stripped: !"#$&'()+,/0123456789:;<=>?@JO^_`joæøåÆØŧ¨´ as well as chrs 9-13
includes both amino acid and nucleotide sequences, adapt to nt only
*/
@@ -119,23 +119,22 @@ const unsigned int pll_map_fasta[256] =
P Q R S T U V W X Y Z [ \ ] ^ _
*/
-/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 2, /* 0 */
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, /* 2 */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, /* 3 */
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4 */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 5 */
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, /* 6 */
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, /* 7 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 8 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9 */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
/* GTR protein substitution rate parameters (values above main diagonal) */
diff --git a/src/models.c b/src/models.c
index 6081283..bf2f677 100644
--- a/src/models.c
+++ b/src/models.c
@@ -445,13 +445,14 @@ PLL_EXPORT int pll_update_invariant_sites_proportion(pll_partition_t * partition
PLL_EXPORT unsigned int pll_count_invariant_sites(pll_partition_t * partition,
unsigned int * state_inv_count)
{
+ int inv_site;
unsigned int i,j,k;
unsigned int invariant_count = 0;
unsigned int tips = partition->tips;
unsigned int sites = partition->sites;
unsigned int states = partition->states;
unsigned int gap_state = 0;
- unsigned int cur_state;
+ unsigned int state;
int * invariant = partition->invariant;
double * tipclv;
@@ -472,15 +473,15 @@ PLL_EXPORT unsigned int pll_count_invariant_sites(pll_partition_t * partition,
{
if (invariant[i] > -1)
{
- cur_state = invariant[i];
+ state = invariant[i];
/* since the invariant sites array is generated in the library,
it should not contain invalid values */
- assert (cur_state < states);
+ assert (state < states);
/* increase the counter and per-state count */
- invariant_count += partition->pattern_weights[i];
+ invariant_count++;
if (state_inv_count)
- state_inv_count[cur_state]++;
+ state_inv_count[state]++;
}
}
}
@@ -488,22 +489,52 @@ PLL_EXPORT unsigned int pll_count_invariant_sites(pll_partition_t * partition,
{
if (partition->attributes & PLL_ATTRIB_PATTERN_TIP)
{
- for (j = 0; j < sites; ++j)
+ if (states == 4)
{
- cur_state = gap_state;
- for (i = 0; i < tips; ++i)
+ for (j = 0; j < sites; ++j)
{
- cur_state &= ((unsigned int)(partition->tipchars[i][j]));
- if (!cur_state)
+ state = (unsigned int)(partition->tipchars[0][j]);
+ if (state >= gap_state || __builtin_popcount(state) > 1)
+ continue;
+ inv_site = 1;
+ for (i = 1; i < tips; ++i)
{
- break;
+ if ((unsigned int)(partition->tipchars[i][j]) != state)
+ {
+ inv_site = 0;
+ break;
+ }
+ }
+ if (inv_site)
+ {
+ invariant_count++;
+ if (state_inv_count)
+ state_inv_count[__builtin_ctz(state)]++;
}
}
- if (__builtin_popcount(cur_state) == 1)
+ }
+ else
+ {
+ for (j = 0; j < sites; ++j)
{
- invariant_count += partition->pattern_weights[j];
- if (state_inv_count)
- state_inv_count[__builtin_ctz(cur_state)]++;
+ state = partition->tipmap[(int)(partition->tipchars[0][j])];
+ if (state >= gap_state || __builtin_popcount(state) > 1)
+ continue;
+ inv_site = 1;
+ for (i = 1; i < tips; ++i)
+ {
+ if (partition->tipmap[(int)(partition->tipchars[i][j])] != state)
+ {
+ inv_site = 0;
+ break;
+ }
+ }
+ if (inv_site)
+ {
+ invariant_count++;
+ if (state_inv_count)
+ state_inv_count[__builtin_ctz(state)]++;
+ }
}
}
}
@@ -520,24 +551,31 @@ PLL_EXPORT unsigned int pll_count_invariant_sites(pll_partition_t * partition,
{
unsigned int clv_shift = j*span_padded;
tipclv = partition->clv[0] + clv_shift;
- unsigned int state = gap_state;
+ state = 0;
+ for (k = 0; k < states; ++k)
+ {
+ state |= ((unsigned int)tipclv[k] << k);
+ }
+ if (__builtin_popcount(state) > 1)
+ continue;
+ inv_site = 1;
for (i = 0; i < tips; ++i)
{
+ unsigned int cur_state = 0;
tipclv = partition->clv[i] + clv_shift;
- cur_state = 0;
for (k = 0; k < states; ++k)
{
cur_state |= ((unsigned int)tipclv[k] << k);
}
- state &= cur_state;
- if (!state)
+ if (cur_state != state)
{
+ inv_site = 0;
break;
}
}
- if (__builtin_popcount(state) == 1)
+ if (inv_site)
{
- invariant_count += partition->pattern_weights[j];
+ invariant_count++;
if (state_inv_count)
state_inv_count[__builtin_ctz(state)]++;
}
@@ -582,10 +620,10 @@ PLL_EXPORT int pll_update_invariant_sites(pll_partition_t * partition)
invariant = partition->invariant;
/* initialize all elements to zero */
- memset(partition->invariant, gap_state, sites*sizeof(int));
+ memset(partition->invariant, 0, sites*sizeof(int));
/* depending on the attribute flag, fill each element of the invariant array
- with the bitwise AND of gap and all states in the corresponding site */
+ with the bitwise OR of all states in the corresponding site */
if (partition->attributes & PLL_ATTRIB_PATTERN_TIP)
{
if (states == 4)
@@ -594,7 +632,8 @@ PLL_EXPORT int pll_update_invariant_sites(pll_partition_t * partition)
for (j = 0; j < sites; ++j)
{
state = (unsigned int)(partition->tipchars[i][j]);
- invariant[j] &= state;
+ if (state < gap_state)
+ invariant[j] |= state;
}
}
else
@@ -603,13 +642,15 @@ PLL_EXPORT int pll_update_invariant_sites(pll_partition_t * partition)
for (j = 0; j < sites; ++j)
{
state = partition->tipmap[(int)(partition->tipchars[i][j])];
- invariant[j] &= state;
+ if (state < gap_state)
+ invariant[j] |= state;
}
}
}
else
{
unsigned int span_padded = rate_cats * states_padded;
+
for (i = 0; i < tips; ++i)
{
tipclv = partition->clv[i];
@@ -620,7 +661,8 @@ PLL_EXPORT int pll_update_invariant_sites(pll_partition_t * partition)
{
state |= ((unsigned int)tipclv[k] << k);
}
- invariant[j] &= state;
+ if (state < gap_state)
+ invariant[j] |= state;
tipclv += span_padded;
}
}
diff --git a/src/parse_phylip.y b/src/parse_phylip.y
index ec7ac9a..72c5a20 100644
--- a/src/parse_phylip.y
+++ b/src/parse_phylip.y
@@ -47,31 +47,16 @@ PLL_EXPORT void pll_msa_destroy(pll_msa_t * msa)
int i;
- if (msa->label)
+ for (i = 0; i < seq_count; ++i)
{
- for (i = 0; i < msa->count; ++i)
- free(msa->label[i]);
- free(msa->label);
- }
-
- if (msa->sequence)
- {
- for (i = 0; i < msa->count; ++i)
- free(msa->sequence[i]);
- free(msa->sequence);
+ free(msa->sequence[i]);
+ free(msa->label[i]);
}
+ free(msa->sequence);
+ free(msa->label);
free(msa);
}
-
-void msa_destroy(pll_msa_t * msa)
-{
- if (msa)
- {
- msa->count = seq_count;
- pll_msa_destroy(msa);
- }
-}
%}
%union
@@ -83,7 +68,7 @@ void msa_destroy(pll_msa_t * msa)
%error-verbose
%parse-param {pll_msa_t ** msa}
-%destructor { msa_destroy($$); } msa
+%destructor { pll_msa_destroy($$); } msa
%token<s> STRING
%type<msa> msa
@@ -220,14 +205,14 @@ PLL_EXPORT pll_msa_t * pll_phylip_parse_msa(const char * filename,
pll_phylip_in = fopen(filename, "r");
if (!pll_phylip_in)
{
- msa_destroy(msa);
+ pll_msa_destroy(msa);
pll_errno = PLL_ERROR_FILE_OPEN;
snprintf(pll_errmsg, 200, "Unable to open file (%s)", filename);
return PLL_FAILURE;
}
else if (pll_phylip_parse(&msa))
{
- msa_destroy(msa);
+ pll_msa_destroy(msa);
msa = NULL;
fclose(pll_phylip_in);
pll_phylip_lex_destroy();
diff --git a/src/parse_rtree.y b/src/parse_rtree.y
index e77d52e..c44f33a 100644
--- a/src/parse_rtree.y
+++ b/src/parse_rtree.y
@@ -28,25 +28,14 @@ extern int pll_rtree_lineno;
extern int pll_rtree_colstart;
extern int pll_rtree_colend;
-extern int pll_rtree_parse();
-extern struct pll_rtree_buffer_state * pll_rtree__scan_string(const char * str);
-extern void pll_rtree__delete_buffer(struct pll_rtree_buffer_state * buffer);
-
static unsigned int tip_cnt = 0;
-PLL_EXPORT void pll_rtree_destroy(pll_rtree_t * root,
- void (*cb_destroy)(void *))
+PLL_EXPORT void pll_rtree_destroy(pll_rtree_t * root)
{
if (!root) return;
- pll_rtree_destroy(root->left, cb_destroy);
- pll_rtree_destroy(root->right, cb_destroy);
-
- if (root->data)
- {
- if (cb_destroy)
- cb_destroy(root->data);
- }
+ pll_rtree_destroy(root->left);
+ pll_rtree_destroy(root->right);
free(root->label);
free(root);
@@ -75,10 +64,7 @@ static void pll_rtree_error(pll_rtree_t * tree, const char * s)
%error-verbose
%parse-param {struct pll_rtree * tree}
-%destructor { pll_rtree_destroy($$,NULL); } subtree
-%destructor { free($$); } STRING
-%destructor { free($$); } NUMBER
-%destructor { free($$); } label
+%destructor { pll_rtree_destroy($$); } subtree
%token OPAR
%token CPAR
@@ -211,24 +197,19 @@ PLL_EXPORT pll_rtree_t * pll_rtree_parse_newick(const char * filename,
/* reset tip count */
tip_cnt = 0;
- if (!(tree = (pll_rtree_t *)calloc(1, sizeof(pll_rtree_t))))
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return PLL_FAILURE;
- }
+ tree = (pll_rtree_t *)calloc(1, sizeof(pll_rtree_t));
pll_rtree_in = fopen(filename, "r");
if (!pll_rtree_in)
{
- pll_rtree_destroy(tree,NULL);
+ pll_rtree_destroy(tree);
pll_errno = PLL_ERROR_FILE_OPEN;
snprintf(pll_errmsg, 200, "Unable to open file (%s)", filename);
return PLL_FAILURE;
}
else if (pll_rtree_parse(tree))
{
- pll_rtree_destroy(tree,NULL);
+ pll_rtree_destroy(tree);
tree = NULL;
fclose(pll_rtree_in);
pll_rtree_lex_destroy();
@@ -247,38 +228,43 @@ PLL_EXPORT pll_rtree_t * pll_rtree_parse_newick(const char * filename,
return tree;
}
-PLL_EXPORT pll_rtree_t * pll_rtree_parse_newick_string(const char * s,
+#ifdef __linux__
+PLL_EXPORT pll_rtree_t * pll_rtree_parse_newick_string(char * s,
unsigned int * tip_count)
{
- int rc;
struct pll_rtree * tree;
/* reset tip count */
- tip_count = 0;
+ tip_cnt = 0;
+
+ tree = (pll_rtree_t *)calloc(1, sizeof(pll_rtree_t));
- if (!(tree = (pll_rtree_t *)calloc(1, sizeof(pll_rtree_t))))
+ pll_rtree_in = fmemopen(s, strlen(s), "r");
+ if (!pll_rtree_in)
+ {
+ pll_rtree_destroy(tree);
+ pll_errno = PLL_ERROR_FILE_OPEN;
+ snprintf(pll_errmsg, 200, "Unable to map string (%s)", s);
+ return PLL_FAILURE;
+ }
+ else if (pll_rtree_parse(tree))
{
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
+ pll_rtree_destroy(tree);
+ tree = NULL;
+ fclose(pll_rtree_in);
+ pll_rtree_lex_destroy();
return PLL_FAILURE;
}
- struct pll_rtree_buffer_state * buffer = pll_rtree__scan_string(s);
- rc = pll_rtree_parse(tree);
- pll_rtree__delete_buffer(buffer);
+ if (pll_rtree_in) fclose(pll_rtree_in);
pll_rtree_lex_destroy();
- if (!rc)
- {
- *tip_count = tip_cnt;
-
- /* initialize clv and scaler indices */
- assign_indices(tree, tip_cnt);
+ *tip_count = tip_cnt;
- return tree;
- }
+ /* initialize clv and scaler indices */
+ assign_indices(tree, tip_cnt);
- free(tree);
- return NULL;
+ return tree;
}
+#endif
diff --git a/src/parse_utree.y b/src/parse_utree.y
index 5d01b62..f177c5d 100644
--- a/src/parse_utree.y
+++ b/src/parse_utree.y
@@ -28,23 +28,9 @@ extern int pll_utree_lineno;
extern int pll_utree_colstart;
extern int pll_utree_colend;
-extern int pll_utree_parse();
-extern struct pll_utree_buffer_state * pll_utree__scan_string(const char * str);
-extern void pll_utree__delete_buffer(struct pll_utree_buffer_state * buffer);
-
static unsigned int tip_cnt = 0;
-static void dealloc_data(pll_utree_t * node, void (*cb_destroy)(void *))
-{
- if (node->data)
- {
- if (cb_destroy)
- cb_destroy(node->data);
- }
-}
-
-static void dealloc_tree_recursive(pll_utree_t * node,
- void (*cb_destroy)(void *))
+static void dealloc_tree_recursive(pll_utree_t * node)
{
if (!node->next)
{
@@ -53,13 +39,8 @@ static void dealloc_tree_recursive(pll_utree_t * node,
return;
}
- dealloc_tree_recursive(node->next->back, cb_destroy);
- dealloc_tree_recursive(node->next->next->back, cb_destroy);
-
- /* deallocate any extra data */
- dealloc_data(node,cb_destroy);
- dealloc_data(node->next,cb_destroy);
- dealloc_data(node->next->next,cb_destroy);
+ dealloc_tree_recursive(node->next->back);
+ dealloc_tree_recursive(node->next->next->back);
free(node->next->next);
free(node->next);
@@ -67,8 +48,7 @@ static void dealloc_tree_recursive(pll_utree_t * node,
free(node);
}
-PLL_EXPORT void pll_utree_destroy(pll_utree_t * root,
- void (*cb_destroy)(void *))
+PLL_EXPORT void pll_utree_destroy(pll_utree_t * root)
{
if (!root) return;
if (!(root->next))
@@ -79,19 +59,13 @@ PLL_EXPORT void pll_utree_destroy(pll_utree_t * root,
}
if (root->next)
- dealloc_tree_recursive(root->next->back,cb_destroy);
+ dealloc_tree_recursive(root->next->back);
if (root->next->next)
- dealloc_tree_recursive(root->next->next->back,cb_destroy);
+ dealloc_tree_recursive(root->next->next->back);
if (root->back)
- dealloc_tree_recursive(root->back,cb_destroy);
-
- /* deallocate any extra data */
- dealloc_data(root,cb_destroy);
- dealloc_data(root->next,cb_destroy);
- dealloc_data(root->next->next,cb_destroy);
+ dealloc_tree_recursive(root->back);
free(root->label);
-
free(root->next->next);
free(root->next);
free(root);
@@ -119,11 +93,7 @@ static void pll_utree_error(pll_utree_t * tree, const char * s)
%error-verbose
%parse-param {struct pll_utree * tree}
-%destructor { pll_utree_destroy($$,NULL); } subtree
-%destructor { free($$); } STRING
-%destructor { free($$); } NUMBER
-%destructor { free($$); } label
-
+%destructor { pll_utree_destroy($$); } subtree
%token OPAR
%token CPAR
@@ -314,14 +284,14 @@ PLL_EXPORT pll_utree_t * pll_utree_parse_newick(const char * filename,
pll_utree_in = fopen(filename, "r");
if (!pll_utree_in)
{
- pll_utree_destroy(tree,NULL);
+ pll_utree_destroy(tree);
pll_errno = PLL_ERROR_FILE_OPEN;
snprintf(pll_errmsg, 200, "Unable to open file (%s)", filename);
return PLL_FAILURE;
}
else if (pll_utree_parse(tree))
{
- pll_utree_destroy(tree,NULL);
+ pll_utree_destroy(tree);
tree = NULL;
fclose(pll_utree_in);
pll_utree_lex_destroy();
@@ -340,38 +310,43 @@ PLL_EXPORT pll_utree_t * pll_utree_parse_newick(const char * filename,
return tree;
}
-PLL_EXPORT pll_utree_t * pll_utree_parse_newick_string(const char * s,
+#ifdef __linux__
+PLL_EXPORT pll_utree_t * pll_utree_parse_newick_string(char * s,
unsigned int * tip_count)
{
- int rc;
struct pll_utree * tree;
/* reset tip count */
- tip_count = 0;
+ tip_cnt = 0;
- if (!(tree = (pll_utree_t *)calloc(1, sizeof(pll_utree_t))))
+ tree = (pll_utree_t *)calloc(1, sizeof(pll_utree_t));
+
+ pll_utree_in = fmemopen(s, strlen(s), "r");
+ if (!pll_utree_in)
+ {
+ pll_utree_destroy(tree);
+ pll_errno = PLL_ERROR_FILE_OPEN;
+ snprintf(pll_errmsg, 200, "Unable to map string (%s)", s);
+ return PLL_FAILURE;
+ }
+ else if (pll_utree_parse(tree))
{
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
+ pll_utree_destroy(tree);
+ tree = NULL;
+ fclose(pll_utree_in);
+ pll_utree_lex_destroy();
return PLL_FAILURE;
}
- struct pll_utree_buffer_state * buffer = pll_utree__scan_string(s);
- rc = pll_utree_parse(tree);
- pll_utree__delete_buffer(buffer);
+ if (pll_utree_in) fclose(pll_utree_in);
pll_utree_lex_destroy();
- if (!rc)
- {
- *tip_count = tip_cnt;
-
- /* initialize clv and scaler indices */
- pll_utree_reset_template_indices(tree, tip_cnt);
+ *tip_count = tip_cnt;
- return tree;
- }
+ /* initialize clv and scaler indices */
+ pll_utree_reset_template_indices(tree, tip_cnt);
- free(tree);
- return NULL;
+ return tree;
}
+#endif
diff --git a/src/parsimony.c b/src/parsimony.c
index 1046801..fc35933 100644
--- a/src/parsimony.c
+++ b/src/parsimony.c
@@ -66,49 +66,32 @@ PLL_EXPORT int pll_set_parsimony_sequence(pll_parsimony_t * pars,
return PLL_SUCCESS;
}
-PLL_EXPORT void pll_parsimony_destroy(pll_parsimony_t * parsimony)
+static void dealloc_pars_data(pll_parsimony_t * pars)
{
unsigned int i;
- unsigned int nodes_count = parsimony->tips + parsimony->inner_nodes;
- if (!parsimony) return;
+ if (!pars) return;
- /* deallocate fast parsimony structures */
- if (parsimony->packedvector)
+ /* deallocate score buffers */
+ if (pars->sbuffer)
{
- for (i=0; i < nodes_count; ++i)
- pll_aligned_free(parsimony->packedvector[i]);
- free(parsimony->packedvector);
+ for (i = 0; i < pars->score_buffers + pars->tips; ++i)
+ free(pars->sbuffer[i]);
+ free(pars->sbuffer);
}
- if (parsimony->node_cost)
- free(parsimony->node_cost);
-
- if (parsimony->informative)
- free(parsimony->informative);
-
- /* if available, deallocate structures for weighted parsimony */
-
- /* score buffers */
- if (parsimony->sbuffer)
+ /* deallocate ancestral state buffers */
+ if (pars->anc_states)
{
- for (i = 0; i < parsimony->score_buffers + parsimony->tips; ++i)
- free(parsimony->sbuffer[i]);
- free(parsimony->sbuffer);
+ for (i = pars->tips; i < pars->ancestral_buffers+pars->tips; ++i)
+ free(pars->anc_states[i]);
+ free(pars->anc_states);
}
- /* ancestral state buffers */
- if (parsimony->anc_states)
- {
- for (i=parsimony->tips; i<parsimony->ancestral_buffers+parsimony->tips; ++i)
- free(parsimony->anc_states[i]);
- free(parsimony->anc_states);
- }
+ /* deallocate scoring matrix */
+ if (pars->score_matrix) free(pars->score_matrix);
- /* scoring matrix */
- if (parsimony->score_matrix) free(parsimony->score_matrix);
-
- free(parsimony);
+ free(pars);
}
PLL_EXPORT pll_parsimony_t * pll_parsimony_create(unsigned int tips,
@@ -121,7 +104,7 @@ PLL_EXPORT pll_parsimony_t * pll_parsimony_create(unsigned int tips,
unsigned int i;
/* create parsimony instance */
- pll_parsimony_t * pars = (pll_parsimony_t *)calloc(1,sizeof(pll_parsimony_t));
+ pll_parsimony_t * pars = (pll_parsimony_t *)malloc(sizeof(pll_parsimony_t));
if (!pars)
{
pll_errno = PLL_ERROR_MEM_ALLOC;
@@ -140,7 +123,7 @@ PLL_EXPORT pll_parsimony_t * pll_parsimony_create(unsigned int tips,
pars->score_matrix = (double *)calloc(states*states, sizeof(double));
if (!pars->score_matrix)
{
- pll_parsimony_destroy(pars);
+ dealloc_pars_data(pars);
pll_errno = PLL_ERROR_MEM_ALLOC;
snprintf(pll_errmsg, 200,
"Unable to allocate enough memory for scoring matrix.");
@@ -152,7 +135,7 @@ PLL_EXPORT pll_parsimony_t * pll_parsimony_create(unsigned int tips,
pars->sbuffer = (double **)calloc(score_buffers+tips, sizeof(double *));
if (!pars->sbuffer)
{
- pll_parsimony_destroy(pars);
+ dealloc_pars_data(pars);
pll_errno = PLL_ERROR_MEM_ALLOC;
snprintf(pll_errmsg, 200,
"Unable to allocate enough memory for score buffers.");
@@ -163,7 +146,7 @@ PLL_EXPORT pll_parsimony_t * pll_parsimony_create(unsigned int tips,
pars->sbuffer[i] = (double *)calloc(sites*states, sizeof(double *));
if (!pars->sbuffer[i])
{
- pll_parsimony_destroy(pars);
+ dealloc_pars_data(pars);
pll_errno = PLL_ERROR_MEM_ALLOC;
snprintf(pll_errmsg, 200,
"Unable to allocate enough memory for score buffers.");
@@ -176,7 +159,7 @@ PLL_EXPORT pll_parsimony_t * pll_parsimony_create(unsigned int tips,
sizeof(unsigned int *));
if (!pars->anc_states)
{
- pll_parsimony_destroy(pars);
+ dealloc_pars_data(pars);
pll_errno = PLL_ERROR_MEM_ALLOC;
snprintf(pll_errmsg, 200,
"Unable to allocate enough memory for score buffers.");
@@ -187,7 +170,7 @@ PLL_EXPORT pll_parsimony_t * pll_parsimony_create(unsigned int tips,
pars->anc_states[i] = (unsigned int *)calloc(sites, sizeof(unsigned int));
if (!pars->anc_states[i])
{
- pll_parsimony_destroy(pars);
+ dealloc_pars_data(pars);
pll_errno = PLL_ERROR_MEM_ALLOC;
snprintf(pll_errmsg, 200,
"Unable to allocate enough memory for score buffers.");
@@ -378,3 +361,8 @@ PLL_EXPORT void pll_parsimony_reconstruct(pll_parsimony_t * pars,
}
}
}
+
+PLL_EXPORT void pll_parsimony_destroy(pll_parsimony_t * pars)
+{
+ dealloc_pars_data(pars);
+}
diff --git a/src/partials.c b/src/partials.c
index e95c077..6237059 100644
--- a/src/partials.c
+++ b/src/partials.c
@@ -122,7 +122,6 @@ static void case_tipinner(pll_partition_t * partition,
partition->pmatrix[inner_matrix_index],
right_scaler,
partition->tipmap,
- partition->maxstates,
partition->attributes);
}
diff --git a/src/pll.c b/src/pll.c
index d3a4691..c9f79df 100644
--- a/src/pll.c
+++ b/src/pll.c
@@ -424,7 +424,7 @@ PLL_EXPORT pll_partition_t * pll_partition_create(unsigned int tips,
partition->alignment = PLL_ALIGNMENT_CPU;
partition->attributes = attributes;
partition->states_padded = states;
-#ifdef HAVE_SSE3
+#ifdef HAVE_SSE
if (attributes & PLL_ATTRIB_ARCH_SSE)
{
partition->alignment = PLL_ALIGNMENT_SSE;
@@ -438,14 +438,6 @@ PLL_EXPORT pll_partition_t * pll_partition_create(unsigned int tips,
partition->states_padded = (states+3) & 0xFFFFFFFC;
}
#endif
-#ifdef HAVE_AVX2
- if (attributes & PLL_ATTRIB_ARCH_AVX2)
- {
- partition->alignment = PLL_ALIGNMENT_AVX;
- partition->states_padded = (states+3) & 0xFFFFFFFC;
- }
-#endif
-
unsigned int states_padded = partition->states_padded;
/* initialize properties */
@@ -790,9 +782,7 @@ PLL_EXPORT pll_partition_t * pll_partition_create(unsigned int tips,
}
for (i = 0; i < partition->scale_buffers; ++i)
{
- size_t scaler_size = (attributes & PLL_ATTRIB_RATE_SCALERS) ?
- sites_alloc * rate_cats : sites_alloc;
- partition->scale_buffer[i] = (unsigned int *)calloc(scaler_size,
+ partition->scale_buffer[i] = (unsigned int *)calloc(sites_alloc,
sizeof(unsigned int));
if (!partition->scale_buffer[i])
{
@@ -875,18 +865,13 @@ static int set_tipchars(pll_partition_t * partition,
/* if asc_bias is set, we initialize the additional positions */
if (partition->asc_bias_alloc)
{
- /* this part needs to be fixed */
- /* tip chars should go in the same order as expected, or the pattern
- weights for the invariant sites would not match the correct character.
- For example, the expected order of amino acids is A,R,N,..., and the
- tipchars order is 1,16,13,... (i.e., not sequential) */
- assert(0);
for (i = 0; i < partition->states; ++i)
{
partition->tipchars[tip_index][partition->sites + i] =
- (unsigned char)i+1;
+ partition->charmap[i];
}
}
+
return PLL_SUCCESS;
}
diff --git a/src/pll.h b/src/pll.h
index 7d675d0..13387d2 100644
--- a/src/pll.h
+++ b/src/pll.h
@@ -68,9 +68,6 @@
#define PLL_SCALE_THRESHOLD_SQRT (1.0/PLL_SCALE_FACTOR_SQRT)
#define PLL_SCALE_BUFFER_NONE -1
#define PLL_MISC_EPSILON 1e-8
-#define PLL_ONE_EPSILON 1e-15
-#define PLL_ONE_MIN (1-PLL_ONE_EPSILON)
-#define PLL_ONE_MAX (1+PLL_ONE_EPSILON)
/* attribute flags */
@@ -90,8 +87,6 @@
#define PLL_ATTRIB_AB_MASK (7 << 5)
#define PLL_ATTRIB_AB_FLAG (1 << 8)
-#define PLL_ATTRIB_RATE_SCALERS (1 << 9)
-
/* topological rearrangements */
#define PLL_UTREE_MOVE_SPR 1
@@ -125,9 +120,7 @@
#define PLL_ERROR_SPR_NOCHANGE 120
#define PLL_ERROR_NNI_INVALIDMOVE 121
#define PLL_ERROR_NNI_TERMINALBRANCH 122
-#define PLL_ERROR_STEPWISE_STRUCT 123
-#define PLL_ERROR_STEPWISE_TIPS 124
-#define PLL_ERROR_STEPWISE_UNSUPPORTED 125
+
/* utree specific */
@@ -185,6 +178,7 @@ typedef struct pll_partition
int asc_bias_alloc;
} pll_partition_t;
+
/* Structure for driving likelihood operations */
typedef struct pll_operation
@@ -199,6 +193,7 @@ typedef struct pll_operation
int child2_scaler_index;
} pll_operation_t;
+
/* Doubly-linked list */
typedef struct pll_dlist
@@ -293,31 +288,17 @@ typedef struct pll_utree_rb_s
typedef struct pll_parsimony_s
{
- /* common information */
unsigned int tips;
- unsigned int inner_nodes;
- unsigned int sites;
unsigned int states;
- unsigned int attributes;
- size_t alignment;
-
- /* fast unweighted parsimony */
- unsigned int ** packedvector;
- unsigned int * node_cost;
- unsigned int packedvector_count;
- unsigned int const_cost;
- int * informative;
- unsigned int informative_count;
-
- /* weighted parsimony */
+ unsigned int sites;
unsigned int score_buffers;
unsigned int ancestral_buffers;
+
double * score_matrix;
double ** sbuffer;
unsigned int ** anc_states;
} pll_parsimony_t;
-
typedef struct pll_pars_buildop_s
{
unsigned int parent_score_index;
@@ -515,8 +496,6 @@ PLL_EXPORT void pll_update_partials(pll_partition_t * partition,
PLL_EXPORT int pll_update_sumtable(pll_partition_t * partition,
unsigned int parent_clv_index,
unsigned int child_clv_index,
- int parent_scaler_index,
- int child_scaler_index,
const unsigned int * params_indices,
double *sumtable);
@@ -568,31 +547,33 @@ PLL_EXPORT int pll_fasta_rewind(pll_fasta_t * fd);
PLL_EXPORT pll_rtree_t * pll_rtree_parse_newick(const char * filename,
unsigned int * tip_count);
-PLL_EXPORT pll_rtree_t * pll_rtree_parse_newick_string(const char * s,
+#ifdef __linux__
+PLL_EXPORT pll_rtree_t * pll_rtree_parse_newick_string(char * s,
unsigned int * tip_count);
+#endif
-PLL_EXPORT void pll_rtree_destroy(pll_rtree_t * root,
- void (*cb_destroy)(void *));
+PLL_EXPORT void pll_rtree_destroy(pll_rtree_t * root);
/* functions in parse_utree.y */
PLL_EXPORT pll_utree_t * pll_utree_parse_newick(const char * filename,
unsigned int * tip_count);
-PLL_EXPORT pll_utree_t * pll_utree_parse_newick_string(const char * s,
+#ifdef __linux__
+PLL_EXPORT pll_utree_t * pll_utree_parse_newick_string(char * s,
unsigned int * tip_count);
+#endif
-PLL_EXPORT void pll_utree_destroy(pll_utree_t * root,
- void (*cb_destroy)(void *));
+PLL_EXPORT void pll_utree_destroy(pll_utree_t * root);
PLL_EXPORT void pll_utree_reset_template_indices(pll_utree_t * node,
unsigned int tip_count);
/* functions in utree.c */
-PLL_EXPORT void pll_utree_show_ascii(const pll_utree_t * tree, int options);
+PLL_EXPORT void pll_utree_show_ascii(pll_utree_t * tree, int options);
-PLL_EXPORT char * pll_utree_export_newick(const pll_utree_t * root);
+PLL_EXPORT char * pll_utree_export_newick(pll_utree_t * root);
PLL_EXPORT int pll_utree_traverse(pll_utree_t * root,
int (*cbtrav)(pll_utree_t *),
@@ -619,10 +600,7 @@ PLL_EXPORT pll_utree_t * pll_utree_clone(pll_utree_t * root);
PLL_EXPORT pll_utree_t * pll_rtree_unroot(pll_rtree_t * root);
PLL_EXPORT int pll_utree_every(pll_utree_t * node,
int (*cb)(pll_utree_t *));
-PLL_EXPORT void pll_utree_create_pars_buildops(pll_utree_t ** trav_buffer,
- unsigned int trav_buffer_size,
- pll_pars_buildop_t * ops,
- unsigned int * ops_count);
+
/* functions in parse_phylip.y */
PLL_EXPORT pll_msa_t * pll_phylip_parse_msa(const char * filename,
@@ -632,9 +610,9 @@ PLL_EXPORT void pll_msa_destroy(pll_msa_t * msa);
/* functions in rtree.c */
-PLL_EXPORT void pll_rtree_show_ascii(const pll_rtree_t * tree, int options);
+PLL_EXPORT void pll_rtree_show_ascii(pll_rtree_t * tree, int options);
-PLL_EXPORT char * pll_rtree_export_newick(const pll_rtree_t * root);
+PLL_EXPORT char * pll_rtree_export_newick(pll_rtree_t * root);
PLL_EXPORT int pll_rtree_traverse(pll_rtree_t * root,
int (*cbtrav)(pll_rtree_t *),
@@ -704,7 +682,6 @@ PLL_EXPORT void pll_core_update_partial_ti(unsigned int states,
const double * right_matrix,
const unsigned int * right_scaler,
const unsigned int * tipmap,
- unsigned int tipmap_size,
unsigned int attrib);
PLL_EXPORT void pll_core_update_partial_ii(unsigned int states,
@@ -762,8 +739,6 @@ PLL_EXPORT int pll_core_update_sumtable_ii(unsigned int states,
unsigned int rate_cats,
const double * parent_clv,
const double * child_clv,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
@@ -775,12 +750,10 @@ PLL_EXPORT int pll_core_update_sumtable_ti(unsigned int states,
unsigned int rate_cats,
const double * parent_clv,
const unsigned char * left_tipchars,
- const unsigned int * parent_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
unsigned int * tipmap,
- unsigned int tipmap_size,
double *sumtable,
unsigned int attrib);
@@ -828,7 +801,6 @@ PLL_EXPORT double pll_core_edge_loglikelihood_ti(unsigned int states,
const unsigned int * parent_scaler,
const unsigned char * tipchars,
const unsigned int * tipmap,
- unsigned int tipmap_size,
const double * pmatrix,
double ** frequencies,
const double * rate_weights,
@@ -870,7 +842,6 @@ PLL_EXPORT double pll_core_root_loglikelihood(unsigned int states,
/* functions in core_partials_sse.c */
-#ifdef HAVE_SSE3
PLL_EXPORT void pll_core_create_lookup_sse(unsigned int states,
unsigned int rate_cats,
double * ttlookup,
@@ -912,8 +883,7 @@ PLL_EXPORT void pll_core_update_partial_ti_sse(unsigned int states,
const double * left_matrix,
const double * right_matrix,
const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size);
+ const unsigned int * tipmap);
PLL_EXPORT void pll_core_update_partial_ti_4x4_sse(unsigned int sites,
@@ -948,11 +918,9 @@ PLL_EXPORT void pll_core_update_partial_ii_4x4_sse(unsigned int sites,
const double * right_matrix,
const unsigned int * left_scaler,
const unsigned int * right_scaler);
-#endif
/* functions in core_partials_avx.c */
-#ifdef HAVE_AVX
PLL_EXPORT void pll_core_create_lookup_avx(unsigned int states,
unsigned int rate_cats,
double * lookup,
@@ -966,13 +934,6 @@ PLL_EXPORT void pll_core_create_lookup_4x4_avx(unsigned int rate_cats,
const double * left_matrix,
const double * right_matrix);
-PLL_EXPORT void pll_core_create_lookup_20x20_avx(unsigned int rate_cats,
- double * ttlookup,
- const double * left_matrix,
- const double * right_matrix,
- unsigned int * tipmap,
- unsigned int tipmap_size);
-
PLL_EXPORT void pll_core_update_partial_tt_avx(unsigned int states,
unsigned int sites,
unsigned int rate_cats,
@@ -981,8 +942,7 @@ PLL_EXPORT void pll_core_update_partial_tt_avx(unsigned int states,
const unsigned char * left_tipchars,
const unsigned char * right_tipchars,
const double * lookup,
- unsigned int tipstates_count,
- unsigned int attrib);
+ unsigned int tipstates_count);
PLL_EXPORT void pll_core_update_partial_tt_4x4_avx(unsigned int sites,
unsigned int rate_cats,
@@ -990,8 +950,7 @@ PLL_EXPORT void pll_core_update_partial_tt_4x4_avx(unsigned int sites,
unsigned int * parent_scaler,
const unsigned char * left_tipchars,
const unsigned char * right_tipchars,
- const double * lookup,
- unsigned int attrib);
+ const double * lookup);
PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
unsigned int sites,
@@ -1003,9 +962,7 @@ PLL_EXPORT void pll_core_update_partial_ti_avx(unsigned int states,
const double * left_matrix,
const double * right_matrix,
const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- unsigned int attrib);
+ const unsigned int * tipmap);
PLL_EXPORT void pll_core_update_partial_ti_4x4_avx(unsigned int sites,
unsigned int rate_cats,
@@ -1015,20 +972,7 @@ PLL_EXPORT void pll_core_update_partial_ti_4x4_avx(unsigned int sites,
const double * right_clv,
const double * left_matrix,
const double * right_matrix,
- const unsigned int * right_scaler,
- unsigned int attrib);
-
-PLL_EXPORT void pll_core_update_partial_ti_20x20_avx(unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const unsigned char * left_tipchar,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size);
+ const unsigned int * right_scaler);
PLL_EXPORT void pll_core_update_partial_ii_avx(unsigned int states,
unsigned int sites,
@@ -1040,8 +984,7 @@ PLL_EXPORT void pll_core_update_partial_ii_avx(unsigned int states,
const double * left_matrix,
const double * right_matrix,
const unsigned int * left_scaler,
- const unsigned int * right_scaler,
- unsigned int attrib);
+ const unsigned int * right_scaler);
PLL_EXPORT void pll_core_update_partial_ii_4x4_avx(unsigned int sites,
unsigned int rate_cats,
@@ -1052,58 +995,10 @@ PLL_EXPORT void pll_core_update_partial_ii_4x4_avx(unsigned int sites,
const double * left_matrix,
const double * right_matrix,
const unsigned int * left_scaler,
- const unsigned int * right_scaler,
- unsigned int attrib);
-#endif
-
-/* functions in core_partials_avx2.c */
-
-#ifdef HAVE_AVX2
-PLL_EXPORT void pll_core_update_partial_ti_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const unsigned char * left_tipchars,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- unsigned int attrib);
-
-PLL_EXPORT
-void pll_core_update_partial_ti_20x20_avx2(unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const unsigned char * left_tipchar,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * right_scaler,
- const unsigned int * tipmap,
- unsigned int tipmap_size);
-
-PLL_EXPORT void pll_core_update_partial_ii_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- double * parent_clv,
- unsigned int * parent_scaler,
- const double * left_clv,
- const double * right_clv,
- const double * left_matrix,
- const double * right_matrix,
- const unsigned int * left_scaler,
- const unsigned int * right_scaler,
- unsigned int attrib);
-#endif
-
+ const unsigned int * right_scaler);
/* functions in core_derivatives_sse.c */
-#ifdef HAVE_SSE3
PLL_EXPORT int pll_core_update_sumtable_ii_sse(unsigned int states,
unsigned int sites,
unsigned int rate_cats,
@@ -1125,104 +1020,83 @@ PLL_EXPORT int pll_core_update_sumtable_ti_sse(unsigned int states,
unsigned int * tipmap,
double *sumtable);
-#endif
+PLL_EXPORT int pll_core_update_sumtable_ti_4x4_sse(unsigned int sites,
+ unsigned int rate_cats,
+ const double * parent_clv,
+ const unsigned char * left_tipchars,
+ double ** eigenvecs,
+ double ** inv_eigenvecs,
+ double ** freqs,
+ unsigned int * tipmap,
+ double *sumtable);
/* functions in core_derivatives_avx.c */
-#ifdef HAVE_AVX
+PLL_EXPORT int pll_core_update_sumtable_ii_4x4_avx(unsigned int sites,
+ unsigned int rate_cats,
+ const double * clvp,
+ const double * clvc,
+ double ** eigenvecs,
+ double ** inv_eigenvecs,
+ double ** freqs,
+ double * sumtable);
PLL_EXPORT int pll_core_update_sumtable_ii_avx(unsigned int states,
unsigned int sites,
unsigned int rate_cats,
const double * clvp,
const double * clvc,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
- double * sumtable,
- unsigned int attrib);
+ double * sumtable);
PLL_EXPORT int pll_core_update_sumtable_ti_avx(unsigned int states,
unsigned int sites,
unsigned int rate_cats,
const double * parent_clv,
const unsigned char * left_tipchars,
- const unsigned int * parent_scaler,
double ** eigenvecs,
double ** inv_eigenvecs,
double ** freqs,
unsigned int * tipmap,
- unsigned int tipmap_size,
double * sumtable,
unsigned int attrib);
-PLL_EXPORT int pll_core_likelihood_derivatives_avx(unsigned int states,
- unsigned int states_padded,
- unsigned int rate_cats,
- unsigned int ef_sites,
- const unsigned int * pattern_weights,
- const double * rate_weights,
- const int * invariant,
- const double * prop_invar,
- double ** freqs,
- const double * sumtable,
- const double * diagptable,
- double * d_f,
- double * dd_f);
-#endif
-
-/* functions in core_derivatives_avx2.c */
-
-#ifdef HAVE_AVX2
-
-PLL_EXPORT int pll_core_update_sumtable_ii_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * clvp,
- const double * clvc,
- const unsigned int * parent_scaler,
- const unsigned int * child_scaler,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- double ** freqs,
- double *sumtable,
- unsigned int attrib);
-
-PLL_EXPORT int pll_core_update_sumtable_ti_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned char * left_tipchars,
- const unsigned int * parent_scaler,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- double ** freqs,
- unsigned int * tipmap,
- unsigned int tipmap_size,
- double *sumtable,
- unsigned int attrib);
+PLL_EXPORT void core_site_likelihood_derivatives_avx(unsigned int states,
+ unsigned int states_padded,
+ unsigned int rate_cats,
+ const double * rate_weights,
+ const double * prop_invar,
+ const double * lk_invar,
+ const double * sumtable,
+ const double * diagptable,
+ double * site_lk);
-PLL_EXPORT
-int pll_core_likelihood_derivatives_avx2(unsigned int states,
- unsigned int states_padded,
- unsigned int rate_cats,
- unsigned int ef_sites,
- const unsigned int * pattern_weights,
- const double * rate_weights,
- const int * invariant,
- const double * prop_invar,
- double ** freqs,
- const double * sumtable,
- const double * diagptable,
- double * d_f,
- double * dd_f);
-#endif
+PLL_EXPORT void core_site_likelihood_derivatives_4x4_avx(unsigned int rate_cats,
+ const double * rate_weights,
+ const double * prop_invar,
+ const double * lk_invar,
+ const double * sumtable,
+ const double * diagptable,
+ double * site_lk);
+
+PLL_EXPORT int core_likelihood_derivatives_avx(unsigned int states,
+ unsigned int states_padded,
+ unsigned int rate_cats,
+ unsigned int ef_sites,
+ const unsigned int * pattern_weights,
+ const double * rate_weights,
+ const int * invariant,
+ const double * prop_invar,
+ double ** freqs,
+ const double * sumtable,
+ const double * diagptable,
+ double * d_f,
+ double * dd_f);
/* functions in core_likelihood_sse.c */
-#ifdef HAVE_SSE3
PLL_EXPORT
double pll_core_edge_loglikelihood_ii_sse(unsigned int states,
unsigned int sites,
@@ -1312,11 +1186,9 @@ PLL_EXPORT double pll_core_root_loglikelihood_sse(unsigned int states,
const int * invar_indices,
const unsigned int * freqs_indices,
double * persite_lnl);
-#endif
/* functions in core_likelihood_avx.c */
-#ifdef HAVE_AVX
PLL_EXPORT double pll_core_edge_loglikelihood_ii_avx(unsigned int states,
unsigned int sites,
unsigned int rate_cats,
@@ -1346,8 +1218,7 @@ PLL_EXPORT double pll_core_edge_loglikelihood_ii_4x4_avx(unsigned int sites,
const double * invar_proportion,
const int * invar_indices,
const unsigned int * freqs_indices,
- double * persite_lnl,
- unsigned int attrib);
+ double * persite_lnl);
PLL_EXPORT double pll_core_edge_loglikelihood_ti_4x4_avx(unsigned int sites,
unsigned int rate_cats,
@@ -1361,24 +1232,7 @@ PLL_EXPORT double pll_core_edge_loglikelihood_ti_4x4_avx(unsigned int sites,
const double * invar_proportion,
const int * invar_indices,
const unsigned int * freqs_indices,
- double * persite_lnl,
- unsigned int attrib);
-
-PLL_EXPORT double pll_core_edge_loglikelihood_ti_20x20_avx(unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned int * parent_scaler,
- const unsigned char * tipchars,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- const double * pmatrix,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl);
+ double * persite_lnl);
PLL_EXPORT double pll_core_edge_loglikelihood_ti_avx(unsigned int states,
unsigned int sites,
@@ -1420,61 +1274,6 @@ PLL_EXPORT double pll_core_root_loglikelihood_avx(unsigned int states,
const int * invar_indices,
const unsigned int * freqs_indices,
double * persite_lnl);
-#endif
-
-
-/* functions in core_likelihood_avx2.c */
-
-#ifdef HAVE_AVX2
-PLL_EXPORT
-double pll_core_root_loglikelihood_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * clv,
- const unsigned int * scaler,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl);
-
-PLL_EXPORT
-double pll_core_edge_loglikelihood_ti_20x20_avx2(unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned int * parent_scaler,
- const unsigned char * tipchars,
- const unsigned int * tipmap,
- unsigned int tipmap_size,
- const double * pmatrix,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl);
-
-
-PLL_EXPORT
-double pll_core_edge_loglikelihood_ii_avx2(unsigned int states,
- unsigned int sites,
- unsigned int rate_cats,
- const double * parent_clv,
- const unsigned int * parent_scaler,
- const double * child_clv,
- const unsigned int * child_scaler,
- const double * pmatrix,
- double ** frequencies,
- const double * rate_weights,
- const unsigned int * pattern_weights,
- const double * invar_proportion,
- const int * invar_indices,
- const unsigned int * freqs_indices,
- double * persite_lnl);
-#endif
/* functions in core_pmatrix.c */
@@ -1492,25 +1291,8 @@ PLL_EXPORT int pll_core_update_pmatrix(double ** pmatrix,
unsigned int count,
unsigned int attrib);
-/* functions in core_pmatrix_avx2.c */
-
-#ifdef HAVE_AVX2
-PLL_EXPORT int pll_core_update_pmatrix_20x20_avx2(double ** pmatrix,
- unsigned int rate_cats,
- double * rates,
- const double * branch_lengths,
- const unsigned int * matrix_indices,
- const unsigned int * params_indices,
- double * prop_invar,
- double ** eigenvals,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- unsigned int count);
-#endif
-
/* functions in core_pmatrix_avx.c */
-#ifdef HAVE_AVX
PLL_EXPORT int pll_core_update_pmatrix_4x4_avx(double ** pmatrix,
unsigned int rate_cats,
double * rates,
@@ -1523,22 +1305,8 @@ PLL_EXPORT int pll_core_update_pmatrix_4x4_avx(double ** pmatrix,
double ** inv_eigenvecs,
unsigned int count);
-PLL_EXPORT int pll_core_update_pmatrix_20x20_avx(double ** pmatrix,
- unsigned int rate_cats,
- double * rates,
- const double * branch_lengths,
- const unsigned int * matrix_indices,
- const unsigned int * params_indices,
- double * prop_invar,
- double ** eigenvals,
- double ** eigenvecs,
- double ** inv_eigenvecs,
- unsigned int count);
-#endif
-
/* functions in core_pmatrix_sse.c */
-#ifdef HAVE_SSE3
PLL_EXPORT int pll_core_update_pmatrix_4x4_sse(double ** pmatrix,
unsigned int rate_cats,
double * rates,
@@ -1550,7 +1318,6 @@ PLL_EXPORT int pll_core_update_pmatrix_4x4_sse(double ** pmatrix,
double ** eigenvecs,
double ** inv_eigenvecs,
unsigned int count);
-#endif
/* functions in compress.c */
@@ -1616,91 +1383,10 @@ PLL_EXPORT pll_svg_attrib_t * pll_svg_attrib_create(void);
PLL_EXPORT void pll_svg_attrib_destroy(pll_svg_attrib_t * attrib);
PLL_EXPORT int pll_utree_export_svg(pll_utree_t * tree,
- unsigned int tip_count,
+ unsigned int tip_count,
const pll_svg_attrib_t * attribs,
const char * filename);
-/* functions in fast_parsimony.c */
-
-PLL_EXPORT pll_parsimony_t * pll_fastparsimony_init(pll_partition_t * partition);
-
-PLL_EXPORT void pll_fastparsimony_update_vectors(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * ops,
- unsigned int count);
-
-PLL_EXPORT unsigned int pll_fastparsimony_root_score(pll_parsimony_t * parsimony,
- unsigned int root_index);
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-PLL_EXPORT void pll_fastparsimony_update_vector_4x4(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_4x4(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-PLL_EXPORT void pll_fastparsimony_update_vector(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-/* functions in fast_parsimony_sse.c */
-
-PLL_EXPORT void pll_fastparsimony_update_vector_4x4_sse(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_4x4_sse(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_sse(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-PLL_EXPORT void pll_fastparsimony_update_vector_sse(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-/* functions in fast_parsimony_avx.c */
-
-PLL_EXPORT void pll_fastparsimony_update_vector_4x4_avx(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_4x4_avx(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-PLL_EXPORT void pll_fastparsimony_update_vector_avx(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_avx(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-/* functions in fast_parsimony_avx2.c */
-
-PLL_EXPORT void pll_fastparsimony_update_vector_4x4_avx2(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_4x4_avx2(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-PLL_EXPORT void pll_fastparsimony_update_vector_avx2(pll_parsimony_t * parsimony,
- const pll_pars_buildop_t * op);
-
-PLL_EXPORT unsigned int pll_fastparsimony_edge_score_avx2(pll_parsimony_t * parsimony,
- unsigned int node1_score_index,
- unsigned int node2_score_index);
-
-/* functions in stepwise.c */
-
-PLL_EXPORT pll_utree_t * pll_fastparsimony_stepwise(pll_parsimony_t ** list,
- char ** labels,
- unsigned int * score,
- unsigned int count,
- unsigned int seed);
#ifdef __cplusplus
} /* extern "C" */
#endif
diff --git a/src/rtree.c b/src/rtree.c
index 132df31..bd0f41d 100644
--- a/src/rtree.c
+++ b/src/rtree.c
@@ -23,7 +23,7 @@
static int indent_space = 4;
-static void print_node_info(const pll_rtree_t * tree, int options)
+static void print_node_info(pll_rtree_t * tree, int options)
{
if (options & PLL_UTREE_SHOW_LABEL)
printf (" %s", tree->label);
@@ -38,7 +38,7 @@ static void print_node_info(const pll_rtree_t * tree, int options)
printf("\n");
}
-static void print_tree_recurse(const pll_rtree_t * tree,
+static void print_tree_recurse(pll_rtree_t * tree,
int indent_level,
int * active_node_order,
int options)
@@ -93,7 +93,7 @@ static void print_tree_recurse(const pll_rtree_t * tree,
}
-static unsigned int tree_indent_level(const pll_rtree_t * tree, unsigned int indent)
+static unsigned int tree_indent_level(pll_rtree_t * tree, unsigned int indent)
{
if (!tree) return indent;
@@ -103,7 +103,7 @@ static unsigned int tree_indent_level(const pll_rtree_t * tree, unsigned int ind
return (a > b ? a : b);
}
-void pll_rtree_show_ascii(const pll_rtree_t * tree, int options)
+void pll_rtree_show_ascii(pll_rtree_t * tree, int options)
{
unsigned int indent_max = tree_indent_level(tree,0);
@@ -124,7 +124,7 @@ void pll_rtree_show_ascii(const pll_rtree_t * tree, int options)
free(active_node_order);
}
-static char * rtree_export_newick_recursive(const pll_rtree_t * root)
+static char * rtree_export_newick_recursive(pll_rtree_t * root)
{
char * newick;
int size_alloced;
@@ -165,7 +165,7 @@ static char * rtree_export_newick_recursive(const pll_rtree_t * root)
return newick;
}
-PLL_EXPORT char * pll_rtree_export_newick(const pll_rtree_t * root)
+PLL_EXPORT char * pll_rtree_export_newick(pll_rtree_t * root)
{
char * newick;
int size_alloced;
diff --git a/src/stepwise.c b/src/stepwise.c
deleted file mode 100644
index 7ba8bff..0000000
--- a/src/stepwise.c
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- Copyright (C) 2016 Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Tomas Flouri <Tomas.Flouri at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-
-#include "pll.h"
-
-/* simulate exactly the non-reentrant glibc srandom() function */
-#define RAND_STATE_SIZE 128
-
-typedef struct
-{
- int clv_valid;
-} node_info_t;
-
-static pll_utree_t ** travbuffer;
-static pll_pars_buildop_t * parsops;
-
-static char * xstrdup(const char * s)
-{
- size_t len = strlen(s);
- char * p = (char *)malloc(len+1);
- if (!p)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Memory allocation failed");
- return NULL;
- }
- return strcpy(p,s);
-}
-
-/* Fisher-Yates shuffle */
-static unsigned int * create_shuffled(unsigned int n, unsigned int seed)
-{
- unsigned int i,j;
- char * statebuf;
- struct random_data * buf;
-
- unsigned int * x = (unsigned int *)malloc(n*sizeof(unsigned int));
- if (!x)
- {
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return NULL;
- }
-
- for (i=0; i<n; ++i)
- x[i] = i;
-
- /* if seed == 0 then do not shuffle! */
- if (!seed)
- return x;
-
- /* init re-entrant randomizer */
- buf = (struct random_data *)calloc(1, sizeof(struct random_data));;
- statebuf = (char *)calloc(RAND_STATE_SIZE,sizeof(char));
-
- initstate_r(seed,statebuf,RAND_STATE_SIZE,buf);
- srandom_r(seed,buf);
-
- /* perform Fisher-Yates shuffle */
- if (n > 1)
- {
- i = n - 1;
- while (1)
- {
- int rint;
- random_r(buf,&rint);
- double r = ((double)rint / RAND_MAX);
- j = (unsigned int)(r * (i+1));
-
- PLL_SWAP(x[i],x[j]);
-
- if (i == 0) break;
- --i;
- }
- }
-
- /* dealloc and return shuffled array */
- free(statebuf);
- free(buf);
- return x;
-}
-
-static void dealloc_data_onenode(pll_utree_t * node)
-{
- if (node->data)
- {
- free(node->data);
- node->data = NULL;
- }
-}
-
-static void dealloc_data(pll_utree_t * node)
-{
- dealloc_data_onenode(node);
- dealloc_data_onenode(node->next);
- dealloc_data_onenode(node->next->next);
-}
-
-/* a callback function for performing a partial traversal */
-static int cb_partial_traversal(pll_utree_t * node)
-{
- node_info_t * node_info;
-
- /* if we don't want tips in the traversal we must return 0 here. For now,
- allow tips */
- if (!node->next) return 1;
-
- /* get the data element from the node and check if the CLV vector is
- oriented in the direction that we want to traverse. If the data
- element is not yet allocated then we allocate it, set the direction
- and instruct the traversal routine to place the node in the traversal array
- by returning 1 */
- node_info = (node_info_t *)(node->data);
- if (!node_info)
- {
- /* allocate data element. TODO: Check whether allocation was successful */
- node->data = (node_info_t *)calloc(1,sizeof(node_info_t));
- node->next->data = (node_info_t *)calloc(1,sizeof(node_info_t));
- node->next->next->data = (node_info_t *)calloc(1,sizeof(node_info_t));
-
- /* set orientation on selected direction and traverse the subtree */
- node_info = node->data;
- node_info->clv_valid = 1;
- return 1;
- }
-
- /* if the data element was already there and the CLV on this direction is
- set, i.e. the CLV is valid, we instruct the traversal routine not to
- traverse the subtree rooted in this node/direction by returning 0 */
- if (node_info->clv_valid) return 0;
-
- /* otherwise, set orientation on selected direction */
- node_info->clv_valid = 1;
-
- /* reset orientation on the other two directions and return 1 (i.e. traverse
- the subtree */
- node_info = node->next->data;
- node_info->clv_valid = 0;
- node_info = node->next->next->data;
- node_info->clv_valid = 0;
-
- return 1;
-}
-
-static pll_utree_t * utree_inner_create(unsigned int i)
-{
- pll_utree_t * node = (pll_utree_t *)calloc(1,sizeof(pll_utree_t));
- if (!node)
- return NULL;
-
- node->next = (pll_utree_t *)calloc(1,sizeof(pll_utree_t));
- if (!node->next)
- {
- free(node);
- return NULL;
- }
- node->next->next = (pll_utree_t *)calloc(1,sizeof(pll_utree_t));
- if (!node->next->next)
- {
- free(node->next);
- free(node);
- return NULL;
- }
-
- node->next->next->next = node;
-
- node->clv_index = i;
- node->next->clv_index = i;
- node->next->next->clv_index = i;
-
- return node;
-}
-
-static pll_utree_t * utree_tip_create(unsigned int i)
-{
- pll_utree_t * node = (pll_utree_t *)calloc(1,sizeof(pll_utree_t));
- node->next = NULL;
- node->clv_index = i;
-
- return node;
-}
-
-static void utree_link(pll_utree_t * a, pll_utree_t * b)
-{
- /*
-
- * * * *
- \ / \ /
- *---* *---* --> *---*-----*--*
- / a b \ / a b \
- * * * *
-
- */
-
- a->back = b;
- b->back = a;
-}
-
-static void utree_edgesplit(pll_utree_t * a, pll_utree_t * b, pll_utree_t * c)
-{
- /*
- * *
- | |
- * *
- / \ / \
- b * * c b * * c
- / \
- * * --> * / \ *
- \ / \ / \ /
- *---*----------*---* *---* *--*
- / a d \ / a d \
- * * * *
-
- */
-
- /* link d<->c */
- utree_link(a->back,c);
-
- /* link a<->b */
- utree_link(a,b);
-}
-
-static unsigned int utree_iterate(pll_parsimony_t ** list,
- pll_utree_t ** edge_list,
- pll_utree_t * inner_node,
- pll_utree_t * tip_node,
- unsigned int edge_count,
- unsigned int partition_count)
-{
- unsigned int i,j;
- unsigned int min_cost = 0;
- unsigned int best_index = 0;
- unsigned int cost;
- unsigned int ops_count;
- unsigned int traversal_size;
-
- /* set min cost to maximum possible value */
- min_cost = ~0u;
-
- /* find first empty slot in edge_list */
- pll_utree_t ** empty_slot = edge_list + edge_count;
-
- for (i = 0; i < edge_count; ++i)
- {
- /* make the split */
- pll_utree_t * d = edge_list[i]->back;
- utree_edgesplit(edge_list[i], inner_node, inner_node->next);
- utree_link(inner_node->next->next, tip_node);
-
- /* add the two new edges to the end of the list */
- empty_slot[0] = inner_node->next;
- empty_slot[1] = inner_node->next->next;
-
- /* make a partial traversal */
- if (!pll_utree_traverse(tip_node->back,
- cb_partial_traversal,
- travbuffer,
- &traversal_size))
- assert(0);
-
- /* create parsimony operations */
- pll_utree_create_pars_buildops(travbuffer,
- traversal_size,
- parsops,
- &ops_count);
-
- /* compute the costs for each parsimony partition */
- cost = 0;
- for (j = 0; j < partition_count; ++j)
- {
- /* update parsimony vectors */
- pll_fastparsimony_update_vectors(list[j], parsops, ops_count);
-
- /* get parsimony score */
- cost += pll_fastparsimony_edge_score(list[j],
- tip_node->clv_index,
- tip_node->back->clv_index);
- }
-
- /* if current cost is smaller than minimum cost save topology index */
- if (cost < min_cost)
- {
- min_cost = cost;
- best_index = i;
- }
-
- /* reset direction for the newly placed inner node */
- node_info_t * node_info = (node_info_t *)(inner_node->next->next->data);
- node_info->clv_valid = 0;
-
- /* restore tree to its state before placing the tip (and inner) node */
- utree_link(edge_list[i], d);
- inner_node->back = NULL;
- inner_node->next->back = NULL;
- inner_node->next->next->back = NULL;
- tip_node->back = NULL;
- }
-
- /* perform the placement yielding the lowest cost */
- utree_edgesplit(edge_list[best_index], inner_node, inner_node->next);
- utree_link(inner_node->next->next, tip_node);
-
- return min_cost;
-}
-
-static void invalidate_node(pll_utree_t * node)
-{
- node_info_t * info;
-
- info = (node_info_t *)(node->data);
- info->clv_valid = 0;
- info = (node_info_t *)(node->next->data);
- info->clv_valid = 0;
- info = (node_info_t *)(node->next->next->data);
- info->clv_valid = 0;
-}
-
-PLL_EXPORT pll_utree_t * pll_fastparsimony_stepwise(pll_parsimony_t ** list,
- char ** labels,
- unsigned int * cost,
- unsigned int count,
- unsigned int seed)
-{
- unsigned int i,j;
-
- unsigned int tips_count = list[0]->tips;
- unsigned int inner_nodes = list[0]->inner_nodes;
-
- if (tips_count < 3)
- {
- pll_errno = PLL_ERROR_STEPWISE_TIPS;
- snprintf(pll_errmsg, 200,
- "Stepwise parsimony requires at least three tips.");
- return NULL;
- }
-
- //if (tips_count != inner_nodes + 2)
- if (inner_nodes < tips_count-2)
- {
- pll_errno = PLL_ERROR_STEPWISE_UNSUPPORTED;
- snprintf(pll_errmsg, 200,
- "Stepwise parsimony currently supports only unrooted trees.");
- return NULL;
- }
-
- *cost = ~0u;
-
-
- pll_utree_t * root;
-
- /* check that all parsimony structures have the same number of tips and
- inner nodes */
-
- for (i = 1; i < count; ++i)
- {
- if ((list[i]->tips != tips_count) ||
- (list[i]->inner_nodes != inner_nodes))
- {
- pll_errno = PLL_ERROR_STEPWISE_STRUCT;
- snprintf(pll_errmsg, 200,
- "Parsimony structures tips/inner nodes not equal.");
- return NULL;
- }
- }
-
-
- /* 1. Make all allocations at the beginning and check everything was
- allocated, otherwise return an error */
-
- travbuffer = (pll_utree_t **)malloc((2*tips_count-2) * sizeof(pll_utree_t *));
-
- root = utree_inner_create(2*tips_count-3);
-
- /* allocate parsimony operations container */
- parsops = (pll_pars_buildop_t *)malloc((tips_count-2)*
- sizeof(pll_pars_buildop_t));
-
- /* create tip node list with a terminating NULL element */
- pll_utree_t ** tip_node_list = (pll_utree_t **)calloc(tips_count+1,
- sizeof(pll_utree_t *));
-
- /* create inner node list for (tips_count - 3) inner nodes (root was already
- created, and leave the last slot NULL for termination */
- pll_utree_t ** inner_node_list = (pll_utree_t **)calloc(tips_count - 2,
- sizeof(pll_utree_t *));
-
- if (!inner_node_list || !parsops || !tip_node_list || !root || !travbuffer)
- {
- pll_utree_destroy(root,NULL);
- free(parsops);
- free(inner_node_list);
- free(tip_node_list);
- free(travbuffer);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return NULL;
- }
-
- /* allocate all inner nodes */
- for (i=0; i<tips_count-3; ++i)
- {
- inner_node_list[i] = utree_inner_create(i+tips_count);
- if (!inner_node_list[i])
- {
- pll_utree_destroy(root,NULL);
- free(parsops);
- free(tip_node_list);
- free(travbuffer);
- for (j = 0; j < i; ++j)
- pll_utree_destroy(inner_node_list[j],NULL);
- free(inner_node_list);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return NULL;
- }
- }
-
- /* shuffle the order of iterating tip sequences */
- unsigned int * order = create_shuffled(tips_count,seed);
- if (!order) return NULL;
-
- /* allocate all tips */
- for (i=0; i<tips_count; ++i)
- {
- unsigned int index = order[i];
- tip_node_list[i] = utree_tip_create(index);
- if (tip_node_list[i])
- tip_node_list[i]->label = xstrdup(labels[index]);
-
- if (!tip_node_list[i] || !tip_node_list[i]->label)
- {
- free(tip_node_list[i]);
-
- pll_utree_destroy(root,NULL);
- free(parsops);
- free(inner_node_list);
- free(travbuffer);
- for (j = 0; j < i; ++j)
- pll_utree_destroy(tip_node_list[j],NULL);
- free(tip_node_list);
-
- pll_errno = PLL_ERROR_MEM_ALLOC;
- snprintf(pll_errmsg, 200, "Unable to allocate enough memory.");
- return NULL;
-
- }
- }
- free(order);
-
- /* 2. Create the following topology with three leaves
-
- *
- /
- *---*
- \
- *
-
- */
-
- /* place first three tips */
- utree_link(root, tip_node_list[0]);
- utree_link(root->next, tip_node_list[1]);
- utree_link(root->next->next, tip_node_list[2]);
-
- /* available placements */
- pll_utree_t ** edge_list = (pll_utree_t **)calloc(2*tips_count-3,
- sizeof(pll_utree_t *));
- edge_list[0] = root;
- edge_list[1] = root->next;
- edge_list[2] = root->next->next;
-
- /* 3. The stepwise parsimony. Current topology is the tree with three leaves,
- and repeat the following steps for each remaining tip u:
- (i) compute the parsimony score of all possible topologies by placing
- u at every possible edge of the current tree topology.
- (ii) set current toplogy as the tree with the smallest parsimony score
- */
-
- if (tips_count > 3)
- {
- unsigned int edge_count = 3;
-
- for (i = 3; i < tips_count; ++i)
- {
- /* printf("%d -- adding %s\n", i, tip_node_list[i]->label); */
- *cost = utree_iterate(list,
- edge_list,
- inner_node_list[i-3],
- tip_node_list[i],
- edge_count,
- count);
-
- /* reset traversal such that parsimony vectors are re-computed */
- for (j = 0; j < i-2; ++j)
- invalidate_node(inner_node_list[j]);
- invalidate_node(root);
-
- /* after adding a leaf, we have two new edges */
- edge_count += 2;
- }
- }
- else
- {
- *cost = 0;
- for (i = 0; i < count; ++i)
- *cost += list[i]->const_cost;
- }
-
- /* delete data elements */
- for (i = 0; i < tips_count-3; ++i)
- dealloc_data(inner_node_list[i]);
- dealloc_data(root);
-
- /* deallocate auxiliary arrays */
- free(inner_node_list);
- free(tip_node_list);
- free(edge_list);
- free(travbuffer);
- free(parsops);
-
- return root;
-}
diff --git a/src/utree.c b/src/utree.c
index 8db9a7f..e107789 100644
--- a/src/utree.c
+++ b/src/utree.c
@@ -23,7 +23,7 @@
static int indent_space = 4;
-static void print_node_info(const pll_utree_t * tree, int options)
+static void print_node_info(pll_utree_t * tree, int options)
{
if (options & PLL_UTREE_SHOW_LABEL)
printf (" %s", tree->label);
@@ -109,7 +109,7 @@ static void print_tree_recurse(pll_utree_t * tree,
}
-static unsigned int tree_indent_level(const pll_utree_t * tree, unsigned int indent)
+static unsigned int tree_indent_level(pll_utree_t * tree, unsigned int indent)
{
if (!tree->next) return indent+1;
@@ -119,7 +119,7 @@ static unsigned int tree_indent_level(const pll_utree_t * tree, unsigned int ind
return (a > b ? a : b);
}
-PLL_EXPORT void pll_utree_show_ascii(const pll_utree_t * tree, int options)
+PLL_EXPORT void pll_utree_show_ascii(pll_utree_t * tree, int options)
{
unsigned int a, b;
@@ -146,7 +146,7 @@ PLL_EXPORT void pll_utree_show_ascii(const pll_utree_t * tree, int options)
free(active_node_order);
}
-static char * newick_utree_recurse(const pll_utree_t * root)
+static char * newick_utree_recurse(pll_utree_t * root)
{
char * newick;
int size_alloced;
@@ -189,7 +189,7 @@ static char * newick_utree_recurse(const pll_utree_t * root)
return newick;
}
-PLL_EXPORT char * pll_utree_export_newick(const pll_utree_t * root)
+PLL_EXPORT char * pll_utree_export_newick(pll_utree_t * root)
{
char * newick;
int size_alloced;
@@ -638,28 +638,3 @@ PLL_EXPORT pll_utree_t * pll_rtree_unroot(pll_rtree_t * root)
return uroot;
}
-
-PLL_EXPORT void pll_utree_create_pars_buildops(pll_utree_t ** trav_buffer,
- unsigned int trav_buffer_size,
- pll_pars_buildop_t * ops,
- unsigned int * ops_count)
-{
- pll_utree_t * node;
- unsigned int i;
-
- *ops_count = 0;
-
- for (i = 0; i < trav_buffer_size; ++i)
- {
- node = trav_buffer[i];
-
- if (node->next)
- {
- ops[*ops_count].parent_score_index = node->clv_index;
- ops[*ops_count].child1_score_index = node->next->back->clv_index;
- ops[*ops_count].child2_score_index = node->next->next->back->clv_index;
-
- *ops_count = *ops_count + 1;
- }
- }
-}
diff --git a/src/utree_svg.c b/src/utree_svg.c
index 48fb80e..8f7a3b2 100644
--- a/src/utree_svg.c
+++ b/src/utree_svg.c
@@ -462,7 +462,7 @@ PLL_EXPORT int pll_utree_export_svg(pll_utree_t * tree,
and compute the height of each node */
if (!utree_set_height(cloned))
{
- pll_utree_destroy(cloned,NULL);
+ pll_utree_destroy(cloned);
return PLL_FAILURE;
}
@@ -470,7 +470,7 @@ PLL_EXPORT int pll_utree_export_svg(pll_utree_t * tree,
FILE * fp = fopen(filename, "w");
if (!fp)
{
- pll_utree_destroy(cloned,NULL);
+ pll_utree_destroy(cloned);
return PLL_FAILURE;
}
@@ -480,7 +480,7 @@ PLL_EXPORT int pll_utree_export_svg(pll_utree_t * tree,
/* destroy data element from nodes in the cloned tree, and deallocate
the tree */
data_destroy(cloned);
- pll_utree_destroy(cloned,NULL);
+ pll_utree_destroy(cloned);
fclose(fp);
diff --git a/test/.gitignore b/test/.gitignore
new file mode 100644
index 0000000..78f83f8
--- /dev/null
+++ b/test/.gitignore
@@ -0,0 +1,5 @@
+obj
+testdata
+tmp
+tmperr
+result
diff --git a/test/Makefile b/test/Makefile
index 62941a7..0fa265a 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -18,10 +18,21 @@
# Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
CC = gcc
-CFLAGS = -L. -g -O3 -Wall -std=c99
+CFLAGS = -L. -g -O3 -Wall
CLIBS = -lpll -lm
-CFILES = $(shell find src -name '*.c' ! -name 'common.c')
+CFILES = src/alpha-cats.c \
+ src/asc-bias.c \
+ src/derivatives.c \
+ src/derivatives-oddstates.c \
+ src/fasta-dna.c \
+ src/fasta-prot.c \
+ src/rooted.c \
+ src/rooted-tipinner.c \
+ src/hky.c \
+ src/odd-states.c \
+ src/partial-traversal.c \
+ src/protein-models.c
OBJFILES = $(patsubst src/%.c, obj/%, $(CFILES))
@@ -33,11 +44,9 @@ RESULTDIR = result
DEPFILES = worms16s.fas \
small.fas small.tree small.rooted.tree small.rooted.tip.tree \
246x4465.fas 246x4465.tree \
- ribosomal_l5_pf00673.fas ribosomal_l5_pf00673.tree \
+ ribosomal_l5_pf00673.fas \
medium.fas medium.tree \
- 2000.fas 2000.tree \
- 200.fas 200.tree \
- 1000x5.dna.fas 1000.tree
+ 2000.fas 2000.tree
REQFILES = $(patsubst %, $(DATADIR)/%, $(DEPFILES))
ASSETS = https://raw.githubusercontent.com/xflouris/assets/master/libpll
diff --git a/test/README.md b/test/README.md
index a27e022..0d428bd 100644
--- a/test/README.md
+++ b/test/README.md
@@ -60,32 +60,6 @@ subset of test cases.
e.g., ./runtest.py speed hky alpha-cats
-## Naming convention
-
-Source files for testing are named after the following convention:
-
-```
-NNNNN_FLAGS_NAME.c
-```
-
-NNNNN is a 5-digit code with format Class (1 digit) Subclass (1 digit) and ID (3 digits)
-FLAGS is a set of characters identifying different features:
-
-* A/N: [A]scertainment Bias Correction or [N]ot
-* P/M: FASTA/PHYLIP [P]arsing or [M]anual CLVs
-* D/A/O: [D]NA (4 states), [A]mino acid (20 states) or [O]dd number of states
-* R/U: [R]ooted or [U]nrooted
-
-
-## Configure the test framework
-
-Some additional features can be configured inside the test script, in the
-configuration section at the beginning of runtest.py file.
-
-1. do_memtest = [0,1] : if 0, memory errors and leaks are not checked
-2. num_replicates = # : number of samples evaluated in the speed test
-3. all_args = [0,1,..] : set of PLL attributes that are evaluated
-
## Build tests for Windows
1. Build the library dll file and place them in current directory
diff --git a/test/out/00010_NMDU_lkcalc.out b/test/out/00010_NMDU_lkcalc.out
deleted file mode 100644
index 4c2af8d..0000000
--- a/test/out/00010_NMDU_lkcalc.out
+++ /dev/null
@@ -1,98 +0,0 @@
-[0] P-matrix for branch length 0.100000
-+0.9973 +0.0013 +0.0008 +0.0006
-+0.0010 +0.9971 +0.0003 +0.0016
-+0.0024 +0.0013 +0.9956 +0.0006
-+0.0010 +0.0032 +0.0003 +0.9955
-
-+0.9795 +0.0097 +0.0060 +0.0048
-+0.0072 +0.9784 +0.0024 +0.0119
-+0.0179 +0.0097 +0.9676 +0.0048
-+0.0072 +0.0238 +0.0024 +0.9665
-
-+0.9356 +0.0306 +0.0184 +0.0153
-+0.0230 +0.9328 +0.0077 +0.0366
-+0.0553 +0.0306 +0.8988 +0.0153
-+0.0230 +0.0732 +0.0077 +0.8962
-
-+0.7992 +0.0980 +0.0538 +0.0490
-+0.0735 +0.7968 +0.0245 +0.1052
-+0.1614 +0.0980 +0.6917 +0.0490
-+0.0735 +0.2105 +0.0245 +0.6915
-
-
-[0] P-matrix for branch length 0.200000
-+0.9945 +0.0026 +0.0016 +0.0013
-+0.0019 +0.9942 +0.0006 +0.0032
-+0.0048 +0.0026 +0.9913 +0.0013
-+0.0019 +0.0064 +0.0006 +0.9910
-
-+0.9597 +0.0191 +0.0117 +0.0095
-+0.0143 +0.9577 +0.0048 +0.0232
-+0.0350 +0.0191 +0.9364 +0.0095
-+0.0143 +0.0464 +0.0048 +0.9345
-
-+0.8775 +0.0589 +0.0342 +0.0294
-+0.0442 +0.8737 +0.0147 +0.0674
-+0.1025 +0.0589 +0.8092 +0.0294
-+0.0442 +0.1348 +0.0147 +0.8063
-
-+0.6582 +0.1720 +0.0838 +0.0860
-+0.1290 +0.6666 +0.0430 +0.1614
-+0.2514 +0.1720 +0.4907 +0.0860
-+0.1290 +0.3228 +0.0430 +0.5052
-
-
-[0] P-matrix for branch length 1.000000
-+0.9730 +0.0128 +0.0079 +0.0064
-+0.0096 +0.9716 +0.0032 +0.0157
-+0.0236 +0.0128 +0.9573 +0.0064
-+0.0096 +0.0313 +0.0032 +0.9559
-
-+0.8214 +0.0868 +0.0484 +0.0434
-+0.0651 +0.8183 +0.0217 +0.0950
-+0.1452 +0.0868 +0.7246 +0.0434
-+0.0651 +0.1899 +0.0217 +0.7233
-
-+0.5728 +0.2196 +0.0977 +0.1098
-+0.1647 +0.5937 +0.0549 +0.1867
-+0.2932 +0.2196 +0.3774 +0.1098
-+0.1647 +0.3734 +0.0549 +0.4069
-
-+0.3299 +0.3759 +0.1062 +0.1880
-+0.2819 +0.4177 +0.0940 +0.2064
-+0.3187 +0.3759 +0.1174 +0.1880
-+0.2819 +0.4129 +0.0940 +0.2112
-
-
-[0] P-matrix for branch length 1.000000
-+0.9730 +0.0128 +0.0079 +0.0064
-+0.0096 +0.9716 +0.0032 +0.0157
-+0.0236 +0.0128 +0.9573 +0.0064
-+0.0096 +0.0313 +0.0032 +0.9559
-
-+0.8214 +0.0868 +0.0484 +0.0434
-+0.0651 +0.8183 +0.0217 +0.0950
-+0.1452 +0.0868 +0.7246 +0.0434
-+0.0651 +0.1899 +0.0217 +0.7233
-
-+0.5728 +0.2196 +0.0977 +0.1098
-+0.1647 +0.5937 +0.0549 +0.1867
-+0.2932 +0.2196 +0.3774 +0.1098
-+0.1647 +0.3734 +0.0549 +0.4069
-
-+0.3299 +0.3759 +0.1062 +0.1880
-+0.2819 +0.4177 +0.0940 +0.2064
-+0.3187 +0.3759 +0.1174 +0.1880
-+0.2819 +0.4129 +0.0940 +0.2112
-
-
-[0] CLV 5: [ {(0.00257,0.00513,0.00002,0.00639),(0.01851,0.03595,0.00085,0.04406),(0.05342,0.09749,0.00777,0.11466),(0.12799,0.19359,0.05802,0.20474)} {(0.00257,0.00193,0.00001,0.00001),(0.01833,0.01372,0.00067,0.00067),(0.05168,0.03859,0.00603,0.00596),(0.11320,0.08598,0.04323,0.04164)} {(0.00001,0.98843,0.00001,0.00004),(0.00036,0.91716,0.00036,0.00216),(0.00347,0.76334,0.00347,0.01818),(0.02958,0.44435,0.02958,0.10423)} {(1.00000,1.00000,1.00000,1.00000),(1.00000,1.00000,1.00000,1.000 [...]
-[0] CLV 6: [ {(0.00256,0.00001,0.00000,0.00001),(0.01794,0.00051,0.00006,0.00062),(0.04814,0.00426,0.00150,0.00491),(0.08848,0.02407,0.02257,0.02491)} {(0.00257,0.00192,0.00002,0.00002),(0.01809,0.01356,0.00111,0.00110),(0.04974,0.03745,0.00955,0.00939),(0.10327,0.08227,0.05863,0.05627)} {(0.00000,0.97983,0.00000,0.00002),(0.00018,0.85943,0.00018,0.00111),(0.00159,0.62277,0.00159,0.00974),(0.01271,0.24525,0.01271,0.05440)} {(1.00000,1.00000,1.00000,1.00000),(1.00000,1.00000,1.00000,1.000 [...]
-[0] CLV 7: [ {(0.00001,0.98843,0.00001,0.00004),(0.00036,0.91716,0.00036,0.00216),(0.00347,0.76334,0.00347,0.01818),(0.02958,0.44435,0.02958,0.10423)} {(0.00129,0.00001,0.00001,0.00192),(0.00916,0.00033,0.00033,0.01338),(0.02584,0.00298,0.00302,0.03561),(0.05660,0.02082,0.02161,0.06516)} {(0.00001,0.98843,0.00001,0.00004),(0.00036,0.91716,0.00036,0.00216),(0.00347,0.76334,0.00347,0.01818),(0.02958,0.44435,0.02958,0.10423)} {(0.00129,0.00322,0.00129,0.99098),(0.00955,0.02322,0.00955,0.934 [...]
-
-inner-inner logL: -58.887310
-persite logL: -6.1622140 -6.9407523 -1.4797267 -1.6094379 -5.2773906 -8.1327377 -5.7500211 -0.0000000 -5.1947970 -2.1438344 -8.0304760 -8.1659221
-checksum logL: -58.887310
-tip-inner logL: -58.887310
-persite logL: -6.1622140 -6.9407523 -1.4797267 -1.6094379 -5.2773906 -8.1327377 -5.7500211 -0.0000000 -5.1947970 -2.1438344 -8.0304760 -8.1659221
-checksum logL: -58.887310
diff --git a/test/out/00011_NMAU_lkcalc.out b/test/out/00011_NMAU_lkcalc.out
deleted file mode 100644
index b8f7c72..0000000
--- a/test/out/00011_NMAU_lkcalc.out
+++ /dev/null
@@ -1,354 +0,0 @@
-[0] P-matrix for branch length 0.100000
-+0.9956 +0.0000 +0.0001 +0.0002 +0.0000 +0.0001 +0.0003 +0.0007 +0.0000 +0.0001 +0.0001 +0.0001 +0.0000 +0.0000 +0.0004 +0.0009 +0.0007 +0.0000 +0.0000 +0.0004
-+0.0001 +0.9971 +0.0000 +0.0000 +0.0000 +0.0003 +0.0000 +0.0000 +0.0003 +0.0001 +0.0000 +0.0012 +0.0000 +0.0000 +0.0002 +0.0004 +0.0001 +0.0001 +0.0000 +0.0001
-+0.0003 +0.0000 +0.9941 +0.0014 +0.0000 +0.0001 +0.0002 +0.0004 +0.0006 +0.0001 +0.0001 +0.0008 +0.0000 +0.0000 +0.0001 +0.0011 +0.0004 +0.0000 +0.0001 +0.0000
-+0.0003 +0.0000 +0.0012 +0.9953 +0.0000 +0.0002 +0.0019 +0.0004 +0.0001 +0.0000 +0.0000 +0.0002 +0.0000 +0.0000 +0.0000 +0.0002 +0.0001 +0.0000 +0.0000 +0.0000
-+0.0001 +0.0000 +0.0000 +0.0000 +0.9991 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0004 +0.0000 +0.0000 +0.0001 +0.0001
-+0.0003 +0.0003 +0.0001 +0.0002 +0.0000 +0.9959 +0.0012 +0.0001 +0.0007 +0.0000 +0.0002 +0.0004 +0.0001 +0.0000 +0.0003 +0.0001 +0.0001 +0.0000 +0.0000 +0.0001
-+0.0006 +0.0000 +0.0002 +0.0018 +0.0000 +0.0009 +0.9955 +0.0002 +0.0000 +0.0001 +0.0000 +0.0002 +0.0000 +0.0000 +0.0001 +0.0002 +0.0001 +0.0000 +0.0000 +0.0001
-+0.0007 +0.0000 +0.0002 +0.0002 +0.0000 +0.0000 +0.0001 +0.9978 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0000 +0.0001 +0.0005 +0.0001 +0.0000 +0.0000 +0.0001
-+0.0001 +0.0003 +0.0007 +0.0001 +0.0000 +0.0008 +0.0001 +0.0000 +0.9971 +0.0000 +0.0001 +0.0001 +0.0000 +0.0001 +0.0002 +0.0001 +0.0000 +0.0000 +0.0001 +0.0001
-+0.0002 +0.0001 +0.0001 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0000 +0.9957 +0.0007 +0.0001 +0.0002 +0.0003 +0.0000 +0.0001 +0.0004 +0.0000 +0.0000 +0.0019
-+0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0000 +0.0000 +0.0003 +0.9982 +0.0000 +0.0003 +0.0002 +0.0001 +0.0000 +0.0001 +0.0000 +0.0000 +0.0004
-+0.0001 +0.0006 +0.0004 +0.0001 +0.0000 +0.0002 +0.0001 +0.0001 +0.0000 +0.0001 +0.0001 +0.9975 +0.0001 +0.0000 +0.0001 +0.0002 +0.0003 +0.0000 +0.0000 +0.0000
-+0.0002 +0.0001 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0001 +0.0000 +0.0004 +0.0015 +0.0006 +0.9958 +0.0001 +0.0000 +0.0001 +0.0002 +0.0000 +0.0000 +0.0006
-+0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0002 +0.0004 +0.0000 +0.0000 +0.9982 +0.0000 +0.0001 +0.0000 +0.0000 +0.0007 +0.0000
-+0.0007 +0.0001 +0.0001 +0.0000 +0.0000 +0.0002 +0.0001 +0.0001 +0.0001 +0.0000 +0.0001 +0.0001 +0.0000 +0.0000 +0.9975 +0.0006 +0.0002 +0.0000 +0.0000 +0.0001
-+0.0012 +0.0002 +0.0007 +0.0001 +0.0002 +0.0001 +0.0001 +0.0007 +0.0000 +0.0000 +0.0000 +0.0003 +0.0000 +0.0001 +0.0004 +0.9947 +0.0011 +0.0000 +0.0000 +0.0001
-+0.0011 +0.0000 +0.0003 +0.0001 +0.0000 +0.0001 +0.0001 +0.0001 +0.0000 +0.0002 +0.0001 +0.0004 +0.0001 +0.0000 +0.0001 +0.0013 +0.9957 +0.0000 +0.0000 +0.0003
-+0.0000 +0.0003 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0000 +0.0001 +0.0000 +0.0002 +0.0000 +0.9992 +0.0001 +0.0000
-+0.0001 +0.0000 +0.0001 +0.0000 +0.0001 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0001 +0.0000 +0.0000 +0.0009 +0.0000 +0.0001 +0.0001 +0.0000 +0.9982 +0.0001
-+0.0006 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0001 +0.0002 +0.0000 +0.0011 +0.0005 +0.0000 +0.0001 +0.0000 +0.0001 +0.0001 +0.0003 +0.0000 +0.0000 +0.9967
-
-+0.9671 +0.0003 +0.0010 +0.0014 +0.0003 +0.0008 +0.0024 +0.0052 +0.0002 +0.0006 +0.0009 +0.0005 +0.0003 +0.0002 +0.0031 +0.0069 +0.0053 +0.0000 +0.0002 +0.0033
-+0.0006 +0.9785 +0.0003 +0.0000 +0.0002 +0.0023 +0.0000 +0.0002 +0.0020 +0.0006 +0.0003 +0.0092 +0.0003 +0.0001 +0.0013 +0.0026 +0.0004 +0.0005 +0.0001 +0.0004
-+0.0021 +0.0003 +0.9561 +0.0102 +0.0000 +0.0010 +0.0019 +0.0030 +0.0044 +0.0007 +0.0007 +0.0062 +0.0000 +0.0001 +0.0005 +0.0083 +0.0033 +0.0001 +0.0007 +0.0003
-+0.0026 +0.0000 +0.0088 +0.9652 +0.0000 +0.0013 +0.0138 +0.0027 +0.0007 +0.0002 +0.0000 +0.0014 +0.0000 +0.0000 +0.0002 +0.0017 +0.0010 +0.0000 +0.0000 +0.0003
-+0.0008 +0.0002 +0.0000 +0.0000 +0.9933 +0.0000 +0.0000 +0.0003 +0.0002 +0.0004 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0027 +0.0002 +0.0000 +0.0007 +0.0008
-+0.0019 +0.0025 +0.0010 +0.0016 +0.0000 +0.9694 +0.0086 +0.0006 +0.0050 +0.0002 +0.0015 +0.0030 +0.0004 +0.0000 +0.0019 +0.0010 +0.0008 +0.0000 +0.0000 +0.0006
-+0.0042 +0.0000 +0.0015 +0.0131 +0.0000 +0.0067 +0.9665 +0.0018 +0.0004 +0.0006 +0.0002 +0.0017 +0.0001 +0.0000 +0.0006 +0.0014 +0.0005 +0.0000 +0.0002 +0.0006
-+0.0051 +0.0001 +0.0014 +0.0015 +0.0001 +0.0003 +0.0010 +0.9838 +0.0001 +0.0000 +0.0002 +0.0005 +0.0001 +0.0001 +0.0004 +0.0040 +0.0005 +0.0000 +0.0000 +0.0009
-+0.0005 +0.0024 +0.0053 +0.0010 +0.0002 +0.0057 +0.0006 +0.0002 +0.9782 +0.0001 +0.0009 +0.0006 +0.0000 +0.0005 +0.0012 +0.0006 +0.0003 +0.0001 +0.0009 +0.0007
-+0.0014 +0.0006 +0.0008 +0.0003 +0.0004 +0.0002 +0.0007 +0.0000 +0.0001 +0.9684 +0.0054 +0.0009 +0.0012 +0.0019 +0.0002 +0.0004 +0.0028 +0.0000 +0.0003 +0.0140
-+0.0009 +0.0002 +0.0003 +0.0000 +0.0000 +0.0007 +0.0001 +0.0002 +0.0004 +0.0023 +0.9868 +0.0004 +0.0019 +0.0015 +0.0004 +0.0003 +0.0005 +0.0001 +0.0002 +0.0028
-+0.0006 +0.0047 +0.0031 +0.0008 +0.0000 +0.0014 +0.0010 +0.0006 +0.0002 +0.0004 +0.0004 +0.9815 +0.0009 +0.0000 +0.0004 +0.0017 +0.0020 +0.0000 +0.0001 +0.0002
-+0.0016 +0.0009 +0.0000 +0.0000 +0.0000 +0.0011 +0.0004 +0.0004 +0.0000 +0.0030 +0.0110 +0.0048 +0.9690 +0.0009 +0.0002 +0.0011 +0.0015 +0.0000 +0.0000 +0.0041
-+0.0004 +0.0001 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0003 +0.0004 +0.0018 +0.0033 +0.0000 +0.0003 +0.9864 +0.0001 +0.0008 +0.0002 +0.0002 +0.0052 +0.0002
-+0.0053 +0.0010 +0.0004 +0.0002 +0.0002 +0.0014 +0.0006 +0.0008 +0.0008 +0.0001 +0.0007 +0.0007 +0.0001 +0.0001 +0.9815 +0.0042 +0.0012 +0.0000 +0.0000 +0.0008
-+0.0087 +0.0015 +0.0048 +0.0011 +0.0013 +0.0005 +0.0010 +0.0051 +0.0003 +0.0002 +0.0004 +0.0019 +0.0002 +0.0005 +0.0030 +0.9606 +0.0078 +0.0002 +0.0003 +0.0005
-+0.0079 +0.0003 +0.0023 +0.0008 +0.0001 +0.0005 +0.0004 +0.0007 +0.0002 +0.0017 +0.0007 +0.0027 +0.0004 +0.0001 +0.0010 +0.0093 +0.9681 +0.0000 +0.0003 +0.0025
-+0.0000 +0.0020 +0.0002 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0000 +0.0010 +0.0000 +0.0000 +0.0008 +0.0000 +0.0013 +0.0000 +0.9940 +0.0005 +0.0000
-+0.0005 +0.0001 +0.0009 +0.0000 +0.0008 +0.0000 +0.0003 +0.0000 +0.0011 +0.0003 +0.0006 +0.0003 +0.0000 +0.0069 +0.0000 +0.0006 +0.0006 +0.0002 +0.9864 +0.0005
-+0.0044 +0.0002 +0.0002 +0.0002 +0.0004 +0.0003 +0.0005 +0.0012 +0.0004 +0.0080 +0.0037 +0.0002 +0.0009 +0.0001 +0.0006 +0.0005 +0.0023 +0.0000 +0.0002 +0.9756
-
-+0.8974 +0.0009 +0.0032 +0.0044 +0.0010 +0.0027 +0.0074 +0.0163 +0.0007 +0.0020 +0.0028 +0.0018 +0.0008 +0.0006 +0.0097 +0.0211 +0.0163 +0.0000 +0.0006 +0.0102
-+0.0020 +0.9318 +0.0012 +0.0001 +0.0006 +0.0072 +0.0002 +0.0008 +0.0062 +0.0018 +0.0011 +0.0286 +0.0011 +0.0005 +0.0041 +0.0081 +0.0014 +0.0016 +0.0002 +0.0013
-+0.0070 +0.0013 +0.8646 +0.0306 +0.0001 +0.0032 +0.0062 +0.0096 +0.0133 +0.0021 +0.0023 +0.0191 +0.0001 +0.0005 +0.0018 +0.0249 +0.0102 +0.0002 +0.0022 +0.0009
-+0.0082 +0.0001 +0.0264 +0.8920 +0.0000 +0.0043 +0.0418 +0.0087 +0.0024 +0.0008 +0.0001 +0.0047 +0.0000 +0.0000 +0.0007 +0.0055 +0.0032 +0.0000 +0.0001 +0.0010
-+0.0026 +0.0008 +0.0001 +0.0000 +0.9784 +0.0000 +0.0000 +0.0009 +0.0007 +0.0013 +0.0000 +0.0001 +0.0000 +0.0000 +0.0008 +0.0085 +0.0009 +0.0000 +0.0023 +0.0025
-+0.0061 +0.0077 +0.0034 +0.0053 +0.0000 +0.9040 +0.0262 +0.0021 +0.0153 +0.0006 +0.0048 +0.0096 +0.0013 +0.0000 +0.0060 +0.0032 +0.0025 +0.0000 +0.0000 +0.0018
-+0.0130 +0.0002 +0.0050 +0.0396 +0.0000 +0.0202 +0.8958 +0.0058 +0.0013 +0.0017 +0.0008 +0.0053 +0.0004 +0.0000 +0.0021 +0.0044 +0.0018 +0.0000 +0.0005 +0.0020
-+0.0160 +0.0003 +0.0044 +0.0046 +0.0003 +0.0009 +0.0032 +0.9484 +0.0003 +0.0001 +0.0005 +0.0018 +0.0002 +0.0005 +0.0015 +0.0124 +0.0017 +0.0000 +0.0000 +0.0028
-+0.0017 +0.0076 +0.0160 +0.0034 +0.0007 +0.0174 +0.0020 +0.0008 +0.9310 +0.0003 +0.0030 +0.0020 +0.0000 +0.0015 +0.0038 +0.0022 +0.0012 +0.0002 +0.0030 +0.0022
-+0.0047 +0.0020 +0.0024 +0.0010 +0.0012 +0.0006 +0.0023 +0.0002 +0.0003 +0.9012 +0.0170 +0.0029 +0.0038 +0.0060 +0.0006 +0.0015 +0.0085 +0.0000 +0.0009 +0.0430
-+0.0029 +0.0005 +0.0011 +0.0001 +0.0000 +0.0022 +0.0005 +0.0006 +0.0012 +0.0074 +0.9577 +0.0012 +0.0059 +0.0049 +0.0013 +0.0010 +0.0016 +0.0004 +0.0007 +0.0089
-+0.0020 +0.0145 +0.0096 +0.0028 +0.0000 +0.0045 +0.0033 +0.0020 +0.0008 +0.0014 +0.0013 +0.9412 +0.0027 +0.0000 +0.0014 +0.0053 +0.0062 +0.0000 +0.0003 +0.0006
-+0.0049 +0.0029 +0.0002 +0.0001 +0.0000 +0.0033 +0.0012 +0.0013 +0.0001 +0.0095 +0.0343 +0.0148 +0.9026 +0.0029 +0.0008 +0.0034 +0.0047 +0.0000 +0.0001 +0.0129
-+0.0013 +0.0005 +0.0005 +0.0000 +0.0000 +0.0000 +0.0000 +0.0011 +0.0013 +0.0055 +0.0106 +0.0001 +0.0011 +0.9567 +0.0005 +0.0025 +0.0007 +0.0006 +0.0163 +0.0008
-+0.0166 +0.0033 +0.0015 +0.0006 +0.0005 +0.0045 +0.0021 +0.0026 +0.0025 +0.0004 +0.0022 +0.0022 +0.0002 +0.0004 +0.9411 +0.0130 +0.0038 +0.0000 +0.0000 +0.0025
-+0.0264 +0.0048 +0.0145 +0.0037 +0.0041 +0.0018 +0.0031 +0.0158 +0.0010 +0.0008 +0.0012 +0.0061 +0.0007 +0.0014 +0.0094 +0.8781 +0.0237 +0.0006 +0.0008 +0.0018
-+0.0243 +0.0010 +0.0070 +0.0025 +0.0005 +0.0016 +0.0015 +0.0025 +0.0007 +0.0054 +0.0023 +0.0085 +0.0012 +0.0005 +0.0033 +0.0282 +0.9002 +0.0000 +0.0010 +0.0079
-+0.0001 +0.0064 +0.0007 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0007 +0.0000 +0.0031 +0.0001 +0.0000 +0.0024 +0.0000 +0.0040 +0.0001 +0.9806 +0.0015 +0.0000
-+0.0017 +0.0003 +0.0029 +0.0001 +0.0025 +0.0001 +0.0009 +0.0001 +0.0033 +0.0011 +0.0020 +0.0009 +0.0000 +0.0217 +0.0000 +0.0019 +0.0019 +0.0005 +0.9566 +0.0015
-+0.0137 +0.0008 +0.0006 +0.0007 +0.0013 +0.0011 +0.0015 +0.0038 +0.0012 +0.0245 +0.0118 +0.0008 +0.0029 +0.0005 +0.0020 +0.0019 +0.0071 +0.0000 +0.0007 +0.9232
-
-+0.6893 +0.0036 +0.0110 +0.0143 +0.0035 +0.0087 +0.0217 +0.0493 +0.0027 +0.0070 +0.0095 +0.0074 +0.0027 +0.0021 +0.0291 +0.0591 +0.0469 +0.0001 +0.0020 +0.0300
-+0.0077 +0.7819 +0.0055 +0.0013 +0.0022 +0.0217 +0.0021 +0.0034 +0.0191 +0.0057 +0.0043 +0.0865 +0.0035 +0.0016 +0.0132 +0.0238 +0.0059 +0.0052 +0.0009 +0.0046
-+0.0238 +0.0056 +0.6050 +0.0802 +0.0008 +0.0110 +0.0220 +0.0300 +0.0366 +0.0064 +0.0073 +0.0545 +0.0007 +0.0019 +0.0069 +0.0659 +0.0301 +0.0007 +0.0064 +0.0042
-+0.0265 +0.0012 +0.0692 +0.6780 +0.0002 +0.0157 +0.1130 +0.0279 +0.0087 +0.0028 +0.0011 +0.0169 +0.0003 +0.0002 +0.0033 +0.0191 +0.0112 +0.0001 +0.0006 +0.0040
-+0.0090 +0.0026 +0.0009 +0.0003 +0.9262 +0.0003 +0.0004 +0.0036 +0.0025 +0.0042 +0.0005 +0.0006 +0.0001 +0.0004 +0.0031 +0.0255 +0.0038 +0.0000 +0.0074 +0.0083
-+0.0197 +0.0232 +0.0116 +0.0192 +0.0003 +0.7043 +0.0725 +0.0080 +0.0443 +0.0025 +0.0152 +0.0299 +0.0039 +0.0004 +0.0184 +0.0112 +0.0085 +0.0001 +0.0005 +0.0064
-+0.0383 +0.0018 +0.0179 +0.1069 +0.0003 +0.0560 +0.6872 +0.0197 +0.0058 +0.0053 +0.0034 +0.0175 +0.0013 +0.0003 +0.0075 +0.0150 +0.0073 +0.0000 +0.0017 +0.0069
-+0.0485 +0.0016 +0.0137 +0.0148 +0.0014 +0.0034 +0.0110 +0.8317 +0.0015 +0.0008 +0.0022 +0.0067 +0.0008 +0.0017 +0.0058 +0.0372 +0.0075 +0.0001 +0.0003 +0.0093
-+0.0070 +0.0232 +0.0440 +0.0121 +0.0025 +0.0504 +0.0085 +0.0039 +0.7793 +0.0015 +0.0100 +0.0091 +0.0004 +0.0051 +0.0121 +0.0087 +0.0048 +0.0008 +0.0093 +0.0072
-+0.0166 +0.0063 +0.0070 +0.0036 +0.0038 +0.0026 +0.0071 +0.0020 +0.0014 +0.6980 +0.0530 +0.0098 +0.0113 +0.0181 +0.0026 +0.0064 +0.0252 +0.0001 +0.0034 +0.1217
-+0.0097 +0.0020 +0.0035 +0.0006 +0.0002 +0.0068 +0.0020 +0.0023 +0.0039 +0.0229 +0.8608 +0.0047 +0.0177 +0.0159 +0.0044 +0.0039 +0.0058 +0.0013 +0.0027 +0.0288
-+0.0080 +0.0439 +0.0274 +0.0098 +0.0002 +0.0142 +0.0108 +0.0074 +0.0038 +0.0045 +0.0050 +0.8109 +0.0080 +0.0003 +0.0051 +0.0175 +0.0190 +0.0002 +0.0012 +0.0028
-+0.0159 +0.0096 +0.0019 +0.0010 +0.0003 +0.0101 +0.0044 +0.0048 +0.0009 +0.0283 +0.1027 +0.0438 +0.6979 +0.0095 +0.0031 +0.0108 +0.0149 +0.0001 +0.0006 +0.0394
-+0.0047 +0.0017 +0.0020 +0.0003 +0.0004 +0.0004 +0.0004 +0.0037 +0.0043 +0.0168 +0.0342 +0.0007 +0.0035 +0.8572 +0.0017 +0.0076 +0.0028 +0.0021 +0.0515 +0.0041
-+0.0500 +0.0106 +0.0055 +0.0030 +0.0021 +0.0139 +0.0073 +0.0102 +0.0081 +0.0019 +0.0075 +0.0081 +0.0009 +0.0014 +0.8086 +0.0385 +0.0135 +0.0001 +0.0003 +0.0087
-+0.0740 +0.0140 +0.0383 +0.0128 +0.0123 +0.0061 +0.0107 +0.0474 +0.0042 +0.0034 +0.0047 +0.0202 +0.0023 +0.0043 +0.0280 +0.6400 +0.0652 +0.0018 +0.0028 +0.0073
-+0.0698 +0.0041 +0.0208 +0.0090 +0.0022 +0.0056 +0.0062 +0.0114 +0.0027 +0.0159 +0.0084 +0.0262 +0.0037 +0.0019 +0.0117 +0.0775 +0.6952 +0.0001 +0.0032 +0.0244
-+0.0008 +0.0204 +0.0025 +0.0002 +0.0002 +0.0004 +0.0002 +0.0005 +0.0026 +0.0003 +0.0104 +0.0014 +0.0002 +0.0081 +0.0004 +0.0121 +0.0007 +0.9332 +0.0050 +0.0003
-+0.0058 +0.0012 +0.0087 +0.0009 +0.0083 +0.0006 +0.0027 +0.0008 +0.0105 +0.0042 +0.0076 +0.0032 +0.0003 +0.0685 +0.0005 +0.0065 +0.0063 +0.0018 +0.8567 +0.0050
-+0.0404 +0.0029 +0.0026 +0.0029 +0.0043 +0.0038 +0.0053 +0.0127 +0.0037 +0.0694 +0.0380 +0.0035 +0.0090 +0.0025 +0.0068 +0.0078 +0.0221 +0.0001 +0.0023 +0.7599
-
-
-[0] P-matrix for branch length 0.200000
-+0.9912 +0.0001 +0.0003 +0.0004 +0.0001 +0.0002 +0.0006 +0.0014 +0.0001 +0.0002 +0.0002 +0.0001 +0.0001 +0.0000 +0.0008 +0.0019 +0.0014 +0.0000 +0.0000 +0.0009
-+0.0002 +0.9942 +0.0001 +0.0000 +0.0001 +0.0006 +0.0000 +0.0001 +0.0005 +0.0002 +0.0001 +0.0025 +0.0001 +0.0000 +0.0003 +0.0007 +0.0001 +0.0001 +0.0000 +0.0001
-+0.0006 +0.0001 +0.9881 +0.0028 +0.0000 +0.0003 +0.0005 +0.0008 +0.0012 +0.0002 +0.0002 +0.0017 +0.0000 +0.0000 +0.0001 +0.0023 +0.0009 +0.0000 +0.0002 +0.0001
-+0.0007 +0.0000 +0.0024 +0.9906 +0.0000 +0.0003 +0.0038 +0.0007 +0.0002 +0.0001 +0.0000 +0.0004 +0.0000 +0.0000 +0.0000 +0.0004 +0.0003 +0.0000 +0.0000 +0.0001
-+0.0002 +0.0001 +0.0000 +0.0000 +0.9982 +0.0000 +0.0000 +0.0001 +0.0001 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0007 +0.0001 +0.0000 +0.0002 +0.0002
-+0.0005 +0.0007 +0.0003 +0.0004 +0.0000 +0.9918 +0.0023 +0.0002 +0.0013 +0.0000 +0.0004 +0.0008 +0.0001 +0.0000 +0.0005 +0.0003 +0.0002 +0.0000 +0.0000 +0.0002
-+0.0011 +0.0000 +0.0004 +0.0036 +0.0000 +0.0018 +0.9910 +0.0005 +0.0001 +0.0001 +0.0001 +0.0004 +0.0000 +0.0000 +0.0002 +0.0004 +0.0001 +0.0000 +0.0000 +0.0002
-+0.0014 +0.0000 +0.0004 +0.0004 +0.0000 +0.0001 +0.0003 +0.9957 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0000 +0.0001 +0.0011 +0.0001 +0.0000 +0.0000 +0.0002
-+0.0001 +0.0006 +0.0014 +0.0003 +0.0001 +0.0015 +0.0001 +0.0001 +0.9942 +0.0000 +0.0002 +0.0001 +0.0000 +0.0001 +0.0003 +0.0002 +0.0001 +0.0000 +0.0003 +0.0002
-+0.0004 +0.0002 +0.0002 +0.0001 +0.0001 +0.0000 +0.0002 +0.0000 +0.0000 +0.9915 +0.0015 +0.0002 +0.0003 +0.0005 +0.0000 +0.0001 +0.0007 +0.0000 +0.0001 +0.0038
-+0.0002 +0.0000 +0.0001 +0.0000 +0.0000 +0.0002 +0.0000 +0.0000 +0.0001 +0.0006 +0.9965 +0.0001 +0.0005 +0.0004 +0.0001 +0.0001 +0.0001 +0.0000 +0.0001 +0.0007
-+0.0002 +0.0013 +0.0008 +0.0002 +0.0000 +0.0004 +0.0003 +0.0002 +0.0001 +0.0001 +0.0001 +0.9950 +0.0002 +0.0000 +0.0001 +0.0004 +0.0005 +0.0000 +0.0000 +0.0000
-+0.0004 +0.0002 +0.0000 +0.0000 +0.0000 +0.0003 +0.0001 +0.0001 +0.0000 +0.0008 +0.0030 +0.0013 +0.9917 +0.0002 +0.0001 +0.0003 +0.0004 +0.0000 +0.0000 +0.0011
-+0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0001 +0.0005 +0.0009 +0.0000 +0.0001 +0.9964 +0.0000 +0.0002 +0.0001 +0.0001 +0.0014 +0.0001
-+0.0014 +0.0003 +0.0001 +0.0000 +0.0000 +0.0004 +0.0002 +0.0002 +0.0002 +0.0000 +0.0002 +0.0002 +0.0000 +0.0000 +0.9951 +0.0011 +0.0003 +0.0000 +0.0000 +0.0002
-+0.0023 +0.0004 +0.0013 +0.0003 +0.0004 +0.0001 +0.0003 +0.0014 +0.0001 +0.0001 +0.0001 +0.0005 +0.0001 +0.0001 +0.0008 +0.9894 +0.0021 +0.0001 +0.0001 +0.0001
-+0.0021 +0.0001 +0.0006 +0.0002 +0.0000 +0.0001 +0.0001 +0.0002 +0.0000 +0.0005 +0.0002 +0.0007 +0.0001 +0.0000 +0.0003 +0.0025 +0.9914 +0.0000 +0.0001 +0.0007
-+0.0000 +0.0005 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0003 +0.0000 +0.0000 +0.0002 +0.0000 +0.0003 +0.0000 +0.9984 +0.0001 +0.0000
-+0.0001 +0.0000 +0.0003 +0.0000 +0.0002 +0.0000 +0.0001 +0.0000 +0.0003 +0.0001 +0.0002 +0.0001 +0.0000 +0.0018 +0.0000 +0.0002 +0.0002 +0.0000 +0.9964 +0.0001
-+0.0012 +0.0001 +0.0000 +0.0001 +0.0001 +0.0001 +0.0001 +0.0003 +0.0001 +0.0022 +0.0010 +0.0001 +0.0003 +0.0000 +0.0002 +0.0001 +0.0006 +0.0000 +0.0001 +0.9935
-
-+0.9355 +0.0006 +0.0020 +0.0028 +0.0006 +0.0017 +0.0047 +0.0103 +0.0004 +0.0012 +0.0017 +0.0011 +0.0005 +0.0004 +0.0061 +0.0134 +0.0103 +0.0000 +0.0004 +0.0064
-+0.0012 +0.9575 +0.0007 +0.0000 +0.0004 +0.0045 +0.0001 +0.0004 +0.0039 +0.0011 +0.0007 +0.0180 +0.0007 +0.0003 +0.0026 +0.0051 +0.0008 +0.0010 +0.0001 +0.0008
-+0.0043 +0.0007 +0.9143 +0.0197 +0.0000 +0.0020 +0.0037 +0.0060 +0.0085 +0.0014 +0.0014 +0.0121 +0.0000 +0.0003 +0.0011 +0.0160 +0.0064 +0.0001 +0.0014 +0.0005
-+0.0051 +0.0000 +0.0170 +0.9318 +0.0000 +0.0026 +0.0268 +0.0054 +0.0015 +0.0005 +0.0000 +0.0029 +0.0000 +0.0000 +0.0004 +0.0033 +0.0019 +0.0000 +0.0000 +0.0006
-+0.0016 +0.0005 +0.0000 +0.0000 +0.9867 +0.0000 +0.0000 +0.0005 +0.0005 +0.0008 +0.0000 +0.0000 +0.0000 +0.0000 +0.0005 +0.0054 +0.0005 +0.0000 +0.0014 +0.0016
-+0.0038 +0.0048 +0.0021 +0.0032 +0.0000 +0.9398 +0.0167 +0.0013 +0.0097 +0.0004 +0.0030 +0.0060 +0.0008 +0.0000 +0.0038 +0.0020 +0.0015 +0.0000 +0.0000 +0.0011
-+0.0082 +0.0001 +0.0031 +0.0253 +0.0000 +0.0129 +0.9343 +0.0036 +0.0008 +0.0011 +0.0005 +0.0033 +0.0002 +0.0000 +0.0013 +0.0027 +0.0011 +0.0000 +0.0003 +0.0012
-+0.0101 +0.0002 +0.0027 +0.0029 +0.0002 +0.0005 +0.0020 +0.9679 +0.0002 +0.0000 +0.0003 +0.0011 +0.0001 +0.0003 +0.0009 +0.0078 +0.0010 +0.0000 +0.0000 +0.0017
-+0.0010 +0.0047 +0.0102 +0.0021 +0.0005 +0.0111 +0.0012 +0.0005 +0.9570 +0.0002 +0.0019 +0.0012 +0.0000 +0.0009 +0.0023 +0.0013 +0.0007 +0.0001 +0.0019 +0.0014
-+0.0029 +0.0013 +0.0015 +0.0006 +0.0007 +0.0004 +0.0015 +0.0001 +0.0001 +0.9379 +0.0107 +0.0018 +0.0024 +0.0038 +0.0003 +0.0009 +0.0054 +0.0000 +0.0006 +0.0273
-+0.0018 +0.0003 +0.0007 +0.0000 +0.0000 +0.0014 +0.0003 +0.0003 +0.0007 +0.0046 +0.9737 +0.0007 +0.0037 +0.0031 +0.0008 +0.0006 +0.0010 +0.0002 +0.0004 +0.0056
-+0.0012 +0.0092 +0.0061 +0.0017 +0.0000 +0.0028 +0.0020 +0.0012 +0.0005 +0.0008 +0.0008 +0.9634 +0.0017 +0.0000 +0.0008 +0.0033 +0.0039 +0.0000 +0.0002 +0.0004
-+0.0031 +0.0018 +0.0001 +0.0000 +0.0000 +0.0021 +0.0007 +0.0008 +0.0000 +0.0060 +0.0216 +0.0094 +0.9389 +0.0018 +0.0005 +0.0021 +0.0030 +0.0000 +0.0000 +0.0081
-+0.0008 +0.0003 +0.0003 +0.0000 +0.0000 +0.0000 +0.0000 +0.0007 +0.0008 +0.0035 +0.0066 +0.0000 +0.0007 +0.9731 +0.0003 +0.0015 +0.0004 +0.0004 +0.0102 +0.0005
-+0.0105 +0.0021 +0.0009 +0.0003 +0.0003 +0.0028 +0.0013 +0.0016 +0.0015 +0.0002 +0.0014 +0.0013 +0.0001 +0.0002 +0.9633 +0.0082 +0.0023 +0.0000 +0.0000 +0.0015
-+0.0168 +0.0030 +0.0093 +0.0022 +0.0026 +0.0011 +0.0019 +0.0100 +0.0006 +0.0005 +0.0007 +0.0038 +0.0004 +0.0009 +0.0060 +0.9230 +0.0152 +0.0004 +0.0005 +0.0010
-+0.0154 +0.0006 +0.0044 +0.0016 +0.0003 +0.0010 +0.0009 +0.0015 +0.0004 +0.0034 +0.0014 +0.0053 +0.0007 +0.0003 +0.0020 +0.0180 +0.9373 +0.0000 +0.0006 +0.0049
-+0.0000 +0.0040 +0.0005 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0005 +0.0000 +0.0019 +0.0000 +0.0000 +0.0015 +0.0000 +0.0025 +0.0000 +0.9880 +0.0009 +0.0000
-+0.0010 +0.0002 +0.0018 +0.0000 +0.0016 +0.0000 +0.0005 +0.0000 +0.0021 +0.0007 +0.0012 +0.0005 +0.0000 +0.0135 +0.0000 +0.0012 +0.0012 +0.0003 +0.9731 +0.0009
-+0.0087 +0.0005 +0.0003 +0.0004 +0.0008 +0.0007 +0.0009 +0.0024 +0.0007 +0.0156 +0.0073 +0.0004 +0.0018 +0.0003 +0.0012 +0.0011 +0.0045 +0.0000 +0.0004 +0.9519
-
-+0.8071 +0.0020 +0.0064 +0.0085 +0.0020 +0.0052 +0.0138 +0.0306 +0.0014 +0.0040 +0.0055 +0.0039 +0.0016 +0.0012 +0.0181 +0.0385 +0.0301 +0.0000 +0.0011 +0.0189
-+0.0042 +0.8689 +0.0028 +0.0004 +0.0012 +0.0135 +0.0008 +0.0017 +0.0118 +0.0035 +0.0023 +0.0538 +0.0020 +0.0009 +0.0079 +0.0150 +0.0030 +0.0032 +0.0005 +0.0026
-+0.0138 +0.0028 +0.7493 +0.0544 +0.0003 +0.0063 +0.0125 +0.0183 +0.0240 +0.0040 +0.0044 +0.0351 +0.0003 +0.0010 +0.0038 +0.0444 +0.0190 +0.0004 +0.0040 +0.0021
-+0.0159 +0.0004 +0.0469 +0.7983 +0.0001 +0.0088 +0.0751 +0.0168 +0.0049 +0.0016 +0.0004 +0.0096 +0.0001 +0.0001 +0.0016 +0.0109 +0.0064 +0.0000 +0.0002 +0.0021
-+0.0051 +0.0015 +0.0003 +0.0001 +0.9574 +0.0001 +0.0001 +0.0019 +0.0015 +0.0025 +0.0002 +0.0002 +0.0000 +0.0001 +0.0017 +0.0160 +0.0019 +0.0000 +0.0044 +0.0049
-+0.0118 +0.0144 +0.0067 +0.0108 +0.0001 +0.8182 +0.0476 +0.0043 +0.0283 +0.0013 +0.0092 +0.0182 +0.0024 +0.0001 +0.0113 +0.0064 +0.0049 +0.0000 +0.0002 +0.0037
-+0.0242 +0.0006 +0.0102 +0.0711 +0.0001 +0.0367 +0.8048 +0.0114 +0.0030 +0.0033 +0.0018 +0.0103 +0.0007 +0.0001 +0.0043 +0.0087 +0.0038 +0.0000 +0.0010 +0.0039
-+0.0301 +0.0008 +0.0083 +0.0089 +0.0007 +0.0019 +0.0064 +0.9000 +0.0007 +0.0003 +0.0011 +0.0037 +0.0004 +0.0010 +0.0031 +0.0233 +0.0038 +0.0000 +0.0001 +0.0054
-+0.0037 +0.0143 +0.0289 +0.0068 +0.0015 +0.0322 +0.0044 +0.0019 +0.8674 +0.0007 +0.0059 +0.0045 +0.0001 +0.0030 +0.0073 +0.0046 +0.0025 +0.0005 +0.0057 +0.0043
-+0.0094 +0.0038 +0.0044 +0.0020 +0.0023 +0.0013 +0.0044 +0.0007 +0.0006 +0.8135 +0.0324 +0.0058 +0.0071 +0.0113 +0.0013 +0.0033 +0.0159 +0.0000 +0.0019 +0.0787
-+0.0056 +0.0011 +0.0021 +0.0002 +0.0001 +0.0041 +0.0010 +0.0012 +0.0023 +0.0140 +0.9177 +0.0025 +0.0111 +0.0095 +0.0026 +0.0021 +0.0032 +0.0008 +0.0015 +0.0172
-+0.0042 +0.0273 +0.0176 +0.0056 +0.0001 +0.0087 +0.0063 +0.0041 +0.0019 +0.0026 +0.0027 +0.8867 +0.0051 +0.0001 +0.0028 +0.0103 +0.0117 +0.0001 +0.0007 +0.0014
-+0.0095 +0.0057 +0.0007 +0.0004 +0.0001 +0.0063 +0.0025 +0.0026 +0.0003 +0.0177 +0.0643 +0.0276 +0.8150 +0.0056 +0.0016 +0.0065 +0.0090 +0.0000 +0.0002 +0.0243
-+0.0026 +0.0009 +0.0010 +0.0001 +0.0001 +0.0001 +0.0001 +0.0021 +0.0025 +0.0104 +0.0204 +0.0002 +0.0021 +0.9157 +0.0010 +0.0047 +0.0015 +0.0013 +0.0312 +0.0019
-+0.0312 +0.0064 +0.0030 +0.0014 +0.0011 +0.0085 +0.0042 +0.0055 +0.0048 +0.0009 +0.0043 +0.0045 +0.0005 +0.0007 +0.8860 +0.0242 +0.0076 +0.0000 +0.0001 +0.0050
-+0.0482 +0.0088 +0.0258 +0.0074 +0.0077 +0.0035 +0.0062 +0.0296 +0.0022 +0.0017 +0.0026 +0.0120 +0.0014 +0.0027 +0.0176 +0.7732 +0.0429 +0.0011 +0.0016 +0.0038
-+0.0447 +0.0021 +0.0131 +0.0051 +0.0011 +0.0032 +0.0032 +0.0057 +0.0014 +0.0100 +0.0047 +0.0160 +0.0023 +0.0010 +0.0066 +0.0510 +0.8117 +0.0000 +0.0019 +0.0150
-+0.0003 +0.0123 +0.0015 +0.0001 +0.0001 +0.0002 +0.0000 +0.0002 +0.0015 +0.0001 +0.0061 +0.0005 +0.0001 +0.0047 +0.0001 +0.0075 +0.0002 +0.9616 +0.0029 +0.0001
-+0.0033 +0.0006 +0.0054 +0.0003 +0.0049 +0.0002 +0.0016 +0.0003 +0.0064 +0.0023 +0.0042 +0.0018 +0.0001 +0.0415 +0.0002 +0.0038 +0.0038 +0.0010 +0.9155 +0.0029
-+0.0255 +0.0016 +0.0013 +0.0015 +0.0025 +0.0022 +0.0030 +0.0075 +0.0022 +0.0449 +0.0227 +0.0017 +0.0055 +0.0012 +0.0039 +0.0041 +0.0135 +0.0000 +0.0013 +0.8537
-
-+0.4899 +0.0076 +0.0204 +0.0251 +0.0068 +0.0154 +0.0345 +0.0804 +0.0060 +0.0135 +0.0180 +0.0162 +0.0048 +0.0043 +0.0469 +0.0873 +0.0714 +0.0003 +0.0038 +0.0474
-+0.0162 +0.6169 +0.0126 +0.0047 +0.0042 +0.0351 +0.0068 +0.0085 +0.0316 +0.0097 +0.0093 +0.1400 +0.0062 +0.0033 +0.0231 +0.0380 +0.0133 +0.0091 +0.0020 +0.0093
-+0.0439 +0.0127 +0.3793 +0.1085 +0.0024 +0.0207 +0.0411 +0.0512 +0.0529 +0.0104 +0.0133 +0.0827 +0.0021 +0.0042 +0.0144 +0.0908 +0.0477 +0.0012 +0.0104 +0.0101
-+0.0467 +0.0041 +0.0936 +0.4790 +0.0009 +0.0300 +0.1583 +0.0492 +0.0169 +0.0059 +0.0039 +0.0327 +0.0011 +0.0009 +0.0083 +0.0356 +0.0217 +0.0002 +0.0018 +0.0090
-+0.0176 +0.0051 +0.0029 +0.0013 +0.8583 +0.0011 +0.0014 +0.0082 +0.0046 +0.0078 +0.0018 +0.0022 +0.0005 +0.0016 +0.0066 +0.0414 +0.0087 +0.0002 +0.0135 +0.0152
-+0.0350 +0.0376 +0.0219 +0.0368 +0.0009 +0.5044 +0.1050 +0.0170 +0.0677 +0.0056 +0.0260 +0.0510 +0.0064 +0.0015 +0.0306 +0.0217 +0.0162 +0.0004 +0.0016 +0.0126
-+0.0606 +0.0056 +0.0335 +0.1498 +0.0009 +0.0811 +0.4904 +0.0369 +0.0130 +0.0091 +0.0079 +0.0320 +0.0026 +0.0011 +0.0147 +0.0282 +0.0161 +0.0001 +0.0030 +0.0134
-+0.0790 +0.0039 +0.0234 +0.0260 +0.0031 +0.0073 +0.0206 +0.6974 +0.0037 +0.0029 +0.0053 +0.0139 +0.0017 +0.0032 +0.0126 +0.0602 +0.0173 +0.0002 +0.0009 +0.0172
-+0.0155 +0.0385 +0.0636 +0.0236 +0.0046 +0.0770 +0.0192 +0.0098 +0.6122 +0.0039 +0.0186 +0.0213 +0.0013 +0.0094 +0.0216 +0.0186 +0.0107 +0.0016 +0.0160 +0.0129
-+0.0319 +0.0108 +0.0114 +0.0074 +0.0070 +0.0058 +0.0122 +0.0069 +0.0036 +0.4982 +0.0897 +0.0182 +0.0182 +0.0299 +0.0063 +0.0142 +0.0402 +0.0003 +0.0069 +0.1809
-+0.0184 +0.0044 +0.0063 +0.0021 +0.0007 +0.0117 +0.0046 +0.0055 +0.0073 +0.0388 +0.7460 +0.0099 +0.0284 +0.0283 +0.0085 +0.0083 +0.0116 +0.0024 +0.0057 +0.0510
-+0.0176 +0.0712 +0.0416 +0.0190 +0.0009 +0.0243 +0.0197 +0.0153 +0.0089 +0.0083 +0.0105 +0.6651 +0.0127 +0.0012 +0.0105 +0.0313 +0.0321 +0.0006 +0.0024 +0.0069
-+0.0282 +0.0172 +0.0057 +0.0035 +0.0011 +0.0166 +0.0087 +0.0103 +0.0030 +0.0455 +0.1641 +0.0692 +0.4902 +0.0173 +0.0071 +0.0191 +0.0255 +0.0005 +0.0021 +0.0652
-+0.0095 +0.0034 +0.0043 +0.0011 +0.0013 +0.0014 +0.0013 +0.0072 +0.0079 +0.0277 +0.0607 +0.0024 +0.0064 +0.7393 +0.0036 +0.0130 +0.0063 +0.0040 +0.0886 +0.0104
-+0.0806 +0.0187 +0.0115 +0.0077 +0.0044 +0.0231 +0.0144 +0.0220 +0.0143 +0.0046 +0.0143 +0.0167 +0.0021 +0.0029 +0.6573 +0.0615 +0.0261 +0.0003 +0.0010 +0.0166
-+0.1093 +0.0224 +0.0527 +0.0240 +0.0199 +0.0119 +0.0200 +0.0766 +0.0090 +0.0075 +0.0102 +0.0362 +0.0040 +0.0074 +0.0448 +0.4262 +0.0935 +0.0030 +0.0053 +0.0159
-+0.1063 +0.0093 +0.0329 +0.0174 +0.0050 +0.0106 +0.0136 +0.0262 +0.0062 +0.0253 +0.0169 +0.0441 +0.0064 +0.0043 +0.0226 +0.1112 +0.4943 +0.0004 +0.0058 +0.0411
-+0.0028 +0.0353 +0.0048 +0.0009 +0.0005 +0.0015 +0.0007 +0.0017 +0.0052 +0.0012 +0.0192 +0.0047 +0.0006 +0.0152 +0.0015 +0.0201 +0.0024 +0.8711 +0.0095 +0.0012
-+0.0111 +0.0028 +0.0140 +0.0028 +0.0151 +0.0021 +0.0050 +0.0028 +0.0180 +0.0085 +0.0163 +0.0066 +0.0010 +0.1178 +0.0017 +0.0123 +0.0114 +0.0033 +0.7377 +0.0097
-+0.0638 +0.0059 +0.0063 +0.0065 +0.0079 +0.0074 +0.0102 +0.0236 +0.0067 +0.1031 +0.0672 +0.0086 +0.0149 +0.0064 +0.0130 +0.0171 +0.0372 +0.0002 +0.0045 +0.5896
-
-
-[0] P-matrix for branch length 1.000000
-+0.9567 +0.0004 +0.0013 +0.0018 +0.0004 +0.0011 +0.0032 +0.0069 +0.0003 +0.0008 +0.0012 +0.0007 +0.0003 +0.0002 +0.0041 +0.0091 +0.0070 +0.0000 +0.0002 +0.0043
-+0.0008 +0.9716 +0.0005 +0.0000 +0.0003 +0.0030 +0.0000 +0.0003 +0.0026 +0.0008 +0.0004 +0.0121 +0.0004 +0.0002 +0.0017 +0.0034 +0.0005 +0.0007 +0.0001 +0.0005
-+0.0028 +0.0005 +0.9422 +0.0134 +0.0000 +0.0013 +0.0025 +0.0040 +0.0057 +0.0009 +0.0009 +0.0082 +0.0000 +0.0002 +0.0007 +0.0109 +0.0043 +0.0001 +0.0009 +0.0003
-+0.0034 +0.0000 +0.0116 +0.9542 +0.0000 +0.0017 +0.0181 +0.0036 +0.0010 +0.0003 +0.0000 +0.0019 +0.0000 +0.0000 +0.0002 +0.0022 +0.0013 +0.0000 +0.0000 +0.0004
-+0.0010 +0.0003 +0.0000 +0.0000 +0.9912 +0.0000 +0.0000 +0.0003 +0.0003 +0.0005 +0.0000 +0.0000 +0.0000 +0.0000 +0.0003 +0.0036 +0.0003 +0.0000 +0.0009 +0.0010
-+0.0025 +0.0033 +0.0014 +0.0021 +0.0000 +0.9596 +0.0113 +0.0008 +0.0065 +0.0002 +0.0020 +0.0040 +0.0005 +0.0000 +0.0025 +0.0013 +0.0010 +0.0000 +0.0000 +0.0008
-+0.0055 +0.0000 +0.0020 +0.0172 +0.0000 +0.0087 +0.9558 +0.0024 +0.0005 +0.0007 +0.0003 +0.0022 +0.0001 +0.0000 +0.0009 +0.0018 +0.0007 +0.0000 +0.0002 +0.0008
-+0.0068 +0.0001 +0.0018 +0.0019 +0.0001 +0.0004 +0.0013 +0.9786 +0.0001 +0.0000 +0.0002 +0.0007 +0.0001 +0.0002 +0.0006 +0.0053 +0.0006 +0.0000 +0.0000 +0.0011
-+0.0007 +0.0032 +0.0069 +0.0014 +0.0003 +0.0074 +0.0007 +0.0003 +0.9712 +0.0001 +0.0012 +0.0007 +0.0000 +0.0006 +0.0016 +0.0008 +0.0004 +0.0001 +0.0012 +0.0009
-+0.0019 +0.0008 +0.0010 +0.0004 +0.0005 +0.0002 +0.0010 +0.0000 +0.0001 +0.9584 +0.0071 +0.0012 +0.0016 +0.0025 +0.0002 +0.0006 +0.0036 +0.0000 +0.0004 +0.0184
-+0.0012 +0.0002 +0.0004 +0.0000 +0.0000 +0.0009 +0.0002 +0.0002 +0.0005 +0.0031 +0.9825 +0.0005 +0.0025 +0.0020 +0.0005 +0.0004 +0.0006 +0.0002 +0.0003 +0.0037
-+0.0008 +0.0061 +0.0041 +0.0011 +0.0000 +0.0019 +0.0013 +0.0008 +0.0003 +0.0006 +0.0005 +0.9755 +0.0012 +0.0000 +0.0006 +0.0022 +0.0026 +0.0000 +0.0001 +0.0002
-+0.0021 +0.0012 +0.0000 +0.0000 +0.0000 +0.0014 +0.0005 +0.0005 +0.0000 +0.0040 +0.0145 +0.0063 +0.9591 +0.0012 +0.0003 +0.0014 +0.0020 +0.0000 +0.0000 +0.0054
-+0.0005 +0.0002 +0.0002 +0.0000 +0.0000 +0.0000 +0.0000 +0.0004 +0.0005 +0.0023 +0.0044 +0.0000 +0.0004 +0.9821 +0.0002 +0.0010 +0.0003 +0.0003 +0.0068 +0.0003
-+0.0070 +0.0014 +0.0006 +0.0002 +0.0002 +0.0019 +0.0008 +0.0010 +0.0010 +0.0002 +0.0009 +0.0009 +0.0001 +0.0001 +0.9755 +0.0055 +0.0015 +0.0000 +0.0000 +0.0010
-+0.0114 +0.0020 +0.0063 +0.0015 +0.0017 +0.0007 +0.0013 +0.0067 +0.0004 +0.0003 +0.0005 +0.0025 +0.0003 +0.0006 +0.0040 +0.9482 +0.0103 +0.0003 +0.0003 +0.0007
-+0.0104 +0.0004 +0.0030 +0.0010 +0.0002 +0.0007 +0.0006 +0.0009 +0.0003 +0.0023 +0.0009 +0.0036 +0.0005 +0.0002 +0.0013 +0.0122 +0.9579 +0.0000 +0.0004 +0.0033
-+0.0000 +0.0027 +0.0003 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0003 +0.0000 +0.0013 +0.0000 +0.0000 +0.0010 +0.0000 +0.0017 +0.0000 +0.9920 +0.0006 +0.0000
-+0.0007 +0.0001 +0.0012 +0.0000 +0.0011 +0.0000 +0.0004 +0.0000 +0.0014 +0.0005 +0.0008 +0.0004 +0.0000 +0.0091 +0.0000 +0.0008 +0.0008 +0.0002 +0.9820 +0.0006
-+0.0058 +0.0003 +0.0002 +0.0003 +0.0005 +0.0004 +0.0006 +0.0016 +0.0005 +0.0105 +0.0049 +0.0003 +0.0012 +0.0002 +0.0008 +0.0007 +0.0030 +0.0000 +0.0003 +0.9678
-
-+0.7222 +0.0031 +0.0097 +0.0126 +0.0030 +0.0077 +0.0195 +0.0441 +0.0023 +0.0061 +0.0083 +0.0063 +0.0024 +0.0018 +0.0260 +0.0536 +0.0424 +0.0001 +0.0017 +0.0269
-+0.0066 +0.8069 +0.0047 +0.0010 +0.0019 +0.0194 +0.0017 +0.0029 +0.0170 +0.0050 +0.0036 +0.0774 +0.0030 +0.0014 +0.0116 +0.0214 +0.0050 +0.0046 +0.0007 +0.0040
-+0.0209 +0.0047 +0.6446 +0.0736 +0.0006 +0.0096 +0.0192 +0.0267 +0.0333 +0.0057 +0.0065 +0.0492 +0.0005 +0.0017 +0.0060 +0.0604 +0.0271 +0.0006 +0.0058 +0.0036
-+0.0235 +0.0009 +0.0635 +0.7114 +0.0002 +0.0136 +0.1031 +0.0247 +0.0076 +0.0024 +0.0009 +0.0147 +0.0002 +0.0002 +0.0027 +0.0167 +0.0098 +0.0000 +0.0004 +0.0035
-+0.0079 +0.0023 +0.0007 +0.0003 +0.9354 +0.0002 +0.0003 +0.0031 +0.0022 +0.0037 +0.0004 +0.0005 +0.0001 +0.0003 +0.0027 +0.0229 +0.0032 +0.0000 +0.0066 +0.0073
-+0.0175 +0.0207 +0.0102 +0.0167 +0.0002 +0.7364 +0.0659 +0.0069 +0.0400 +0.0021 +0.0135 +0.0266 +0.0035 +0.0003 +0.0164 +0.0098 +0.0074 +0.0001 +0.0004 +0.0056
-+0.0344 +0.0014 +0.0157 +0.0976 +0.0002 +0.0509 +0.7199 +0.0173 +0.0049 +0.0047 +0.0029 +0.0154 +0.0011 +0.0002 +0.0065 +0.0132 +0.0062 +0.0000 +0.0015 +0.0060
-+0.0434 +0.0013 +0.0122 +0.0131 +0.0012 +0.0030 +0.0096 +0.8515 +0.0012 +0.0007 +0.0019 +0.0058 +0.0007 +0.0015 +0.0050 +0.0334 +0.0063 +0.0000 +0.0002 +0.0082
-+0.0060 +0.0207 +0.0400 +0.0106 +0.0022 +0.0455 +0.0072 +0.0033 +0.8046 +0.0012 +0.0088 +0.0076 +0.0003 +0.0045 +0.0107 +0.0075 +0.0041 +0.0007 +0.0083 +0.0063
-+0.0145 +0.0056 +0.0062 +0.0031 +0.0034 +0.0022 +0.0064 +0.0016 +0.0011 +0.7304 +0.0472 +0.0086 +0.0101 +0.0162 +0.0022 +0.0054 +0.0227 +0.0001 +0.0029 +0.1102
-+0.0085 +0.0017 +0.0031 +0.0005 +0.0001 +0.0060 +0.0017 +0.0020 +0.0035 +0.0204 +0.8773 +0.0040 +0.0159 +0.0141 +0.0039 +0.0033 +0.0050 +0.0011 +0.0023 +0.0255
-+0.0068 +0.0393 +0.0247 +0.0086 +0.0002 +0.0126 +0.0095 +0.0064 +0.0032 +0.0040 +0.0043 +0.8327 +0.0072 +0.0002 +0.0044 +0.0154 +0.0170 +0.0001 +0.0010 +0.0024
-+0.0141 +0.0085 +0.0015 +0.0008 +0.0002 +0.0090 +0.0038 +0.0041 +0.0007 +0.0254 +0.0920 +0.0394 +0.7310 +0.0084 +0.0027 +0.0095 +0.0132 +0.0001 +0.0005 +0.0352
-+0.0040 +0.0015 +0.0017 +0.0002 +0.0003 +0.0003 +0.0003 +0.0032 +0.0038 +0.0150 +0.0302 +0.0005 +0.0031 +0.8742 +0.0015 +0.0068 +0.0024 +0.0019 +0.0457 +0.0034
-+0.0448 +0.0094 +0.0048 +0.0025 +0.0018 +0.0124 +0.0064 +0.0088 +0.0071 +0.0016 +0.0066 +0.0070 +0.0008 +0.0012 +0.8309 +0.0345 +0.0117 +0.0001 +0.0002 +0.0076
-+0.0671 +0.0126 +0.0351 +0.0112 +0.0110 +0.0054 +0.0094 +0.0425 +0.0036 +0.0029 +0.0041 +0.0178 +0.0020 +0.0039 +0.0252 +0.6768 +0.0593 +0.0016 +0.0024 +0.0062
-+0.0630 +0.0035 +0.0187 +0.0078 +0.0018 +0.0049 +0.0053 +0.0096 +0.0023 +0.0143 +0.0073 +0.0233 +0.0033 +0.0016 +0.0102 +0.0705 +0.7279 +0.0001 +0.0029 +0.0218
-+0.0006 +0.0181 +0.0022 +0.0002 +0.0001 +0.0003 +0.0001 +0.0004 +0.0023 +0.0002 +0.0091 +0.0010 +0.0001 +0.0071 +0.0003 +0.0108 +0.0006 +0.9416 +0.0044 +0.0002
-+0.0050 +0.0010 +0.0078 +0.0007 +0.0074 +0.0005 +0.0024 +0.0006 +0.0093 +0.0036 +0.0066 +0.0028 +0.0002 +0.0608 +0.0004 +0.0057 +0.0056 +0.0015 +0.8738 +0.0044
-+0.0363 +0.0025 +0.0022 +0.0025 +0.0038 +0.0033 +0.0046 +0.0112 +0.0033 +0.0628 +0.0336 +0.0029 +0.0080 +0.0021 +0.0059 +0.0067 +0.0197 +0.0000 +0.0020 +0.7866
-
-+0.3787 +0.0109 +0.0265 +0.0320 +0.0093 +0.0198 +0.0410 +0.0969 +0.0089 +0.0181 +0.0244 +0.0238 +0.0062 +0.0062 +0.0560 +0.0978 +0.0816 +0.0006 +0.0052 +0.0560
-+0.0233 +0.5100 +0.0184 +0.0085 +0.0058 +0.0422 +0.0114 +0.0134 +0.0386 +0.0123 +0.0137 +0.1671 +0.0080 +0.0047 +0.0295 +0.0457 +0.0195 +0.0115 +0.0032 +0.0133
-+0.0571 +0.0186 +0.2657 +0.1134 +0.0041 +0.0274 +0.0529 +0.0641 +0.0583 +0.0130 +0.0178 +0.0950 +0.0034 +0.0062 +0.0203 +0.0970 +0.0562 +0.0017 +0.0126 +0.0153
-+0.0595 +0.0074 +0.0978 +0.3699 +0.0018 +0.0395 +0.1694 +0.0629 +0.0228 +0.0083 +0.0070 +0.0440 +0.0020 +0.0018 +0.0131 +0.0465 +0.0294 +0.0004 +0.0030 +0.0134
-+0.0242 +0.0070 +0.0049 +0.0025 +0.8058 +0.0020 +0.0026 +0.0125 +0.0063 +0.0103 +0.0035 +0.0041 +0.0009 +0.0029 +0.0096 +0.0500 +0.0130 +0.0003 +0.0176 +0.0202
-+0.0451 +0.0451 +0.0290 +0.0484 +0.0017 +0.3874 +0.1154 +0.0247 +0.0773 +0.0083 +0.0329 +0.0638 +0.0078 +0.0027 +0.0377 +0.0297 +0.0221 +0.0008 +0.0028 +0.0174
-+0.0721 +0.0094 +0.0432 +0.1603 +0.0017 +0.0891 +0.3810 +0.0492 +0.0189 +0.0116 +0.0120 +0.0421 +0.0036 +0.0020 +0.0203 +0.0375 +0.0233 +0.0003 +0.0041 +0.0184
-+0.0953 +0.0062 +0.0292 +0.0333 +0.0047 +0.0107 +0.0275 +0.6058 +0.0059 +0.0051 +0.0084 +0.0199 +0.0025 +0.0045 +0.0182 +0.0722 +0.0256 +0.0004 +0.0017 +0.0229
-+0.0230 +0.0469 +0.0701 +0.0317 +0.0062 +0.0879 +0.0278 +0.0155 +0.5036 +0.0062 +0.0248 +0.0319 +0.0023 +0.0125 +0.0279 +0.0264 +0.0159 +0.0023 +0.0201 +0.0170
-+0.0428 +0.0137 +0.0142 +0.0105 +0.0093 +0.0086 +0.0155 +0.0122 +0.0057 +0.3834 +0.1112 +0.0242 +0.0217 +0.0364 +0.0098 +0.0206 +0.0478 +0.0006 +0.0097 +0.2020
-+0.0249 +0.0066 +0.0084 +0.0039 +0.0014 +0.0147 +0.0069 +0.0087 +0.0098 +0.0480 +0.6655 +0.0145 +0.0336 +0.0364 +0.0116 +0.0122 +0.0163 +0.0032 +0.0083 +0.0651
-+0.0257 +0.0849 +0.0477 +0.0256 +0.0017 +0.0303 +0.0259 +0.0219 +0.0133 +0.0111 +0.0153 +0.5687 +0.0149 +0.0022 +0.0150 +0.0404 +0.0397 +0.0011 +0.0035 +0.0109
-+0.0365 +0.0222 +0.0092 +0.0063 +0.0019 +0.0203 +0.0121 +0.0152 +0.0053 +0.0542 +0.1943 +0.0812 +0.3673 +0.0226 +0.0107 +0.0248 +0.0321 +0.0008 +0.0038 +0.0793
-+0.0135 +0.0048 +0.0063 +0.0021 +0.0024 +0.0026 +0.0025 +0.0101 +0.0106 +0.0338 +0.0782 +0.0044 +0.0084 +0.6565 +0.0053 +0.0165 +0.0094 +0.0054 +0.1108 +0.0163
-+0.0963 +0.0238 +0.0162 +0.0121 +0.0063 +0.0284 +0.0198 +0.0318 +0.0185 +0.0072 +0.0196 +0.0239 +0.0031 +0.0042 +0.5554 +0.0731 +0.0352 +0.0006 +0.0018 +0.0226
-+0.1225 +0.0268 +0.0563 +0.0313 +0.0241 +0.0163 +0.0267 +0.0920 +0.0127 +0.0109 +0.0150 +0.0467 +0.0053 +0.0094 +0.0533 +0.3147 +0.1022 +0.0037 +0.0071 +0.0229
-+0.1214 +0.0137 +0.0388 +0.0236 +0.0074 +0.0144 +0.0197 +0.0387 +0.0091 +0.0301 +0.0237 +0.0546 +0.0081 +0.0064 +0.0305 +0.1214 +0.3792 +0.0007 +0.0077 +0.0507
-+0.0049 +0.0446 +0.0065 +0.0017 +0.0010 +0.0027 +0.0013 +0.0032 +0.0072 +0.0021 +0.0256 +0.0083 +0.0011 +0.0203 +0.0028 +0.0247 +0.0041 +0.8225 +0.0129 +0.0023
-+0.0153 +0.0043 +0.0170 +0.0047 +0.0197 +0.0036 +0.0068 +0.0051 +0.0226 +0.0119 +0.0238 +0.0094 +0.0019 +0.1474 +0.0031 +0.0165 +0.0150 +0.0045 +0.6539 +0.0135
-+0.0754 +0.0084 +0.0096 +0.0097 +0.0104 +0.0103 +0.0141 +0.0314 +0.0088 +0.1151 +0.0858 +0.0135 +0.0181 +0.0100 +0.0177 +0.0246 +0.0458 +0.0004 +0.0062 +0.4846
-
-+0.1200 +0.0312 +0.0426 +0.0508 +0.0226 +0.0359 +0.0535 +0.1162 +0.0267 +0.0337 +0.0596 +0.0664 +0.0120 +0.0197 +0.0640 +0.0861 +0.0737 +0.0033 +0.0149 +0.0673
-+0.0664 +0.1372 +0.0420 +0.0387 +0.0159 +0.0501 +0.0425 +0.0559 +0.0470 +0.0248 +0.0476 +0.1644 +0.0136 +0.0163 +0.0499 +0.0662 +0.0510 +0.0174 +0.0130 +0.0402
-+0.0917 +0.0425 +0.0574 +0.0698 +0.0163 +0.0460 +0.0670 +0.0975 +0.0457 +0.0260 +0.0486 +0.0991 +0.0107 +0.0198 +0.0477 +0.0793 +0.0640 +0.0046 +0.0193 +0.0469
-+0.0945 +0.0337 +0.0602 +0.0979 +0.0123 +0.0544 +0.0969 +0.1034 +0.0399 +0.0234 +0.0395 +0.0847 +0.0091 +0.0131 +0.0443 +0.0753 +0.0586 +0.0027 +0.0125 +0.0436
-+0.0588 +0.0194 +0.0197 +0.0172 +0.4742 +0.0132 +0.0175 +0.0461 +0.0167 +0.0234 +0.0257 +0.0275 +0.0052 +0.0174 +0.0297 +0.0698 +0.0383 +0.0022 +0.0336 +0.0443
-+0.0817 +0.0536 +0.0486 +0.0667 +0.0116 +0.0806 +0.0807 +0.0728 +0.0606 +0.0252 +0.0597 +0.0961 +0.0122 +0.0160 +0.0540 +0.0650 +0.0518 +0.0041 +0.0135 +0.0456
-+0.0942 +0.0351 +0.0547 +0.0917 +0.0118 +0.0623 +0.1027 +0.0956 +0.0399 +0.0249 +0.0445 +0.0826 +0.0099 +0.0136 +0.0472 +0.0716 +0.0562 +0.0026 +0.0126 +0.0462
-+0.1143 +0.0258 +0.0445 +0.0547 +0.0174 +0.0314 +0.0534 +0.2294 +0.0231 +0.0231 +0.0390 +0.0600 +0.0087 +0.0149 +0.0481 +0.0876 +0.0608 +0.0026 +0.0106 +0.0506
-+0.0691 +0.0571 +0.0550 +0.0556 +0.0166 +0.0689 +0.0588 +0.0608 +0.1209 +0.0233 +0.0567 +0.0838 +0.0100 +0.0281 +0.0495 +0.0609 +0.0468 +0.0063 +0.0295 +0.0422
-+0.0797 +0.0275 +0.0286 +0.0298 +0.0212 +0.0261 +0.0334 +0.0554 +0.0213 +0.0878 +0.1466 +0.0554 +0.0234 +0.0504 +0.0350 +0.0536 +0.0594 +0.0038 +0.0257 +0.1359
-+0.0608 +0.0228 +0.0230 +0.0217 +0.0101 +0.0267 +0.0258 +0.0405 +0.0223 +0.0633 +0.2959 +0.0462 +0.0324 +0.0614 +0.0309 +0.0406 +0.0428 +0.0073 +0.0267 +0.0988
-+0.0719 +0.0835 +0.0498 +0.0493 +0.0114 +0.0457 +0.0508 +0.0661 +0.0350 +0.0254 +0.0491 +0.2033 +0.0158 +0.0141 +0.0422 +0.0687 +0.0592 +0.0054 +0.0122 +0.0411
-+0.0706 +0.0378 +0.0293 +0.0289 +0.0119 +0.0315 +0.0332 +0.0521 +0.0228 +0.0586 +0.1873 +0.0861 +0.0490 +0.0430 +0.0346 +0.0517 +0.0526 +0.0046 +0.0193 +0.0952
-+0.0432 +0.0168 +0.0201 +0.0154 +0.0146 +0.0154 +0.0170 +0.0333 +0.0237 +0.0468 +0.1317 +0.0285 +0.0160 +0.2794 +0.0204 +0.0361 +0.0316 +0.0120 +0.1442 +0.0538
-+0.1100 +0.0403 +0.0381 +0.0410 +0.0196 +0.0408 +0.0462 +0.0842 +0.0329 +0.0255 +0.0521 +0.0670 +0.0101 +0.0160 +0.1606 +0.0849 +0.0641 +0.0034 +0.0113 +0.0521
-+0.1078 +0.0389 +0.0461 +0.0507 +0.0336 +0.0357 +0.0510 +0.1116 +0.0294 +0.0284 +0.0498 +0.0795 +0.0110 +0.0207 +0.0619 +0.0917 +0.0749 +0.0063 +0.0168 +0.0544
-+0.1096 +0.0356 +0.0442 +0.0469 +0.0219 +0.0339 +0.0475 +0.0921 +0.0269 +0.0374 +0.0623 +0.0814 +0.0133 +0.0215 +0.0555 +0.0890 +0.0911 +0.0037 +0.0171 +0.0690
-+0.0272 +0.0677 +0.0179 +0.0122 +0.0069 +0.0150 +0.0124 +0.0216 +0.0201 +0.0132 +0.0591 +0.0415 +0.0064 +0.0454 +0.0165 +0.0415 +0.0209 +0.5047 +0.0312 +0.0187
-+0.0433 +0.0178 +0.0260 +0.0196 +0.0376 +0.0172 +0.0208 +0.0313 +0.0331 +0.0317 +0.0762 +0.0328 +0.0095 +0.1918 +0.0192 +0.0391 +0.0335 +0.0109 +0.2678 +0.0406
-+0.0906 +0.0254 +0.0293 +0.0316 +0.0229 +0.0270 +0.0353 +0.0693 +0.0219 +0.0775 +0.1303 +0.0511 +0.0217 +0.0331 +0.0408 +0.0585 +0.0624 +0.0030 +0.0188 +0.1496
-
-
-[0] P-matrix for branch length 1.000000
-+0.9567 +0.0004 +0.0013 +0.0018 +0.0004 +0.0011 +0.0032 +0.0069 +0.0003 +0.0008 +0.0012 +0.0007 +0.0003 +0.0002 +0.0041 +0.0091 +0.0070 +0.0000 +0.0002 +0.0043
-+0.0008 +0.9716 +0.0005 +0.0000 +0.0003 +0.0030 +0.0000 +0.0003 +0.0026 +0.0008 +0.0004 +0.0121 +0.0004 +0.0002 +0.0017 +0.0034 +0.0005 +0.0007 +0.0001 +0.0005
-+0.0028 +0.0005 +0.9422 +0.0134 +0.0000 +0.0013 +0.0025 +0.0040 +0.0057 +0.0009 +0.0009 +0.0082 +0.0000 +0.0002 +0.0007 +0.0109 +0.0043 +0.0001 +0.0009 +0.0003
-+0.0034 +0.0000 +0.0116 +0.9542 +0.0000 +0.0017 +0.0181 +0.0036 +0.0010 +0.0003 +0.0000 +0.0019 +0.0000 +0.0000 +0.0002 +0.0022 +0.0013 +0.0000 +0.0000 +0.0004
-+0.0010 +0.0003 +0.0000 +0.0000 +0.9912 +0.0000 +0.0000 +0.0003 +0.0003 +0.0005 +0.0000 +0.0000 +0.0000 +0.0000 +0.0003 +0.0036 +0.0003 +0.0000 +0.0009 +0.0010
-+0.0025 +0.0033 +0.0014 +0.0021 +0.0000 +0.9596 +0.0113 +0.0008 +0.0065 +0.0002 +0.0020 +0.0040 +0.0005 +0.0000 +0.0025 +0.0013 +0.0010 +0.0000 +0.0000 +0.0008
-+0.0055 +0.0000 +0.0020 +0.0172 +0.0000 +0.0087 +0.9558 +0.0024 +0.0005 +0.0007 +0.0003 +0.0022 +0.0001 +0.0000 +0.0009 +0.0018 +0.0007 +0.0000 +0.0002 +0.0008
-+0.0068 +0.0001 +0.0018 +0.0019 +0.0001 +0.0004 +0.0013 +0.9786 +0.0001 +0.0000 +0.0002 +0.0007 +0.0001 +0.0002 +0.0006 +0.0053 +0.0006 +0.0000 +0.0000 +0.0011
-+0.0007 +0.0032 +0.0069 +0.0014 +0.0003 +0.0074 +0.0007 +0.0003 +0.9712 +0.0001 +0.0012 +0.0007 +0.0000 +0.0006 +0.0016 +0.0008 +0.0004 +0.0001 +0.0012 +0.0009
-+0.0019 +0.0008 +0.0010 +0.0004 +0.0005 +0.0002 +0.0010 +0.0000 +0.0001 +0.9584 +0.0071 +0.0012 +0.0016 +0.0025 +0.0002 +0.0006 +0.0036 +0.0000 +0.0004 +0.0184
-+0.0012 +0.0002 +0.0004 +0.0000 +0.0000 +0.0009 +0.0002 +0.0002 +0.0005 +0.0031 +0.9825 +0.0005 +0.0025 +0.0020 +0.0005 +0.0004 +0.0006 +0.0002 +0.0003 +0.0037
-+0.0008 +0.0061 +0.0041 +0.0011 +0.0000 +0.0019 +0.0013 +0.0008 +0.0003 +0.0006 +0.0005 +0.9755 +0.0012 +0.0000 +0.0006 +0.0022 +0.0026 +0.0000 +0.0001 +0.0002
-+0.0021 +0.0012 +0.0000 +0.0000 +0.0000 +0.0014 +0.0005 +0.0005 +0.0000 +0.0040 +0.0145 +0.0063 +0.9591 +0.0012 +0.0003 +0.0014 +0.0020 +0.0000 +0.0000 +0.0054
-+0.0005 +0.0002 +0.0002 +0.0000 +0.0000 +0.0000 +0.0000 +0.0004 +0.0005 +0.0023 +0.0044 +0.0000 +0.0004 +0.9821 +0.0002 +0.0010 +0.0003 +0.0003 +0.0068 +0.0003
-+0.0070 +0.0014 +0.0006 +0.0002 +0.0002 +0.0019 +0.0008 +0.0010 +0.0010 +0.0002 +0.0009 +0.0009 +0.0001 +0.0001 +0.9755 +0.0055 +0.0015 +0.0000 +0.0000 +0.0010
-+0.0114 +0.0020 +0.0063 +0.0015 +0.0017 +0.0007 +0.0013 +0.0067 +0.0004 +0.0003 +0.0005 +0.0025 +0.0003 +0.0006 +0.0040 +0.9482 +0.0103 +0.0003 +0.0003 +0.0007
-+0.0104 +0.0004 +0.0030 +0.0010 +0.0002 +0.0007 +0.0006 +0.0009 +0.0003 +0.0023 +0.0009 +0.0036 +0.0005 +0.0002 +0.0013 +0.0122 +0.9579 +0.0000 +0.0004 +0.0033
-+0.0000 +0.0027 +0.0003 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0003 +0.0000 +0.0013 +0.0000 +0.0000 +0.0010 +0.0000 +0.0017 +0.0000 +0.9920 +0.0006 +0.0000
-+0.0007 +0.0001 +0.0012 +0.0000 +0.0011 +0.0000 +0.0004 +0.0000 +0.0014 +0.0005 +0.0008 +0.0004 +0.0000 +0.0091 +0.0000 +0.0008 +0.0008 +0.0002 +0.9820 +0.0006
-+0.0058 +0.0003 +0.0002 +0.0003 +0.0005 +0.0004 +0.0006 +0.0016 +0.0005 +0.0105 +0.0049 +0.0003 +0.0012 +0.0002 +0.0008 +0.0007 +0.0030 +0.0000 +0.0003 +0.9678
-
-+0.7222 +0.0031 +0.0097 +0.0126 +0.0030 +0.0077 +0.0195 +0.0441 +0.0023 +0.0061 +0.0083 +0.0063 +0.0024 +0.0018 +0.0260 +0.0536 +0.0424 +0.0001 +0.0017 +0.0269
-+0.0066 +0.8069 +0.0047 +0.0010 +0.0019 +0.0194 +0.0017 +0.0029 +0.0170 +0.0050 +0.0036 +0.0774 +0.0030 +0.0014 +0.0116 +0.0214 +0.0050 +0.0046 +0.0007 +0.0040
-+0.0209 +0.0047 +0.6446 +0.0736 +0.0006 +0.0096 +0.0192 +0.0267 +0.0333 +0.0057 +0.0065 +0.0492 +0.0005 +0.0017 +0.0060 +0.0604 +0.0271 +0.0006 +0.0058 +0.0036
-+0.0235 +0.0009 +0.0635 +0.7114 +0.0002 +0.0136 +0.1031 +0.0247 +0.0076 +0.0024 +0.0009 +0.0147 +0.0002 +0.0002 +0.0027 +0.0167 +0.0098 +0.0000 +0.0004 +0.0035
-+0.0079 +0.0023 +0.0007 +0.0003 +0.9354 +0.0002 +0.0003 +0.0031 +0.0022 +0.0037 +0.0004 +0.0005 +0.0001 +0.0003 +0.0027 +0.0229 +0.0032 +0.0000 +0.0066 +0.0073
-+0.0175 +0.0207 +0.0102 +0.0167 +0.0002 +0.7364 +0.0659 +0.0069 +0.0400 +0.0021 +0.0135 +0.0266 +0.0035 +0.0003 +0.0164 +0.0098 +0.0074 +0.0001 +0.0004 +0.0056
-+0.0344 +0.0014 +0.0157 +0.0976 +0.0002 +0.0509 +0.7199 +0.0173 +0.0049 +0.0047 +0.0029 +0.0154 +0.0011 +0.0002 +0.0065 +0.0132 +0.0062 +0.0000 +0.0015 +0.0060
-+0.0434 +0.0013 +0.0122 +0.0131 +0.0012 +0.0030 +0.0096 +0.8515 +0.0012 +0.0007 +0.0019 +0.0058 +0.0007 +0.0015 +0.0050 +0.0334 +0.0063 +0.0000 +0.0002 +0.0082
-+0.0060 +0.0207 +0.0400 +0.0106 +0.0022 +0.0455 +0.0072 +0.0033 +0.8046 +0.0012 +0.0088 +0.0076 +0.0003 +0.0045 +0.0107 +0.0075 +0.0041 +0.0007 +0.0083 +0.0063
-+0.0145 +0.0056 +0.0062 +0.0031 +0.0034 +0.0022 +0.0064 +0.0016 +0.0011 +0.7304 +0.0472 +0.0086 +0.0101 +0.0162 +0.0022 +0.0054 +0.0227 +0.0001 +0.0029 +0.1102
-+0.0085 +0.0017 +0.0031 +0.0005 +0.0001 +0.0060 +0.0017 +0.0020 +0.0035 +0.0204 +0.8773 +0.0040 +0.0159 +0.0141 +0.0039 +0.0033 +0.0050 +0.0011 +0.0023 +0.0255
-+0.0068 +0.0393 +0.0247 +0.0086 +0.0002 +0.0126 +0.0095 +0.0064 +0.0032 +0.0040 +0.0043 +0.8327 +0.0072 +0.0002 +0.0044 +0.0154 +0.0170 +0.0001 +0.0010 +0.0024
-+0.0141 +0.0085 +0.0015 +0.0008 +0.0002 +0.0090 +0.0038 +0.0041 +0.0007 +0.0254 +0.0920 +0.0394 +0.7310 +0.0084 +0.0027 +0.0095 +0.0132 +0.0001 +0.0005 +0.0352
-+0.0040 +0.0015 +0.0017 +0.0002 +0.0003 +0.0003 +0.0003 +0.0032 +0.0038 +0.0150 +0.0302 +0.0005 +0.0031 +0.8742 +0.0015 +0.0068 +0.0024 +0.0019 +0.0457 +0.0034
-+0.0448 +0.0094 +0.0048 +0.0025 +0.0018 +0.0124 +0.0064 +0.0088 +0.0071 +0.0016 +0.0066 +0.0070 +0.0008 +0.0012 +0.8309 +0.0345 +0.0117 +0.0001 +0.0002 +0.0076
-+0.0671 +0.0126 +0.0351 +0.0112 +0.0110 +0.0054 +0.0094 +0.0425 +0.0036 +0.0029 +0.0041 +0.0178 +0.0020 +0.0039 +0.0252 +0.6768 +0.0593 +0.0016 +0.0024 +0.0062
-+0.0630 +0.0035 +0.0187 +0.0078 +0.0018 +0.0049 +0.0053 +0.0096 +0.0023 +0.0143 +0.0073 +0.0233 +0.0033 +0.0016 +0.0102 +0.0705 +0.7279 +0.0001 +0.0029 +0.0218
-+0.0006 +0.0181 +0.0022 +0.0002 +0.0001 +0.0003 +0.0001 +0.0004 +0.0023 +0.0002 +0.0091 +0.0010 +0.0001 +0.0071 +0.0003 +0.0108 +0.0006 +0.9416 +0.0044 +0.0002
-+0.0050 +0.0010 +0.0078 +0.0007 +0.0074 +0.0005 +0.0024 +0.0006 +0.0093 +0.0036 +0.0066 +0.0028 +0.0002 +0.0608 +0.0004 +0.0057 +0.0056 +0.0015 +0.8738 +0.0044
-+0.0363 +0.0025 +0.0022 +0.0025 +0.0038 +0.0033 +0.0046 +0.0112 +0.0033 +0.0628 +0.0336 +0.0029 +0.0080 +0.0021 +0.0059 +0.0067 +0.0197 +0.0000 +0.0020 +0.7866
-
-+0.3787 +0.0109 +0.0265 +0.0320 +0.0093 +0.0198 +0.0410 +0.0969 +0.0089 +0.0181 +0.0244 +0.0238 +0.0062 +0.0062 +0.0560 +0.0978 +0.0816 +0.0006 +0.0052 +0.0560
-+0.0233 +0.5100 +0.0184 +0.0085 +0.0058 +0.0422 +0.0114 +0.0134 +0.0386 +0.0123 +0.0137 +0.1671 +0.0080 +0.0047 +0.0295 +0.0457 +0.0195 +0.0115 +0.0032 +0.0133
-+0.0571 +0.0186 +0.2657 +0.1134 +0.0041 +0.0274 +0.0529 +0.0641 +0.0583 +0.0130 +0.0178 +0.0950 +0.0034 +0.0062 +0.0203 +0.0970 +0.0562 +0.0017 +0.0126 +0.0153
-+0.0595 +0.0074 +0.0978 +0.3699 +0.0018 +0.0395 +0.1694 +0.0629 +0.0228 +0.0083 +0.0070 +0.0440 +0.0020 +0.0018 +0.0131 +0.0465 +0.0294 +0.0004 +0.0030 +0.0134
-+0.0242 +0.0070 +0.0049 +0.0025 +0.8058 +0.0020 +0.0026 +0.0125 +0.0063 +0.0103 +0.0035 +0.0041 +0.0009 +0.0029 +0.0096 +0.0500 +0.0130 +0.0003 +0.0176 +0.0202
-+0.0451 +0.0451 +0.0290 +0.0484 +0.0017 +0.3874 +0.1154 +0.0247 +0.0773 +0.0083 +0.0329 +0.0638 +0.0078 +0.0027 +0.0377 +0.0297 +0.0221 +0.0008 +0.0028 +0.0174
-+0.0721 +0.0094 +0.0432 +0.1603 +0.0017 +0.0891 +0.3810 +0.0492 +0.0189 +0.0116 +0.0120 +0.0421 +0.0036 +0.0020 +0.0203 +0.0375 +0.0233 +0.0003 +0.0041 +0.0184
-+0.0953 +0.0062 +0.0292 +0.0333 +0.0047 +0.0107 +0.0275 +0.6058 +0.0059 +0.0051 +0.0084 +0.0199 +0.0025 +0.0045 +0.0182 +0.0722 +0.0256 +0.0004 +0.0017 +0.0229
-+0.0230 +0.0469 +0.0701 +0.0317 +0.0062 +0.0879 +0.0278 +0.0155 +0.5036 +0.0062 +0.0248 +0.0319 +0.0023 +0.0125 +0.0279 +0.0264 +0.0159 +0.0023 +0.0201 +0.0170
-+0.0428 +0.0137 +0.0142 +0.0105 +0.0093 +0.0086 +0.0155 +0.0122 +0.0057 +0.3834 +0.1112 +0.0242 +0.0217 +0.0364 +0.0098 +0.0206 +0.0478 +0.0006 +0.0097 +0.2020
-+0.0249 +0.0066 +0.0084 +0.0039 +0.0014 +0.0147 +0.0069 +0.0087 +0.0098 +0.0480 +0.6655 +0.0145 +0.0336 +0.0364 +0.0116 +0.0122 +0.0163 +0.0032 +0.0083 +0.0651
-+0.0257 +0.0849 +0.0477 +0.0256 +0.0017 +0.0303 +0.0259 +0.0219 +0.0133 +0.0111 +0.0153 +0.5687 +0.0149 +0.0022 +0.0150 +0.0404 +0.0397 +0.0011 +0.0035 +0.0109
-+0.0365 +0.0222 +0.0092 +0.0063 +0.0019 +0.0203 +0.0121 +0.0152 +0.0053 +0.0542 +0.1943 +0.0812 +0.3673 +0.0226 +0.0107 +0.0248 +0.0321 +0.0008 +0.0038 +0.0793
-+0.0135 +0.0048 +0.0063 +0.0021 +0.0024 +0.0026 +0.0025 +0.0101 +0.0106 +0.0338 +0.0782 +0.0044 +0.0084 +0.6565 +0.0053 +0.0165 +0.0094 +0.0054 +0.1108 +0.0163
-+0.0963 +0.0238 +0.0162 +0.0121 +0.0063 +0.0284 +0.0198 +0.0318 +0.0185 +0.0072 +0.0196 +0.0239 +0.0031 +0.0042 +0.5554 +0.0731 +0.0352 +0.0006 +0.0018 +0.0226
-+0.1225 +0.0268 +0.0563 +0.0313 +0.0241 +0.0163 +0.0267 +0.0920 +0.0127 +0.0109 +0.0150 +0.0467 +0.0053 +0.0094 +0.0533 +0.3147 +0.1022 +0.0037 +0.0071 +0.0229
-+0.1214 +0.0137 +0.0388 +0.0236 +0.0074 +0.0144 +0.0197 +0.0387 +0.0091 +0.0301 +0.0237 +0.0546 +0.0081 +0.0064 +0.0305 +0.1214 +0.3792 +0.0007 +0.0077 +0.0507
-+0.0049 +0.0446 +0.0065 +0.0017 +0.0010 +0.0027 +0.0013 +0.0032 +0.0072 +0.0021 +0.0256 +0.0083 +0.0011 +0.0203 +0.0028 +0.0247 +0.0041 +0.8225 +0.0129 +0.0023
-+0.0153 +0.0043 +0.0170 +0.0047 +0.0197 +0.0036 +0.0068 +0.0051 +0.0226 +0.0119 +0.0238 +0.0094 +0.0019 +0.1474 +0.0031 +0.0165 +0.0150 +0.0045 +0.6539 +0.0135
-+0.0754 +0.0084 +0.0096 +0.0097 +0.0104 +0.0103 +0.0141 +0.0314 +0.0088 +0.1151 +0.0858 +0.0135 +0.0181 +0.0100 +0.0177 +0.0246 +0.0458 +0.0004 +0.0062 +0.4846
-
-+0.1200 +0.0312 +0.0426 +0.0508 +0.0226 +0.0359 +0.0535 +0.1162 +0.0267 +0.0337 +0.0596 +0.0664 +0.0120 +0.0197 +0.0640 +0.0861 +0.0737 +0.0033 +0.0149 +0.0673
-+0.0664 +0.1372 +0.0420 +0.0387 +0.0159 +0.0501 +0.0425 +0.0559 +0.0470 +0.0248 +0.0476 +0.1644 +0.0136 +0.0163 +0.0499 +0.0662 +0.0510 +0.0174 +0.0130 +0.0402
-+0.0917 +0.0425 +0.0574 +0.0698 +0.0163 +0.0460 +0.0670 +0.0975 +0.0457 +0.0260 +0.0486 +0.0991 +0.0107 +0.0198 +0.0477 +0.0793 +0.0640 +0.0046 +0.0193 +0.0469
-+0.0945 +0.0337 +0.0602 +0.0979 +0.0123 +0.0544 +0.0969 +0.1034 +0.0399 +0.0234 +0.0395 +0.0847 +0.0091 +0.0131 +0.0443 +0.0753 +0.0586 +0.0027 +0.0125 +0.0436
-+0.0588 +0.0194 +0.0197 +0.0172 +0.4742 +0.0132 +0.0175 +0.0461 +0.0167 +0.0234 +0.0257 +0.0275 +0.0052 +0.0174 +0.0297 +0.0698 +0.0383 +0.0022 +0.0336 +0.0443
-+0.0817 +0.0536 +0.0486 +0.0667 +0.0116 +0.0806 +0.0807 +0.0728 +0.0606 +0.0252 +0.0597 +0.0961 +0.0122 +0.0160 +0.0540 +0.0650 +0.0518 +0.0041 +0.0135 +0.0456
-+0.0942 +0.0351 +0.0547 +0.0917 +0.0118 +0.0623 +0.1027 +0.0956 +0.0399 +0.0249 +0.0445 +0.0826 +0.0099 +0.0136 +0.0472 +0.0716 +0.0562 +0.0026 +0.0126 +0.0462
-+0.1143 +0.0258 +0.0445 +0.0547 +0.0174 +0.0314 +0.0534 +0.2294 +0.0231 +0.0231 +0.0390 +0.0600 +0.0087 +0.0149 +0.0481 +0.0876 +0.0608 +0.0026 +0.0106 +0.0506
-+0.0691 +0.0571 +0.0550 +0.0556 +0.0166 +0.0689 +0.0588 +0.0608 +0.1209 +0.0233 +0.0567 +0.0838 +0.0100 +0.0281 +0.0495 +0.0609 +0.0468 +0.0063 +0.0295 +0.0422
-+0.0797 +0.0275 +0.0286 +0.0298 +0.0212 +0.0261 +0.0334 +0.0554 +0.0213 +0.0878 +0.1466 +0.0554 +0.0234 +0.0504 +0.0350 +0.0536 +0.0594 +0.0038 +0.0257 +0.1359
-+0.0608 +0.0228 +0.0230 +0.0217 +0.0101 +0.0267 +0.0258 +0.0405 +0.0223 +0.0633 +0.2959 +0.0462 +0.0324 +0.0614 +0.0309 +0.0406 +0.0428 +0.0073 +0.0267 +0.0988
-+0.0719 +0.0835 +0.0498 +0.0493 +0.0114 +0.0457 +0.0508 +0.0661 +0.0350 +0.0254 +0.0491 +0.2033 +0.0158 +0.0141 +0.0422 +0.0687 +0.0592 +0.0054 +0.0122 +0.0411
-+0.0706 +0.0378 +0.0293 +0.0289 +0.0119 +0.0315 +0.0332 +0.0521 +0.0228 +0.0586 +0.1873 +0.0861 +0.0490 +0.0430 +0.0346 +0.0517 +0.0526 +0.0046 +0.0193 +0.0952
-+0.0432 +0.0168 +0.0201 +0.0154 +0.0146 +0.0154 +0.0170 +0.0333 +0.0237 +0.0468 +0.1317 +0.0285 +0.0160 +0.2794 +0.0204 +0.0361 +0.0316 +0.0120 +0.1442 +0.0538
-+0.1100 +0.0403 +0.0381 +0.0410 +0.0196 +0.0408 +0.0462 +0.0842 +0.0329 +0.0255 +0.0521 +0.0670 +0.0101 +0.0160 +0.1606 +0.0849 +0.0641 +0.0034 +0.0113 +0.0521
-+0.1078 +0.0389 +0.0461 +0.0507 +0.0336 +0.0357 +0.0510 +0.1116 +0.0294 +0.0284 +0.0498 +0.0795 +0.0110 +0.0207 +0.0619 +0.0917 +0.0749 +0.0063 +0.0168 +0.0544
-+0.1096 +0.0356 +0.0442 +0.0469 +0.0219 +0.0339 +0.0475 +0.0921 +0.0269 +0.0374 +0.0623 +0.0814 +0.0133 +0.0215 +0.0555 +0.0890 +0.0911 +0.0037 +0.0171 +0.0690
-+0.0272 +0.0677 +0.0179 +0.0122 +0.0069 +0.0150 +0.0124 +0.0216 +0.0201 +0.0132 +0.0591 +0.0415 +0.0064 +0.0454 +0.0165 +0.0415 +0.0209 +0.5047 +0.0312 +0.0187
-+0.0433 +0.0178 +0.0260 +0.0196 +0.0376 +0.0172 +0.0208 +0.0313 +0.0331 +0.0317 +0.0762 +0.0328 +0.0095 +0.1918 +0.0192 +0.0391 +0.0335 +0.0109 +0.2678 +0.0406
-+0.0906 +0.0254 +0.0293 +0.0316 +0.0229 +0.0270 +0.0353 +0.0693 +0.0219 +0.0775 +0.1303 +0.0511 +0.0217 +0.0331 +0.0408 +0.0585 +0.0624 +0.0030 +0.0188 +0.1496
-
-
-[0] CLV 5: [ {(0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00004,0.00000,0.00000,0.00000,0.00000,0.00003,0.00000,0.00000,0.00000,0.00000,0.00000),(0.00001,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00031,0.00000,0.00000,0.00000,0.00000,0.00023,0.00000,0.00001,0.00000,0.00000,0.00002),(0.00007,0.00003,0.00002,0.00000,0.00000,0.00001,0.00001,0.00000,0.00000,0.00104,0.00004,0.00001,0.00003,0.00001,0.00083,0.00003,0.00007,0.00000,0.00000,0 [...]
-[0] CLV 6: [ {(0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00004,0.00000,0.00000,0.00000,0.00000,0.00003,0.00000,0.00000,0.00000,0.00000,0.00000),(0.00001,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00030,0.00000,0.00000,0.00000,0.00000,0.00023,0.00000,0.00001,0.00000,0.00000,0.00002),(0.00008,0.00003,0.00002,0.00001,0.00001,0.00002,0.00002,0.00000,0.00001,0.00095,0.00005,0.00001,0.00004,0.00002,0.00078,0.00004,0.00007,0.00000,0.00000,0 [...]
-[0] CLV 7: [ {(0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00002,0.00000,0.00000,0.00000,0.00000,0.00010,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000),(0.00001,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00012,0.00000,0.00000,0.00000,0.00000,0.00072,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000),(0.00005,0.00000,0.00000,0.00000,0.00000,0.00001,0.00001,0.00039,0.00000,0.00000,0.00001,0.00002,0.00214,0.00000,0.00000,0.00004,0.00001,0.00000,0.00000,0 [...]
-
-inner-inner logL: -227.371279
-persite logL: -17.0447253 -16.2610663 -13.8755725 -18.8408367 -19.4698136 -13.1932024 -13.4231282 -14.6838719 -14.4485103 -15.7189636 -11.5030979 -13.2395572 -12.6869279 -18.5235207 -14.4584843
-checksum logL: -227.371279
-tip-inner logL: -227.371279
-persite logL: -17.0447253 -16.2610663 -13.8755725 -18.8408367 -19.4698136 -13.1932024 -13.4231282 -14.6838719 -14.4485103 -15.7189636 -11.5030979 -13.2395572 -12.6869279 -18.5235207 -14.4584843
-checksum logL: -227.371279
diff --git a/test/out/00012_NMOU_lkcalc.out b/test/out/00012_NMOU_lkcalc.out
deleted file mode 100644
index 1412d8a..0000000
--- a/test/out/00012_NMOU_lkcalc.out
+++ /dev/null
@@ -1,146 +0,0 @@
-[0] P-matrix for branch length 0.100000
-+0.9959 +0.0001 +0.0005 +0.0007 +0.0012 +0.0013 +0.0003
-+0.0001 +0.9979 +0.0003 +0.0003 +0.0004 +0.0004 +0.0005
-+0.0005 +0.0003 +0.9967 +0.0005 +0.0007 +0.0006 +0.0006
-+0.0007 +0.0004 +0.0006 +0.9957 +0.0009 +0.0008 +0.0008
-+0.0010 +0.0004 +0.0006 +0.0007 +0.9956 +0.0009 +0.0009
-+0.0012 +0.0004 +0.0006 +0.0007 +0.0010 +0.9957 +0.0002
-+0.0003 +0.0006 +0.0007 +0.0007 +0.0011 +0.0003 +0.9964
-
-+0.9692 +0.0011 +0.0039 +0.0050 +0.0090 +0.0097 +0.0020
-+0.0009 +0.9845 +0.0024 +0.0022 +0.0032 +0.0030 +0.0038
-+0.0036 +0.0026 +0.9757 +0.0037 +0.0052 +0.0047 +0.0045
-+0.0054 +0.0028 +0.0043 +0.9683 +0.0070 +0.0063 +0.0060
-+0.0072 +0.0030 +0.0045 +0.0051 +0.9672 +0.0066 +0.0063
-+0.0090 +0.0032 +0.0047 +0.0053 +0.0077 +0.9683 +0.0019
-+0.0020 +0.0045 +0.0049 +0.0055 +0.0079 +0.0020 +0.9733
-
-+0.9039 +0.0037 +0.0125 +0.0155 +0.0278 +0.0299 +0.0067
-+0.0032 +0.9507 +0.0076 +0.0070 +0.0102 +0.0093 +0.0120
-+0.0115 +0.0082 +0.9233 +0.0115 +0.0164 +0.0148 +0.0142
-+0.0169 +0.0089 +0.0136 +0.9008 +0.0218 +0.0194 +0.0185
-+0.0222 +0.0095 +0.0142 +0.0160 +0.8980 +0.0206 +0.0195
-+0.0276 +0.0101 +0.0148 +0.0165 +0.0238 +0.9012 +0.0061
-+0.0067 +0.0140 +0.0154 +0.0169 +0.0244 +0.0066 +0.9160
-
-+0.7077 +0.0145 +0.0399 +0.0471 +0.0812 +0.0861 +0.0235
-+0.0124 +0.8387 +0.0253 +0.0229 +0.0330 +0.0298 +0.0378
-+0.0368 +0.0273 +0.7589 +0.0363 +0.0512 +0.0458 +0.0439
-+0.0514 +0.0292 +0.0429 +0.6976 +0.0656 +0.0582 +0.0551
-+0.0650 +0.0308 +0.0444 +0.0481 +0.6930 +0.0613 +0.0574
-+0.0795 +0.0321 +0.0458 +0.0493 +0.0707 +0.7006 +0.0221
-+0.0235 +0.0441 +0.0475 +0.0505 +0.0717 +0.0239 +0.7388
-
-
-[0] P-matrix for branch length 0.200000
-+0.9917 +0.0003 +0.0011 +0.0013 +0.0024 +0.0026 +0.0005
-+0.0002 +0.9959 +0.0006 +0.0006 +0.0009 +0.0008 +0.0010
-+0.0010 +0.0007 +0.9935 +0.0010 +0.0014 +0.0013 +0.0012
-+0.0015 +0.0007 +0.0012 +0.9915 +0.0019 +0.0017 +0.0016
-+0.0019 +0.0008 +0.0012 +0.0014 +0.9912 +0.0018 +0.0017
-+0.0024 +0.0009 +0.0013 +0.0014 +0.0021 +0.9915 +0.0005
-+0.0005 +0.0012 +0.0013 +0.0015 +0.0021 +0.0005 +0.9928
-
-+0.9396 +0.0022 +0.0078 +0.0098 +0.0176 +0.0190 +0.0041
-+0.0019 +0.9694 +0.0047 +0.0043 +0.0063 +0.0058 +0.0075
-+0.0072 +0.0051 +0.9520 +0.0072 +0.0103 +0.0093 +0.0089
-+0.0106 +0.0055 +0.0085 +0.9377 +0.0137 +0.0123 +0.0117
-+0.0141 +0.0059 +0.0089 +0.0101 +0.9358 +0.0130 +0.0123
-+0.0175 +0.0063 +0.0093 +0.0104 +0.0150 +0.9378 +0.0037
-+0.0041 +0.0088 +0.0097 +0.0107 +0.0154 +0.0040 +0.9474
-
-+0.8190 +0.0078 +0.0240 +0.0292 +0.0515 +0.0551 +0.0133
-+0.0067 +0.9044 +0.0149 +0.0135 +0.0197 +0.0179 +0.0230
-+0.0222 +0.0160 +0.8535 +0.0220 +0.0312 +0.0281 +0.0269
-+0.0319 +0.0172 +0.0261 +0.8130 +0.0409 +0.0364 +0.0345
-+0.0412 +0.0183 +0.0271 +0.0300 +0.8087 +0.0385 +0.0362
-+0.0509 +0.0193 +0.0281 +0.0308 +0.0444 +0.8141 +0.0124
-+0.0133 +0.0268 +0.0292 +0.0316 +0.0453 +0.0134 +0.8403
-
-+0.5176 +0.0312 +0.0695 +0.0774 +0.1271 +0.1318 +0.0454
-+0.0267 +0.7087 +0.0465 +0.0417 +0.0592 +0.0524 +0.0648
-+0.0642 +0.0501 +0.5860 +0.0621 +0.0870 +0.0771 +0.0735
-+0.0844 +0.0530 +0.0734 +0.5001 +0.1067 +0.0940 +0.0883
-+0.1017 +0.0553 +0.0754 +0.0782 +0.5005 +0.0981 +0.0908
-+0.1217 +0.0564 +0.0771 +0.0795 +0.1132 +0.5084 +0.0437
-+0.0454 +0.0756 +0.0796 +0.0810 +0.1135 +0.0473 +0.5575
-
-
-[0] P-matrix for branch length 1.000000
-+0.9595 +0.0015 +0.0052 +0.0066 +0.0118 +0.0128 +0.0027
-+0.0013 +0.9796 +0.0031 +0.0029 +0.0042 +0.0039 +0.0050
-+0.0048 +0.0034 +0.9679 +0.0048 +0.0069 +0.0062 +0.0060
-+0.0071 +0.0037 +0.0057 +0.9582 +0.0092 +0.0082 +0.0078
-+0.0095 +0.0039 +0.0060 +0.0068 +0.9568 +0.0087 +0.0083
-+0.0118 +0.0042 +0.0062 +0.0070 +0.0101 +0.9583 +0.0025
-+0.0027 +0.0059 +0.0065 +0.0072 +0.0104 +0.0027 +0.9647
-
-+0.7389 +0.0124 +0.0353 +0.0421 +0.0731 +0.0777 +0.0204
-+0.0107 +0.8577 +0.0223 +0.0202 +0.0292 +0.0264 +0.0336
-+0.0326 +0.0240 +0.7858 +0.0322 +0.0455 +0.0408 +0.0391
-+0.0460 +0.0257 +0.0381 +0.7299 +0.0587 +0.0522 +0.0494
-+0.0584 +0.0272 +0.0395 +0.0431 +0.7252 +0.0550 +0.0516
-+0.0717 +0.0284 +0.0408 +0.0441 +0.0634 +0.7323 +0.0192
-+0.0204 +0.0392 +0.0423 +0.0453 +0.0645 +0.0208 +0.7675
-
-+0.4103 +0.0452 +0.0881 +0.0939 +0.1492 +0.1518 +0.0614
-+0.0388 +0.6195 +0.0615 +0.0546 +0.0769 +0.0672 +0.0814
-+0.0814 +0.0662 +0.4799 +0.0778 +0.1084 +0.0955 +0.0907
-+0.1025 +0.0695 +0.0920 +0.3888 +0.1287 +0.1129 +0.1056
-+0.1194 +0.0718 +0.0939 +0.0944 +0.3958 +0.1171 +0.1076
-+0.1401 +0.0724 +0.0955 +0.0955 +0.1352 +0.4015 +0.0598
-+0.0614 +0.0950 +0.0983 +0.0968 +0.1345 +0.0648 +0.4493
-
-+0.1563 +0.1247 +0.1415 +0.1246 +0.1731 +0.1559 +0.1238
-+0.1069 +0.2592 +0.1253 +0.1073 +0.1469 +0.1258 +0.1285
-+0.1306 +0.1350 +0.1771 +0.1199 +0.1638 +0.1421 +0.1315
-+0.1360 +0.1366 +0.1417 +0.1370 +0.1685 +0.1462 +0.1341
-+0.1385 +0.1371 +0.1420 +0.1236 +0.1781 +0.1471 +0.1336
-+0.1439 +0.1355 +0.1421 +0.1237 +0.1697 +0.1615 +0.1236
-+0.1238 +0.1499 +0.1425 +0.1229 +0.1671 +0.1339 +0.1600
-
-
-[0] P-matrix for branch length 1.000000
-+0.9595 +0.0015 +0.0052 +0.0066 +0.0118 +0.0128 +0.0027
-+0.0013 +0.9796 +0.0031 +0.0029 +0.0042 +0.0039 +0.0050
-+0.0048 +0.0034 +0.9679 +0.0048 +0.0069 +0.0062 +0.0060
-+0.0071 +0.0037 +0.0057 +0.9582 +0.0092 +0.0082 +0.0078
-+0.0095 +0.0039 +0.0060 +0.0068 +0.9568 +0.0087 +0.0083
-+0.0118 +0.0042 +0.0062 +0.0070 +0.0101 +0.9583 +0.0025
-+0.0027 +0.0059 +0.0065 +0.0072 +0.0104 +0.0027 +0.9647
-
-+0.7389 +0.0124 +0.0353 +0.0421 +0.0731 +0.0777 +0.0204
-+0.0107 +0.8577 +0.0223 +0.0202 +0.0292 +0.0264 +0.0336
-+0.0326 +0.0240 +0.7858 +0.0322 +0.0455 +0.0408 +0.0391
-+0.0460 +0.0257 +0.0381 +0.7299 +0.0587 +0.0522 +0.0494
-+0.0584 +0.0272 +0.0395 +0.0431 +0.7252 +0.0550 +0.0516
-+0.0717 +0.0284 +0.0408 +0.0441 +0.0634 +0.7323 +0.0192
-+0.0204 +0.0392 +0.0423 +0.0453 +0.0645 +0.0208 +0.7675
-
-+0.4103 +0.0452 +0.0881 +0.0939 +0.1492 +0.1518 +0.0614
-+0.0388 +0.6195 +0.0615 +0.0546 +0.0769 +0.0672 +0.0814
-+0.0814 +0.0662 +0.4799 +0.0778 +0.1084 +0.0955 +0.0907
-+0.1025 +0.0695 +0.0920 +0.3888 +0.1287 +0.1129 +0.1056
-+0.1194 +0.0718 +0.0939 +0.0944 +0.3958 +0.1171 +0.1076
-+0.1401 +0.0724 +0.0955 +0.0955 +0.1352 +0.4015 +0.0598
-+0.0614 +0.0950 +0.0983 +0.0968 +0.1345 +0.0648 +0.4493
-
-+0.1563 +0.1247 +0.1415 +0.1246 +0.1731 +0.1559 +0.1238
-+0.1069 +0.2592 +0.1253 +0.1073 +0.1469 +0.1258 +0.1285
-+0.1306 +0.1350 +0.1771 +0.1199 +0.1638 +0.1421 +0.1315
-+0.1360 +0.1366 +0.1417 +0.1370 +0.1685 +0.1462 +0.1341
-+0.1385 +0.1371 +0.1420 +0.1236 +0.1781 +0.1471 +0.1336
-+0.1439 +0.1355 +0.1421 +0.1237 +0.1697 +0.1615 +0.1236
-+0.1238 +0.1499 +0.1425 +0.1229 +0.1671 +0.1339 +0.1600
-
-
-[0] CLV 5: [ {(0.98353,0.00000,0.00000,0.00000,0.00000,0.00001,0.00000),(0.88284,0.00000,0.00005,0.00011,0.00020,0.00031,0.00002),(0.67077,0.00004,0.00049,0.00102,0.00170,0.00259,0.00018),(0.26793,0.00071,0.00412,0.00712,0.01034,0.01480,0.00206)} {(0.00105,0.00000,0.00097,0.00000,0.00000,0.00000,0.00000),(0.00732,0.00001,0.00685,0.00009,0.00013,0.00016,0.00004),(0.01966,0.00010,0.01891,0.00083,0.00112,0.00143,0.00039),(0.03598,0.00124,0.03760,0.00620,0.00767,0.00938,0.00361)} {(0.00000,0 [...]
-[0] CLV 6: [ {(0.97135,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000),(0.80400,0.00000,0.00002,0.00005,0.00009,0.00014,0.00001),(0.49672,0.00001,0.00018,0.00039,0.00068,0.00106,0.00006),(0.09954,0.00014,0.00093,0.00174,0.00266,0.00402,0.00043)} {(0.00104,0.00000,0.00096,0.00000,0.00000,0.00000,0.00000),(0.00710,0.00003,0.00665,0.00016,0.00020,0.00026,0.00000),(0.01785,0.00033,0.01727,0.00135,0.00169,0.00213,0.00013),(0.02748,0.00304,0.02881,0.00827,0.00949,0.01159,0.00285)} {(0.00000,0 [...]
-[0] CLV 7: [ {(0.98353,0.00000,0.00000,0.00000,0.00000,0.00001,0.00000),(0.88284,0.00000,0.00005,0.00011,0.00020,0.00031,0.00002),(0.67077,0.00004,0.00049,0.00102,0.00170,0.00259,0.00018),(0.26793,0.00071,0.00412,0.00712,0.01034,0.01480,0.00206)} {(0.00000,0.00058,0.00000,0.00073,0.00000,0.00000,0.00000),(0.00002,0.00419,0.00004,0.00515,0.00006,0.00007,0.00009),(0.00023,0.01224,0.00035,0.01401,0.00055,0.00060,0.00085),(0.00241,0.02953,0.00311,0.02653,0.00432,0.00449,0.00612)} {(0.00000,0 [...]
-
-inner-inner logL: -95.791417
-persite logL: -2.8335795 -10.7142648 -7.5776319 -2.0675460 -12.0672153 -12.2778810 -9.6698751 -0.3875789 -9.0486143 -8.0535214 -11.8215995 -9.2721097
-checksum logL: -95.791417
-tip-inner logL: -95.791417
-persite logL: -2.8335795 -10.7142648 -7.5776319 -2.0675460 -12.0672153 -12.2778810 -9.6698751 -0.3875789 -9.0486143 -8.0535214 -11.8215995 -9.2721097
-checksum logL: -95.791417
diff --git a/test/out/00020_NMDR_lkcalc.out b/test/out/00020_NMDR_lkcalc.out
deleted file mode 100644
index 9598fa9..0000000
--- a/test/out/00020_NMDR_lkcalc.out
+++ /dev/null
@@ -1,98 +0,0 @@
-[0] P-matrix for branch length 0.500000
-+0.9864 +0.0064 +0.0040 +0.0032
-+0.0048 +0.9856 +0.0016 +0.0080
-+0.0120 +0.0064 +0.9784 +0.0032
-+0.0048 +0.0159 +0.0016 +0.9776
-
-+0.9038 +0.0460 +0.0272 +0.0230
-+0.0345 +0.9002 +0.0115 +0.0538
-+0.0815 +0.0460 +0.8495 +0.0230
-+0.0345 +0.1075 +0.0115 +0.8464
-
-+0.7344 +0.1314 +0.0685 +0.0657
-+0.0985 +0.7355 +0.0328 +0.1331
-+0.2056 +0.1314 +0.5973 +0.0657
-+0.0985 +0.2662 +0.0328 +0.6024
-
-+0.4368 +0.3019 +0.1104 +0.1509
-+0.2264 +0.4885 +0.0755 +0.2096
-+0.3312 +0.3019 +0.2160 +0.1509
-+0.2264 +0.4192 +0.0755 +0.2789
-
-
-[0] P-matrix for branch length 0.500000
-+0.9864 +0.0064 +0.0040 +0.0032
-+0.0048 +0.9856 +0.0016 +0.0080
-+0.0120 +0.0064 +0.9784 +0.0032
-+0.0048 +0.0159 +0.0016 +0.9776
-
-+0.9038 +0.0460 +0.0272 +0.0230
-+0.0345 +0.9002 +0.0115 +0.0538
-+0.0815 +0.0460 +0.8495 +0.0230
-+0.0345 +0.1075 +0.0115 +0.8464
-
-+0.7344 +0.1314 +0.0685 +0.0657
-+0.0985 +0.7355 +0.0328 +0.1331
-+0.2056 +0.1314 +0.5973 +0.0657
-+0.0985 +0.2662 +0.0328 +0.6024
-
-+0.4368 +0.3019 +0.1104 +0.1509
-+0.2264 +0.4885 +0.0755 +0.2096
-+0.3312 +0.3019 +0.2160 +0.1509
-+0.2264 +0.4192 +0.0755 +0.2789
-
-
-[0] P-matrix for branch length 0.300000
-+0.9918 +0.0039 +0.0024 +0.0019
-+0.0029 +0.9913 +0.0010 +0.0048
-+0.0072 +0.0039 +0.9870 +0.0019
-+0.0029 +0.0096 +0.0010 +0.9865
-
-+0.9405 +0.0283 +0.0171 +0.0141
-+0.0212 +0.9378 +0.0071 +0.0339
-+0.0512 +0.0283 +0.9063 +0.0141
-+0.0212 +0.0679 +0.0071 +0.9038
-
-+0.8249 +0.0850 +0.0475 +0.0425
-+0.0638 +0.8217 +0.0213 +0.0933
-+0.1426 +0.0850 +0.7299 +0.0425
-+0.0638 +0.1866 +0.0213 +0.7284
-
-+0.5586 +0.2278 +0.0997 +0.1139
-+0.1709 +0.5820 +0.0570 +0.1902
-+0.2990 +0.2278 +0.3592 +0.1139
-+0.1709 +0.3804 +0.0570 +0.3917
-
-
-[0] P-matrix for branch length 0.200000
-+0.9945 +0.0026 +0.0016 +0.0013
-+0.0019 +0.9942 +0.0006 +0.0032
-+0.0048 +0.0026 +0.9913 +0.0013
-+0.0019 +0.0064 +0.0006 +0.9910
-
-+0.9597 +0.0191 +0.0117 +0.0095
-+0.0143 +0.9577 +0.0048 +0.0232
-+0.0350 +0.0191 +0.9364 +0.0095
-+0.0143 +0.0464 +0.0048 +0.9345
-
-+0.8775 +0.0589 +0.0342 +0.0294
-+0.0442 +0.8737 +0.0147 +0.0674
-+0.1025 +0.0589 +0.8092 +0.0294
-+0.0442 +0.1348 +0.0147 +0.8063
-
-+0.6582 +0.1720 +0.0838 +0.0860
-+0.1290 +0.6666 +0.0430 +0.1614
-+0.2514 +0.1720 +0.4907 +0.0860
-+0.1290 +0.3228 +0.0430 +0.5052
-
-
-[0] CLV 5: [ {(0.00636,0.01260,0.00010,0.01565),(0.04267,0.07948,0.00481,0.09473),(0.10512,0.17038,0.03564,0.18660),(0.17741,0.21300,0.14554,0.21184)} {(0.00634,0.00475,0.00008,0.00008),(0.04161,0.03109,0.00375,0.00371),(0.09649,0.07248,0.02701,0.02623),(0.13185,0.11060,0.09998,0.09491)} {(0.00004,0.97142,0.00004,0.00025),(0.00212,0.81035,0.00212,0.01156),(0.01726,0.54096,0.01726,0.07088),(0.09112,0.23865,0.09112,0.17576)} {(1.00000,1.00000,1.00000,1.00000),(1.00000,1.00000,1.00000,1.000 [...]
-[0] CLV 6: [ {(0.00632,0.00006,0.00000,0.00007),(0.04025,0.00270,0.00109,0.00312),(0.08393,0.01593,0.01594,0.01668),(0.08292,0.04519,0.06176,0.04517)} {(0.00629,0.00472,0.00018,0.00018),(0.03923,0.02966,0.00809,0.00797),(0.08396,0.06719,0.04722,0.04549),(0.11634,0.11132,0.11298,0.11023)} {(0.00004,0.94365,0.00004,0.00025),(0.00182,0.65731,0.00182,0.01043),(0.01177,0.30125,0.01177,0.05031),(0.04480,0.08839,0.04480,0.07403)} {(1.00000,1.00000,1.00000,1.00000),(1.00000,1.00000,1.00000,1.000 [...]
-[0] CLV 7: [ {(0.00004,0.97142,0.00004,0.00025),(0.00212,0.81035,0.00212,0.01156),(0.01726,0.54096,0.01726,0.07088),(0.09112,0.23865,0.09112,0.17576)} {(0.00317,0.00004,0.00004,0.00472),(0.02081,0.00186,0.00188,0.02923),(0.04824,0.01312,0.01350,0.05936),(0.06593,0.04746,0.04999,0.06314)} {(0.00004,0.97142,0.00004,0.00025),(0.00212,0.81035,0.00212,0.01156),(0.01726,0.54096,0.01726,0.07088),(0.09112,0.23865,0.09112,0.17576)} {(0.00322,0.00796,0.00322,0.97764),(0.02302,0.05376,0.02302,0.846 [...]
-
-inner-inner logL: -56.794804
-persite logL: -5.4918656 -6.1108011 -1.8692434 -1.6094379 -5.5400058 -7.3473984 -5.8428678 -0.0000000 -5.2305290 -2.5066511 -7.5044254 -7.7415788
-checksum logL: -56.794804
-tip-inner logL: -56.794804
-persite logL: -5.4918656 -6.1108011 -1.8692434 -1.6094379 -5.5400058 -7.3473984 -5.8428678 -0.0000000 -5.2305290 -2.5066511 -7.5044254 -7.7415788
-checksum logL: -56.794804
diff --git a/test/out/00021_NMAR_lkcalc.out b/test/out/00021_NMAR_lkcalc.out
deleted file mode 100644
index 271c413..0000000
--- a/test/out/00021_NMAR_lkcalc.out
+++ /dev/null
@@ -1,354 +0,0 @@
-[0] P-matrix for branch length 0.500000
-+0.9781 +0.0002 +0.0007 +0.0009 +0.0002 +0.0006 +0.0016 +0.0035 +0.0001 +0.0004 +0.0006 +0.0004 +0.0002 +0.0001 +0.0021 +0.0046 +0.0035 +0.0000 +0.0001 +0.0022
-+0.0004 +0.9857 +0.0002 +0.0000 +0.0001 +0.0015 +0.0000 +0.0001 +0.0013 +0.0004 +0.0002 +0.0061 +0.0002 +0.0001 +0.0009 +0.0018 +0.0003 +0.0003 +0.0000 +0.0003
-+0.0014 +0.0002 +0.9706 +0.0069 +0.0000 +0.0007 +0.0012 +0.0020 +0.0029 +0.0005 +0.0005 +0.0042 +0.0000 +0.0001 +0.0004 +0.0056 +0.0022 +0.0000 +0.0005 +0.0002
-+0.0017 +0.0000 +0.0059 +0.9767 +0.0000 +0.0009 +0.0093 +0.0018 +0.0005 +0.0001 +0.0000 +0.0010 +0.0000 +0.0000 +0.0001 +0.0011 +0.0006 +0.0000 +0.0000 +0.0002
-+0.0005 +0.0002 +0.0000 +0.0000 +0.9956 +0.0000 +0.0000 +0.0002 +0.0002 +0.0003 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0018 +0.0002 +0.0000 +0.0005 +0.0005
-+0.0013 +0.0016 +0.0007 +0.0011 +0.0000 +0.9796 +0.0058 +0.0004 +0.0033 +0.0001 +0.0010 +0.0020 +0.0003 +0.0000 +0.0013 +0.0006 +0.0005 +0.0000 +0.0000 +0.0004
-+0.0028 +0.0000 +0.0010 +0.0088 +0.0000 +0.0045 +0.9776 +0.0012 +0.0002 +0.0004 +0.0002 +0.0011 +0.0001 +0.0000 +0.0004 +0.0009 +0.0003 +0.0000 +0.0001 +0.0004
-+0.0034 +0.0001 +0.0009 +0.0010 +0.0001 +0.0002 +0.0007 +0.9892 +0.0001 +0.0000 +0.0001 +0.0004 +0.0000 +0.0001 +0.0003 +0.0027 +0.0003 +0.0000 +0.0000 +0.0006
-+0.0003 +0.0016 +0.0035 +0.0007 +0.0002 +0.0038 +0.0004 +0.0002 +0.9855 +0.0000 +0.0006 +0.0004 +0.0000 +0.0003 +0.0008 +0.0004 +0.0002 +0.0000 +0.0006 +0.0005
-+0.0009 +0.0004 +0.0005 +0.0002 +0.0002 +0.0001 +0.0005 +0.0000 +0.0000 +0.9789 +0.0036 +0.0006 +0.0008 +0.0013 +0.0001 +0.0003 +0.0018 +0.0000 +0.0002 +0.0094
-+0.0006 +0.0001 +0.0002 +0.0000 +0.0000 +0.0005 +0.0001 +0.0001 +0.0002 +0.0016 +0.9912 +0.0002 +0.0013 +0.0010 +0.0003 +0.0002 +0.0003 +0.0001 +0.0001 +0.0019
-+0.0004 +0.0031 +0.0021 +0.0006 +0.0000 +0.0010 +0.0007 +0.0004 +0.0002 +0.0003 +0.0003 +0.9877 +0.0006 +0.0000 +0.0003 +0.0011 +0.0013 +0.0000 +0.0001 +0.0001
-+0.0010 +0.0006 +0.0000 +0.0000 +0.0000 +0.0007 +0.0002 +0.0003 +0.0000 +0.0020 +0.0074 +0.0032 +0.9793 +0.0006 +0.0001 +0.0007 +0.0010 +0.0000 +0.0000 +0.0027
-+0.0003 +0.0001 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0003 +0.0012 +0.0022 +0.0000 +0.0002 +0.9910 +0.0001 +0.0005 +0.0001 +0.0001 +0.0034 +0.0001
-+0.0036 +0.0007 +0.0003 +0.0001 +0.0001 +0.0010 +0.0004 +0.0005 +0.0005 +0.0001 +0.0005 +0.0004 +0.0000 +0.0001 +0.9877 +0.0028 +0.0008 +0.0000 +0.0000 +0.0005
-+0.0058 +0.0010 +0.0032 +0.0007 +0.0009 +0.0004 +0.0006 +0.0034 +0.0002 +0.0002 +0.0002 +0.0013 +0.0002 +0.0003 +0.0020 +0.9737 +0.0052 +0.0001 +0.0002 +0.0003
-+0.0053 +0.0002 +0.0015 +0.0005 +0.0001 +0.0003 +0.0003 +0.0005 +0.0001 +0.0012 +0.0005 +0.0018 +0.0003 +0.0001 +0.0007 +0.0062 +0.9787 +0.0000 +0.0002 +0.0017
-+0.0000 +0.0014 +0.0002 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0000 +0.0006 +0.0000 +0.0000 +0.0005 +0.0000 +0.0009 +0.0000 +0.9960 +0.0003 +0.0000
-+0.0003 +0.0001 +0.0006 +0.0000 +0.0005 +0.0000 +0.0002 +0.0000 +0.0007 +0.0002 +0.0004 +0.0002 +0.0000 +0.0046 +0.0000 +0.0004 +0.0004 +0.0001 +0.9910 +0.0003
-+0.0030 +0.0002 +0.0001 +0.0001 +0.0003 +0.0002 +0.0003 +0.0008 +0.0002 +0.0053 +0.0025 +0.0001 +0.0006 +0.0001 +0.0004 +0.0004 +0.0015 +0.0000 +0.0001 +0.9837
-
-+0.8476 +0.0015 +0.0049 +0.0067 +0.0015 +0.0040 +0.0109 +0.0242 +0.0011 +0.0031 +0.0043 +0.0029 +0.0013 +0.0009 +0.0144 +0.0308 +0.0240 +0.0000 +0.0009 +0.0150
-+0.0031 +0.8975 +0.0020 +0.0003 +0.0010 +0.0107 +0.0005 +0.0012 +0.0093 +0.0027 +0.0017 +0.0425 +0.0016 +0.0007 +0.0062 +0.0119 +0.0022 +0.0025 +0.0003 +0.0020
-+0.0106 +0.0021 +0.8005 +0.0441 +0.0002 +0.0049 +0.0095 +0.0143 +0.0193 +0.0032 +0.0034 +0.0280 +0.0002 +0.0008 +0.0029 +0.0360 +0.0151 +0.0003 +0.0032 +0.0015
-+0.0124 +0.0002 +0.0381 +0.8402 +0.0000 +0.0067 +0.0606 +0.0131 +0.0037 +0.0012 +0.0002 +0.0073 +0.0001 +0.0000 +0.0011 +0.0084 +0.0049 +0.0000 +0.0001 +0.0016
-+0.0039 +0.0012 +0.0002 +0.0001 +0.9671 +0.0001 +0.0001 +0.0014 +0.0011 +0.0019 +0.0001 +0.0001 +0.0000 +0.0001 +0.0013 +0.0126 +0.0014 +0.0000 +0.0034 +0.0038
-+0.0092 +0.0114 +0.0052 +0.0082 +0.0001 +0.8569 +0.0382 +0.0033 +0.0226 +0.0010 +0.0072 +0.0143 +0.0019 +0.0001 +0.0089 +0.0049 +0.0038 +0.0000 +0.0001 +0.0028
-+0.0192 +0.0004 +0.0078 +0.0574 +0.0001 +0.0295 +0.8455 +0.0088 +0.0022 +0.0026 +0.0013 +0.0080 +0.0006 +0.0001 +0.0033 +0.0067 +0.0029 +0.0000 +0.0008 +0.0030
-+0.0238 +0.0006 +0.0065 +0.0069 +0.0005 +0.0014 +0.0049 +0.9220 +0.0005 +0.0002 +0.0009 +0.0028 +0.0003 +0.0007 +0.0024 +0.0184 +0.0028 +0.0000 +0.0001 +0.0042
-+0.0028 +0.0113 +0.0232 +0.0052 +0.0011 +0.0257 +0.0032 +0.0014 +0.8963 +0.0005 +0.0046 +0.0033 +0.0001 +0.0023 +0.0057 +0.0035 +0.0018 +0.0004 +0.0044 +0.0033
-+0.0072 +0.0030 +0.0035 +0.0015 +0.0018 +0.0010 +0.0035 +0.0004 +0.0004 +0.8530 +0.0254 +0.0045 +0.0056 +0.0089 +0.0009 +0.0024 +0.0126 +0.0000 +0.0014 +0.0629
-+0.0044 +0.0008 +0.0016 +0.0001 +0.0000 +0.0032 +0.0008 +0.0009 +0.0018 +0.0110 +0.9360 +0.0019 +0.0088 +0.0074 +0.0020 +0.0016 +0.0025 +0.0006 +0.0011 +0.0135
-+0.0032 +0.0216 +0.0141 +0.0043 +0.0000 +0.0068 +0.0049 +0.0031 +0.0014 +0.0020 +0.0020 +0.9115 +0.0040 +0.0001 +0.0022 +0.0080 +0.0092 +0.0000 +0.0005 +0.0010
-+0.0074 +0.0044 +0.0004 +0.0002 +0.0001 +0.0050 +0.0019 +0.0020 +0.0002 +0.0140 +0.0509 +0.0219 +0.8545 +0.0044 +0.0012 +0.0051 +0.0071 +0.0000 +0.0001 +0.0192
-+0.0020 +0.0007 +0.0008 +0.0001 +0.0001 +0.0001 +0.0001 +0.0016 +0.0019 +0.0082 +0.0159 +0.0001 +0.0016 +0.9344 +0.0007 +0.0037 +0.0011 +0.0010 +0.0245 +0.0014
-+0.0247 +0.0050 +0.0023 +0.0010 +0.0008 +0.0067 +0.0032 +0.0041 +0.0038 +0.0007 +0.0033 +0.0034 +0.0004 +0.0006 +0.9111 +0.0192 +0.0058 +0.0000 +0.0001 +0.0038
-+0.0386 +0.0070 +0.0209 +0.0057 +0.0061 +0.0027 +0.0048 +0.0234 +0.0017 +0.0013 +0.0019 +0.0093 +0.0011 +0.0021 +0.0140 +0.8200 +0.0345 +0.0009 +0.0013 +0.0028
-+0.0357 +0.0016 +0.0104 +0.0039 +0.0008 +0.0025 +0.0024 +0.0042 +0.0011 +0.0079 +0.0036 +0.0126 +0.0018 +0.0007 +0.0051 +0.0410 +0.8515 +0.0000 +0.0015 +0.0118
-+0.0002 +0.0096 +0.0011 +0.0000 +0.0000 +0.0001 +0.0000 +0.0001 +0.0011 +0.0001 +0.0047 +0.0003 +0.0000 +0.0037 +0.0001 +0.0059 +0.0001 +0.9703 +0.0022 +0.0001
-+0.0026 +0.0005 +0.0043 +0.0002 +0.0038 +0.0001 +0.0013 +0.0002 +0.0050 +0.0018 +0.0032 +0.0013 +0.0001 +0.0325 +0.0001 +0.0029 +0.0029 +0.0008 +0.9343 +0.0022
-+0.0202 +0.0012 +0.0010 +0.0012 +0.0020 +0.0017 +0.0023 +0.0058 +0.0017 +0.0359 +0.0177 +0.0013 +0.0044 +0.0008 +0.0030 +0.0030 +0.0106 +0.0000 +0.0010 +0.8851
-
-+0.5954 +0.0052 +0.0152 +0.0192 +0.0049 +0.0117 +0.0279 +0.0641 +0.0040 +0.0098 +0.0132 +0.0110 +0.0036 +0.0030 +0.0376 +0.0736 +0.0592 +0.0002 +0.0028 +0.0384
-+0.0112 +0.7075 +0.0084 +0.0025 +0.0030 +0.0281 +0.0039 +0.0054 +0.0250 +0.0075 +0.0063 +0.1121 +0.0047 +0.0023 +0.0177 +0.0306 +0.0089 +0.0070 +0.0013 +0.0066
-+0.0327 +0.0085 +0.4956 +0.0962 +0.0014 +0.0152 +0.0305 +0.0398 +0.0451 +0.0082 +0.0099 +0.0686 +0.0012 +0.0029 +0.0101 +0.0796 +0.0387 +0.0009 +0.0083 +0.0066
-+0.0357 +0.0022 +0.0830 +0.5836 +0.0005 +0.0220 +0.1377 +0.0375 +0.0123 +0.0041 +0.0021 +0.0237 +0.0006 +0.0005 +0.0052 +0.0264 +0.0157 +0.0001 +0.0010 +0.0060
-+0.0127 +0.0037 +0.0017 +0.0007 +0.8972 +0.0006 +0.0007 +0.0054 +0.0034 +0.0058 +0.0010 +0.0012 +0.0003 +0.0008 +0.0045 +0.0330 +0.0058 +0.0001 +0.0101 +0.0113
-+0.0266 +0.0300 +0.0161 +0.0269 +0.0005 +0.6114 +0.0896 +0.0117 +0.0560 +0.0037 +0.0201 +0.0396 +0.0051 +0.0008 +0.0241 +0.0157 +0.0118 +0.0002 +0.0009 +0.0090
-+0.0490 +0.0032 +0.0249 +0.1303 +0.0005 +0.0692 +0.5943 +0.0272 +0.0087 +0.0070 +0.0052 +0.0238 +0.0018 +0.0006 +0.0106 +0.0207 +0.0109 +0.0001 +0.0023 +0.0096
-+0.0630 +0.0025 +0.0181 +0.0199 +0.0021 +0.0050 +0.0152 +0.7721 +0.0024 +0.0016 +0.0034 +0.0096 +0.0012 +0.0023 +0.0086 +0.0482 +0.0115 +0.0001 +0.0005 +0.0127
-+0.0104 +0.0304 +0.0543 +0.0171 +0.0034 +0.0638 +0.0129 +0.0062 +0.7041 +0.0024 +0.0138 +0.0140 +0.0007 +0.0069 +0.0164 +0.0129 +0.0072 +0.0012 +0.0124 +0.0097
-+0.0232 +0.0083 +0.0090 +0.0052 +0.0052 +0.0039 +0.0094 +0.0038 +0.0022 +0.6047 +0.0700 +0.0135 +0.0146 +0.0237 +0.0040 +0.0095 +0.0324 +0.0002 +0.0048 +0.1521
-+0.0134 +0.0030 +0.0047 +0.0012 +0.0004 +0.0090 +0.0030 +0.0036 +0.0054 +0.0303 +0.8103 +0.0068 +0.0229 +0.0215 +0.0062 +0.0057 +0.0082 +0.0018 +0.0039 +0.0388
-+0.0119 +0.0570 +0.0345 +0.0138 +0.0005 +0.0188 +0.0147 +0.0106 +0.0058 +0.0062 +0.0072 +0.7455 +0.0103 +0.0006 +0.0074 +0.0237 +0.0251 +0.0003 +0.0017 +0.0044
-+0.0214 +0.0130 +0.0033 +0.0019 +0.0006 +0.0131 +0.0062 +0.0071 +0.0017 +0.0366 +0.1324 +0.0562 +0.6018 +0.0130 +0.0047 +0.0145 +0.0198 +0.0002 +0.0011 +0.0516
-+0.0067 +0.0024 +0.0029 +0.0006 +0.0007 +0.0008 +0.0007 +0.0052 +0.0059 +0.0219 +0.0461 +0.0013 +0.0048 +0.8053 +0.0025 +0.0101 +0.0042 +0.0029 +0.0685 +0.0065
-+0.0646 +0.0142 +0.0080 +0.0048 +0.0030 +0.0182 +0.0103 +0.0151 +0.0109 +0.0029 +0.0104 +0.0117 +0.0014 +0.0020 +0.7412 +0.0495 +0.0189 +0.0002 +0.0005 +0.0121
-+0.0921 +0.0180 +0.0462 +0.0178 +0.0159 +0.0086 +0.0148 +0.0614 +0.0062 +0.0051 +0.0070 +0.0274 +0.0031 +0.0057 +0.0361 +0.5374 +0.0802 +0.0024 +0.0039 +0.0108
-+0.0882 +0.0062 +0.0267 +0.0126 +0.0033 +0.0077 +0.0092 +0.0174 +0.0041 +0.0204 +0.0120 +0.0345 +0.0050 +0.0029 +0.0164 +0.0953 +0.6013 +0.0002 +0.0044 +0.0322
-+0.0015 +0.0272 +0.0035 +0.0005 +0.0003 +0.0008 +0.0003 +0.0009 +0.0037 +0.0006 +0.0143 +0.0026 +0.0003 +0.0112 +0.0008 +0.0158 +0.0013 +0.9068 +0.0069 +0.0006
-+0.0080 +0.0018 +0.0112 +0.0016 +0.0113 +0.0012 +0.0037 +0.0015 +0.0139 +0.0060 +0.0112 +0.0046 +0.0006 +0.0911 +0.0009 +0.0090 +0.0086 +0.0024 +0.8044 +0.0070
-+0.0517 +0.0042 +0.0041 +0.0044 +0.0059 +0.0053 +0.0074 +0.0174 +0.0050 +0.0867 +0.0512 +0.0055 +0.0118 +0.0040 +0.0094 +0.0116 +0.0291 +0.0001 +0.0032 +0.6819
-
-+0.2209 +0.0189 +0.0364 +0.0432 +0.0147 +0.0277 +0.0494 +0.1167 +0.0159 +0.0266 +0.0384 +0.0414 +0.0088 +0.0108 +0.0661 +0.1013 +0.0869 +0.0014 +0.0086 +0.0658
-+0.0402 +0.3218 +0.0303 +0.0195 +0.0094 +0.0505 +0.0236 +0.0274 +0.0473 +0.0174 +0.0254 +0.1928 +0.0111 +0.0083 +0.0404 +0.0567 +0.0335 +0.0152 +0.0063 +0.0229
-+0.0785 +0.0306 +0.1260 +0.1009 +0.0084 +0.0392 +0.0682 +0.0842 +0.0580 +0.0180 +0.0284 +0.1050 +0.0064 +0.0110 +0.0328 +0.0931 +0.0648 +0.0027 +0.0159 +0.0280
-+0.0804 +0.0170 +0.0870 +0.2131 +0.0047 +0.0533 +0.1543 +0.0861 +0.0331 +0.0140 +0.0168 +0.0652 +0.0045 +0.0048 +0.0255 +0.0642 +0.0443 +0.0010 +0.0063 +0.0246
-+0.0384 +0.0115 +0.0101 +0.0066 +0.6850 +0.0051 +0.0066 +0.0239 +0.0100 +0.0155 +0.0092 +0.0105 +0.0021 +0.0071 +0.0169 +0.0621 +0.0231 +0.0008 +0.0254 +0.0303
-+0.0632 +0.0540 +0.0414 +0.0653 +0.0044 +0.2097 +0.1122 +0.0434 +0.0808 +0.0148 +0.0449 +0.0838 +0.0100 +0.0066 +0.0479 +0.0460 +0.0349 +0.0018 +0.0064 +0.0283
-+0.0868 +0.0195 +0.0556 +0.1460 +0.0045 +0.0867 +0.2218 +0.0727 +0.0307 +0.0167 +0.0228 +0.0618 +0.0060 +0.0052 +0.0321 +0.0552 +0.0388 +0.0008 +0.0068 +0.0295
-+0.1148 +0.0126 +0.0384 +0.0456 +0.0090 +0.0188 +0.0406 +0.4314 +0.0118 +0.0114 +0.0175 +0.0348 +0.0046 +0.0078 +0.0311 +0.0867 +0.0431 +0.0009 +0.0042 +0.0347
-+0.0413 +0.0575 +0.0697 +0.0461 +0.0099 +0.0920 +0.0452 +0.0312 +0.3111 +0.0124 +0.0377 +0.0558 +0.0051 +0.0190 +0.0391 +0.0423 +0.0284 +0.0038 +0.0262 +0.0261
-+0.0627 +0.0193 +0.0197 +0.0178 +0.0141 +0.0154 +0.0224 +0.0273 +0.0113 +0.2123 +0.1413 +0.0368 +0.0253 +0.0456 +0.0192 +0.0350 +0.0570 +0.0015 +0.0161 +0.2001
-+0.0392 +0.0122 +0.0135 +0.0092 +0.0036 +0.0201 +0.0133 +0.0182 +0.0149 +0.0611 +0.5048 +0.0258 +0.0382 +0.0505 +0.0188 +0.0221 +0.0269 +0.0048 +0.0150 +0.0879
-+0.0449 +0.0980 +0.0528 +0.0380 +0.0044 +0.0399 +0.0381 +0.0383 +0.0233 +0.0169 +0.0273 +0.3927 +0.0169 +0.0055 +0.0258 +0.0558 +0.0513 +0.0025 +0.0063 +0.0215
-+0.0521 +0.0309 +0.0177 +0.0142 +0.0048 +0.0259 +0.0201 +0.0278 +0.0116 +0.0632 +0.2208 +0.0923 +0.1801 +0.0326 +0.0196 +0.0361 +0.0430 +0.0020 +0.0088 +0.0967
-+0.0237 +0.0086 +0.0112 +0.0056 +0.0060 +0.0064 +0.0064 +0.0173 +0.0161 +0.0423 +0.1085 +0.0111 +0.0121 +0.4919 +0.0099 +0.0237 +0.0173 +0.0082 +0.1427 +0.0312
-+0.1136 +0.0326 +0.0262 +0.0236 +0.0112 +0.0362 +0.0314 +0.0544 +0.0259 +0.0139 +0.0316 +0.0409 +0.0057 +0.0078 +0.3659 +0.0861 +0.0518 +0.0014 +0.0046 +0.0352
-+0.1268 +0.0333 +0.0541 +0.0432 +0.0299 +0.0253 +0.0393 +0.1105 +0.0205 +0.0186 +0.0271 +0.0646 +0.0077 +0.0135 +0.0627 +0.1705 +0.0989 +0.0049 +0.0110 +0.0377
-+0.1293 +0.0234 +0.0447 +0.0355 +0.0132 +0.0228 +0.0328 +0.0653 +0.0163 +0.0359 +0.0393 +0.0706 +0.0108 +0.0118 +0.0448 +0.1175 +0.2090 +0.0017 +0.0114 +0.0640
-+0.0114 +0.0594 +0.0104 +0.0043 +0.0025 +0.0065 +0.0039 +0.0080 +0.0120 +0.0052 +0.0391 +0.0192 +0.0028 +0.0310 +0.0068 +0.0323 +0.0093 +0.7091 +0.0203 +0.0064
-+0.0251 +0.0086 +0.0214 +0.0098 +0.0284 +0.0081 +0.0113 +0.0125 +0.0295 +0.0199 +0.0429 +0.0169 +0.0043 +0.1897 +0.0077 +0.0255 +0.0223 +0.0071 +0.4861 +0.0228
-+0.0885 +0.0145 +0.0175 +0.0178 +0.0157 +0.0167 +0.0226 +0.0476 +0.0136 +0.1140 +0.1159 +0.0267 +0.0220 +0.0192 +0.0276 +0.0405 +0.0579 +0.0010 +0.0105 +0.3101
-
-
-[0] P-matrix for branch length 0.500000
-+0.9781 +0.0002 +0.0007 +0.0009 +0.0002 +0.0006 +0.0016 +0.0035 +0.0001 +0.0004 +0.0006 +0.0004 +0.0002 +0.0001 +0.0021 +0.0046 +0.0035 +0.0000 +0.0001 +0.0022
-+0.0004 +0.9857 +0.0002 +0.0000 +0.0001 +0.0015 +0.0000 +0.0001 +0.0013 +0.0004 +0.0002 +0.0061 +0.0002 +0.0001 +0.0009 +0.0018 +0.0003 +0.0003 +0.0000 +0.0003
-+0.0014 +0.0002 +0.9706 +0.0069 +0.0000 +0.0007 +0.0012 +0.0020 +0.0029 +0.0005 +0.0005 +0.0042 +0.0000 +0.0001 +0.0004 +0.0056 +0.0022 +0.0000 +0.0005 +0.0002
-+0.0017 +0.0000 +0.0059 +0.9767 +0.0000 +0.0009 +0.0093 +0.0018 +0.0005 +0.0001 +0.0000 +0.0010 +0.0000 +0.0000 +0.0001 +0.0011 +0.0006 +0.0000 +0.0000 +0.0002
-+0.0005 +0.0002 +0.0000 +0.0000 +0.9956 +0.0000 +0.0000 +0.0002 +0.0002 +0.0003 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0018 +0.0002 +0.0000 +0.0005 +0.0005
-+0.0013 +0.0016 +0.0007 +0.0011 +0.0000 +0.9796 +0.0058 +0.0004 +0.0033 +0.0001 +0.0010 +0.0020 +0.0003 +0.0000 +0.0013 +0.0006 +0.0005 +0.0000 +0.0000 +0.0004
-+0.0028 +0.0000 +0.0010 +0.0088 +0.0000 +0.0045 +0.9776 +0.0012 +0.0002 +0.0004 +0.0002 +0.0011 +0.0001 +0.0000 +0.0004 +0.0009 +0.0003 +0.0000 +0.0001 +0.0004
-+0.0034 +0.0001 +0.0009 +0.0010 +0.0001 +0.0002 +0.0007 +0.9892 +0.0001 +0.0000 +0.0001 +0.0004 +0.0000 +0.0001 +0.0003 +0.0027 +0.0003 +0.0000 +0.0000 +0.0006
-+0.0003 +0.0016 +0.0035 +0.0007 +0.0002 +0.0038 +0.0004 +0.0002 +0.9855 +0.0000 +0.0006 +0.0004 +0.0000 +0.0003 +0.0008 +0.0004 +0.0002 +0.0000 +0.0006 +0.0005
-+0.0009 +0.0004 +0.0005 +0.0002 +0.0002 +0.0001 +0.0005 +0.0000 +0.0000 +0.9789 +0.0036 +0.0006 +0.0008 +0.0013 +0.0001 +0.0003 +0.0018 +0.0000 +0.0002 +0.0094
-+0.0006 +0.0001 +0.0002 +0.0000 +0.0000 +0.0005 +0.0001 +0.0001 +0.0002 +0.0016 +0.9912 +0.0002 +0.0013 +0.0010 +0.0003 +0.0002 +0.0003 +0.0001 +0.0001 +0.0019
-+0.0004 +0.0031 +0.0021 +0.0006 +0.0000 +0.0010 +0.0007 +0.0004 +0.0002 +0.0003 +0.0003 +0.9877 +0.0006 +0.0000 +0.0003 +0.0011 +0.0013 +0.0000 +0.0001 +0.0001
-+0.0010 +0.0006 +0.0000 +0.0000 +0.0000 +0.0007 +0.0002 +0.0003 +0.0000 +0.0020 +0.0074 +0.0032 +0.9793 +0.0006 +0.0001 +0.0007 +0.0010 +0.0000 +0.0000 +0.0027
-+0.0003 +0.0001 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0003 +0.0012 +0.0022 +0.0000 +0.0002 +0.9910 +0.0001 +0.0005 +0.0001 +0.0001 +0.0034 +0.0001
-+0.0036 +0.0007 +0.0003 +0.0001 +0.0001 +0.0010 +0.0004 +0.0005 +0.0005 +0.0001 +0.0005 +0.0004 +0.0000 +0.0001 +0.9877 +0.0028 +0.0008 +0.0000 +0.0000 +0.0005
-+0.0058 +0.0010 +0.0032 +0.0007 +0.0009 +0.0004 +0.0006 +0.0034 +0.0002 +0.0002 +0.0002 +0.0013 +0.0002 +0.0003 +0.0020 +0.9737 +0.0052 +0.0001 +0.0002 +0.0003
-+0.0053 +0.0002 +0.0015 +0.0005 +0.0001 +0.0003 +0.0003 +0.0005 +0.0001 +0.0012 +0.0005 +0.0018 +0.0003 +0.0001 +0.0007 +0.0062 +0.9787 +0.0000 +0.0002 +0.0017
-+0.0000 +0.0014 +0.0002 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0002 +0.0000 +0.0006 +0.0000 +0.0000 +0.0005 +0.0000 +0.0009 +0.0000 +0.9960 +0.0003 +0.0000
-+0.0003 +0.0001 +0.0006 +0.0000 +0.0005 +0.0000 +0.0002 +0.0000 +0.0007 +0.0002 +0.0004 +0.0002 +0.0000 +0.0046 +0.0000 +0.0004 +0.0004 +0.0001 +0.9910 +0.0003
-+0.0030 +0.0002 +0.0001 +0.0001 +0.0003 +0.0002 +0.0003 +0.0008 +0.0002 +0.0053 +0.0025 +0.0001 +0.0006 +0.0001 +0.0004 +0.0004 +0.0015 +0.0000 +0.0001 +0.9837
-
-+0.8476 +0.0015 +0.0049 +0.0067 +0.0015 +0.0040 +0.0109 +0.0242 +0.0011 +0.0031 +0.0043 +0.0029 +0.0013 +0.0009 +0.0144 +0.0308 +0.0240 +0.0000 +0.0009 +0.0150
-+0.0031 +0.8975 +0.0020 +0.0003 +0.0010 +0.0107 +0.0005 +0.0012 +0.0093 +0.0027 +0.0017 +0.0425 +0.0016 +0.0007 +0.0062 +0.0119 +0.0022 +0.0025 +0.0003 +0.0020
-+0.0106 +0.0021 +0.8005 +0.0441 +0.0002 +0.0049 +0.0095 +0.0143 +0.0193 +0.0032 +0.0034 +0.0280 +0.0002 +0.0008 +0.0029 +0.0360 +0.0151 +0.0003 +0.0032 +0.0015
-+0.0124 +0.0002 +0.0381 +0.8402 +0.0000 +0.0067 +0.0606 +0.0131 +0.0037 +0.0012 +0.0002 +0.0073 +0.0001 +0.0000 +0.0011 +0.0084 +0.0049 +0.0000 +0.0001 +0.0016
-+0.0039 +0.0012 +0.0002 +0.0001 +0.9671 +0.0001 +0.0001 +0.0014 +0.0011 +0.0019 +0.0001 +0.0001 +0.0000 +0.0001 +0.0013 +0.0126 +0.0014 +0.0000 +0.0034 +0.0038
-+0.0092 +0.0114 +0.0052 +0.0082 +0.0001 +0.8569 +0.0382 +0.0033 +0.0226 +0.0010 +0.0072 +0.0143 +0.0019 +0.0001 +0.0089 +0.0049 +0.0038 +0.0000 +0.0001 +0.0028
-+0.0192 +0.0004 +0.0078 +0.0574 +0.0001 +0.0295 +0.8455 +0.0088 +0.0022 +0.0026 +0.0013 +0.0080 +0.0006 +0.0001 +0.0033 +0.0067 +0.0029 +0.0000 +0.0008 +0.0030
-+0.0238 +0.0006 +0.0065 +0.0069 +0.0005 +0.0014 +0.0049 +0.9220 +0.0005 +0.0002 +0.0009 +0.0028 +0.0003 +0.0007 +0.0024 +0.0184 +0.0028 +0.0000 +0.0001 +0.0042
-+0.0028 +0.0113 +0.0232 +0.0052 +0.0011 +0.0257 +0.0032 +0.0014 +0.8963 +0.0005 +0.0046 +0.0033 +0.0001 +0.0023 +0.0057 +0.0035 +0.0018 +0.0004 +0.0044 +0.0033
-+0.0072 +0.0030 +0.0035 +0.0015 +0.0018 +0.0010 +0.0035 +0.0004 +0.0004 +0.8530 +0.0254 +0.0045 +0.0056 +0.0089 +0.0009 +0.0024 +0.0126 +0.0000 +0.0014 +0.0629
-+0.0044 +0.0008 +0.0016 +0.0001 +0.0000 +0.0032 +0.0008 +0.0009 +0.0018 +0.0110 +0.9360 +0.0019 +0.0088 +0.0074 +0.0020 +0.0016 +0.0025 +0.0006 +0.0011 +0.0135
-+0.0032 +0.0216 +0.0141 +0.0043 +0.0000 +0.0068 +0.0049 +0.0031 +0.0014 +0.0020 +0.0020 +0.9115 +0.0040 +0.0001 +0.0022 +0.0080 +0.0092 +0.0000 +0.0005 +0.0010
-+0.0074 +0.0044 +0.0004 +0.0002 +0.0001 +0.0050 +0.0019 +0.0020 +0.0002 +0.0140 +0.0509 +0.0219 +0.8545 +0.0044 +0.0012 +0.0051 +0.0071 +0.0000 +0.0001 +0.0192
-+0.0020 +0.0007 +0.0008 +0.0001 +0.0001 +0.0001 +0.0001 +0.0016 +0.0019 +0.0082 +0.0159 +0.0001 +0.0016 +0.9344 +0.0007 +0.0037 +0.0011 +0.0010 +0.0245 +0.0014
-+0.0247 +0.0050 +0.0023 +0.0010 +0.0008 +0.0067 +0.0032 +0.0041 +0.0038 +0.0007 +0.0033 +0.0034 +0.0004 +0.0006 +0.9111 +0.0192 +0.0058 +0.0000 +0.0001 +0.0038
-+0.0386 +0.0070 +0.0209 +0.0057 +0.0061 +0.0027 +0.0048 +0.0234 +0.0017 +0.0013 +0.0019 +0.0093 +0.0011 +0.0021 +0.0140 +0.8200 +0.0345 +0.0009 +0.0013 +0.0028
-+0.0357 +0.0016 +0.0104 +0.0039 +0.0008 +0.0025 +0.0024 +0.0042 +0.0011 +0.0079 +0.0036 +0.0126 +0.0018 +0.0007 +0.0051 +0.0410 +0.8515 +0.0000 +0.0015 +0.0118
-+0.0002 +0.0096 +0.0011 +0.0000 +0.0000 +0.0001 +0.0000 +0.0001 +0.0011 +0.0001 +0.0047 +0.0003 +0.0000 +0.0037 +0.0001 +0.0059 +0.0001 +0.9703 +0.0022 +0.0001
-+0.0026 +0.0005 +0.0043 +0.0002 +0.0038 +0.0001 +0.0013 +0.0002 +0.0050 +0.0018 +0.0032 +0.0013 +0.0001 +0.0325 +0.0001 +0.0029 +0.0029 +0.0008 +0.9343 +0.0022
-+0.0202 +0.0012 +0.0010 +0.0012 +0.0020 +0.0017 +0.0023 +0.0058 +0.0017 +0.0359 +0.0177 +0.0013 +0.0044 +0.0008 +0.0030 +0.0030 +0.0106 +0.0000 +0.0010 +0.8851
-
-+0.5954 +0.0052 +0.0152 +0.0192 +0.0049 +0.0117 +0.0279 +0.0641 +0.0040 +0.0098 +0.0132 +0.0110 +0.0036 +0.0030 +0.0376 +0.0736 +0.0592 +0.0002 +0.0028 +0.0384
-+0.0112 +0.7075 +0.0084 +0.0025 +0.0030 +0.0281 +0.0039 +0.0054 +0.0250 +0.0075 +0.0063 +0.1121 +0.0047 +0.0023 +0.0177 +0.0306 +0.0089 +0.0070 +0.0013 +0.0066
-+0.0327 +0.0085 +0.4956 +0.0962 +0.0014 +0.0152 +0.0305 +0.0398 +0.0451 +0.0082 +0.0099 +0.0686 +0.0012 +0.0029 +0.0101 +0.0796 +0.0387 +0.0009 +0.0083 +0.0066
-+0.0357 +0.0022 +0.0830 +0.5836 +0.0005 +0.0220 +0.1377 +0.0375 +0.0123 +0.0041 +0.0021 +0.0237 +0.0006 +0.0005 +0.0052 +0.0264 +0.0157 +0.0001 +0.0010 +0.0060
-+0.0127 +0.0037 +0.0017 +0.0007 +0.8972 +0.0006 +0.0007 +0.0054 +0.0034 +0.0058 +0.0010 +0.0012 +0.0003 +0.0008 +0.0045 +0.0330 +0.0058 +0.0001 +0.0101 +0.0113
-+0.0266 +0.0300 +0.0161 +0.0269 +0.0005 +0.6114 +0.0896 +0.0117 +0.0560 +0.0037 +0.0201 +0.0396 +0.0051 +0.0008 +0.0241 +0.0157 +0.0118 +0.0002 +0.0009 +0.0090
-+0.0490 +0.0032 +0.0249 +0.1303 +0.0005 +0.0692 +0.5943 +0.0272 +0.0087 +0.0070 +0.0052 +0.0238 +0.0018 +0.0006 +0.0106 +0.0207 +0.0109 +0.0001 +0.0023 +0.0096
-+0.0630 +0.0025 +0.0181 +0.0199 +0.0021 +0.0050 +0.0152 +0.7721 +0.0024 +0.0016 +0.0034 +0.0096 +0.0012 +0.0023 +0.0086 +0.0482 +0.0115 +0.0001 +0.0005 +0.0127
-+0.0104 +0.0304 +0.0543 +0.0171 +0.0034 +0.0638 +0.0129 +0.0062 +0.7041 +0.0024 +0.0138 +0.0140 +0.0007 +0.0069 +0.0164 +0.0129 +0.0072 +0.0012 +0.0124 +0.0097
-+0.0232 +0.0083 +0.0090 +0.0052 +0.0052 +0.0039 +0.0094 +0.0038 +0.0022 +0.6047 +0.0700 +0.0135 +0.0146 +0.0237 +0.0040 +0.0095 +0.0324 +0.0002 +0.0048 +0.1521
-+0.0134 +0.0030 +0.0047 +0.0012 +0.0004 +0.0090 +0.0030 +0.0036 +0.0054 +0.0303 +0.8103 +0.0068 +0.0229 +0.0215 +0.0062 +0.0057 +0.0082 +0.0018 +0.0039 +0.0388
-+0.0119 +0.0570 +0.0345 +0.0138 +0.0005 +0.0188 +0.0147 +0.0106 +0.0058 +0.0062 +0.0072 +0.7455 +0.0103 +0.0006 +0.0074 +0.0237 +0.0251 +0.0003 +0.0017 +0.0044
-+0.0214 +0.0130 +0.0033 +0.0019 +0.0006 +0.0131 +0.0062 +0.0071 +0.0017 +0.0366 +0.1324 +0.0562 +0.6018 +0.0130 +0.0047 +0.0145 +0.0198 +0.0002 +0.0011 +0.0516
-+0.0067 +0.0024 +0.0029 +0.0006 +0.0007 +0.0008 +0.0007 +0.0052 +0.0059 +0.0219 +0.0461 +0.0013 +0.0048 +0.8053 +0.0025 +0.0101 +0.0042 +0.0029 +0.0685 +0.0065
-+0.0646 +0.0142 +0.0080 +0.0048 +0.0030 +0.0182 +0.0103 +0.0151 +0.0109 +0.0029 +0.0104 +0.0117 +0.0014 +0.0020 +0.7412 +0.0495 +0.0189 +0.0002 +0.0005 +0.0121
-+0.0921 +0.0180 +0.0462 +0.0178 +0.0159 +0.0086 +0.0148 +0.0614 +0.0062 +0.0051 +0.0070 +0.0274 +0.0031 +0.0057 +0.0361 +0.5374 +0.0802 +0.0024 +0.0039 +0.0108
-+0.0882 +0.0062 +0.0267 +0.0126 +0.0033 +0.0077 +0.0092 +0.0174 +0.0041 +0.0204 +0.0120 +0.0345 +0.0050 +0.0029 +0.0164 +0.0953 +0.6013 +0.0002 +0.0044 +0.0322
-+0.0015 +0.0272 +0.0035 +0.0005 +0.0003 +0.0008 +0.0003 +0.0009 +0.0037 +0.0006 +0.0143 +0.0026 +0.0003 +0.0112 +0.0008 +0.0158 +0.0013 +0.9068 +0.0069 +0.0006
-+0.0080 +0.0018 +0.0112 +0.0016 +0.0113 +0.0012 +0.0037 +0.0015 +0.0139 +0.0060 +0.0112 +0.0046 +0.0006 +0.0911 +0.0009 +0.0090 +0.0086 +0.0024 +0.8044 +0.0070
-+0.0517 +0.0042 +0.0041 +0.0044 +0.0059 +0.0053 +0.0074 +0.0174 +0.0050 +0.0867 +0.0512 +0.0055 +0.0118 +0.0040 +0.0094 +0.0116 +0.0291 +0.0001 +0.0032 +0.6819
-
-+0.2209 +0.0189 +0.0364 +0.0432 +0.0147 +0.0277 +0.0494 +0.1167 +0.0159 +0.0266 +0.0384 +0.0414 +0.0088 +0.0108 +0.0661 +0.1013 +0.0869 +0.0014 +0.0086 +0.0658
-+0.0402 +0.3218 +0.0303 +0.0195 +0.0094 +0.0505 +0.0236 +0.0274 +0.0473 +0.0174 +0.0254 +0.1928 +0.0111 +0.0083 +0.0404 +0.0567 +0.0335 +0.0152 +0.0063 +0.0229
-+0.0785 +0.0306 +0.1260 +0.1009 +0.0084 +0.0392 +0.0682 +0.0842 +0.0580 +0.0180 +0.0284 +0.1050 +0.0064 +0.0110 +0.0328 +0.0931 +0.0648 +0.0027 +0.0159 +0.0280
-+0.0804 +0.0170 +0.0870 +0.2131 +0.0047 +0.0533 +0.1543 +0.0861 +0.0331 +0.0140 +0.0168 +0.0652 +0.0045 +0.0048 +0.0255 +0.0642 +0.0443 +0.0010 +0.0063 +0.0246
-+0.0384 +0.0115 +0.0101 +0.0066 +0.6850 +0.0051 +0.0066 +0.0239 +0.0100 +0.0155 +0.0092 +0.0105 +0.0021 +0.0071 +0.0169 +0.0621 +0.0231 +0.0008 +0.0254 +0.0303
-+0.0632 +0.0540 +0.0414 +0.0653 +0.0044 +0.2097 +0.1122 +0.0434 +0.0808 +0.0148 +0.0449 +0.0838 +0.0100 +0.0066 +0.0479 +0.0460 +0.0349 +0.0018 +0.0064 +0.0283
-+0.0868 +0.0195 +0.0556 +0.1460 +0.0045 +0.0867 +0.2218 +0.0727 +0.0307 +0.0167 +0.0228 +0.0618 +0.0060 +0.0052 +0.0321 +0.0552 +0.0388 +0.0008 +0.0068 +0.0295
-+0.1148 +0.0126 +0.0384 +0.0456 +0.0090 +0.0188 +0.0406 +0.4314 +0.0118 +0.0114 +0.0175 +0.0348 +0.0046 +0.0078 +0.0311 +0.0867 +0.0431 +0.0009 +0.0042 +0.0347
-+0.0413 +0.0575 +0.0697 +0.0461 +0.0099 +0.0920 +0.0452 +0.0312 +0.3111 +0.0124 +0.0377 +0.0558 +0.0051 +0.0190 +0.0391 +0.0423 +0.0284 +0.0038 +0.0262 +0.0261
-+0.0627 +0.0193 +0.0197 +0.0178 +0.0141 +0.0154 +0.0224 +0.0273 +0.0113 +0.2123 +0.1413 +0.0368 +0.0253 +0.0456 +0.0192 +0.0350 +0.0570 +0.0015 +0.0161 +0.2001
-+0.0392 +0.0122 +0.0135 +0.0092 +0.0036 +0.0201 +0.0133 +0.0182 +0.0149 +0.0611 +0.5048 +0.0258 +0.0382 +0.0505 +0.0188 +0.0221 +0.0269 +0.0048 +0.0150 +0.0879
-+0.0449 +0.0980 +0.0528 +0.0380 +0.0044 +0.0399 +0.0381 +0.0383 +0.0233 +0.0169 +0.0273 +0.3927 +0.0169 +0.0055 +0.0258 +0.0558 +0.0513 +0.0025 +0.0063 +0.0215
-+0.0521 +0.0309 +0.0177 +0.0142 +0.0048 +0.0259 +0.0201 +0.0278 +0.0116 +0.0632 +0.2208 +0.0923 +0.1801 +0.0326 +0.0196 +0.0361 +0.0430 +0.0020 +0.0088 +0.0967
-+0.0237 +0.0086 +0.0112 +0.0056 +0.0060 +0.0064 +0.0064 +0.0173 +0.0161 +0.0423 +0.1085 +0.0111 +0.0121 +0.4919 +0.0099 +0.0237 +0.0173 +0.0082 +0.1427 +0.0312
-+0.1136 +0.0326 +0.0262 +0.0236 +0.0112 +0.0362 +0.0314 +0.0544 +0.0259 +0.0139 +0.0316 +0.0409 +0.0057 +0.0078 +0.3659 +0.0861 +0.0518 +0.0014 +0.0046 +0.0352
-+0.1268 +0.0333 +0.0541 +0.0432 +0.0299 +0.0253 +0.0393 +0.1105 +0.0205 +0.0186 +0.0271 +0.0646 +0.0077 +0.0135 +0.0627 +0.1705 +0.0989 +0.0049 +0.0110 +0.0377
-+0.1293 +0.0234 +0.0447 +0.0355 +0.0132 +0.0228 +0.0328 +0.0653 +0.0163 +0.0359 +0.0393 +0.0706 +0.0108 +0.0118 +0.0448 +0.1175 +0.2090 +0.0017 +0.0114 +0.0640
-+0.0114 +0.0594 +0.0104 +0.0043 +0.0025 +0.0065 +0.0039 +0.0080 +0.0120 +0.0052 +0.0391 +0.0192 +0.0028 +0.0310 +0.0068 +0.0323 +0.0093 +0.7091 +0.0203 +0.0064
-+0.0251 +0.0086 +0.0214 +0.0098 +0.0284 +0.0081 +0.0113 +0.0125 +0.0295 +0.0199 +0.0429 +0.0169 +0.0043 +0.1897 +0.0077 +0.0255 +0.0223 +0.0071 +0.4861 +0.0228
-+0.0885 +0.0145 +0.0175 +0.0178 +0.0157 +0.0167 +0.0226 +0.0476 +0.0136 +0.1140 +0.1159 +0.0267 +0.0220 +0.0192 +0.0276 +0.0405 +0.0579 +0.0010 +0.0105 +0.3101
-
-
-[0] P-matrix for branch length 0.300000
-+0.9868 +0.0001 +0.0004 +0.0006 +0.0001 +0.0003 +0.0010 +0.0021 +0.0001 +0.0002 +0.0003 +0.0002 +0.0001 +0.0001 +0.0013 +0.0028 +0.0021 +0.0000 +0.0001 +0.0013
-+0.0002 +0.9914 +0.0001 +0.0000 +0.0001 +0.0009 +0.0000 +0.0001 +0.0008 +0.0002 +0.0001 +0.0037 +0.0001 +0.0001 +0.0005 +0.0011 +0.0002 +0.0002 +0.0000 +0.0002
-+0.0009 +0.0001 +0.9823 +0.0042 +0.0000 +0.0004 +0.0007 +0.0012 +0.0018 +0.0003 +0.0003 +0.0025 +0.0000 +0.0001 +0.0002 +0.0034 +0.0013 +0.0000 +0.0003 +0.0001
-+0.0010 +0.0000 +0.0036 +0.9860 +0.0000 +0.0005 +0.0056 +0.0011 +0.0003 +0.0001 +0.0000 +0.0006 +0.0000 +0.0000 +0.0001 +0.0007 +0.0004 +0.0000 +0.0000 +0.0001
-+0.0003 +0.0001 +0.0000 +0.0000 +0.9973 +0.0000 +0.0000 +0.0001 +0.0001 +0.0002 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0011 +0.0001 +0.0000 +0.0003 +0.0003
-+0.0008 +0.0010 +0.0004 +0.0006 +0.0000 +0.9877 +0.0035 +0.0002 +0.0020 +0.0001 +0.0006 +0.0012 +0.0002 +0.0000 +0.0008 +0.0004 +0.0003 +0.0000 +0.0000 +0.0002
-+0.0017 +0.0000 +0.0006 +0.0053 +0.0000 +0.0027 +0.9865 +0.0007 +0.0001 +0.0002 +0.0001 +0.0007 +0.0000 +0.0000 +0.0003 +0.0005 +0.0002 +0.0000 +0.0001 +0.0002
-+0.0021 +0.0000 +0.0006 +0.0006 +0.0000 +0.0001 +0.0004 +0.9935 +0.0000 +0.0000 +0.0001 +0.0002 +0.0000 +0.0001 +0.0002 +0.0016 +0.0002 +0.0000 +0.0000 +0.0003
-+0.0002 +0.0010 +0.0021 +0.0004 +0.0001 +0.0023 +0.0002 +0.0001 +0.9913 +0.0000 +0.0004 +0.0002 +0.0000 +0.0002 +0.0005 +0.0002 +0.0001 +0.0000 +0.0004 +0.0003
-+0.0006 +0.0003 +0.0003 +0.0001 +0.0001 +0.0001 +0.0003 +0.0000 +0.0000 +0.9873 +0.0022 +0.0004 +0.0005 +0.0008 +0.0001 +0.0002 +0.0011 +0.0000 +0.0001 +0.0057
-+0.0004 +0.0001 +0.0001 +0.0000 +0.0000 +0.0003 +0.0001 +0.0001 +0.0001 +0.0009 +0.9947 +0.0001 +0.0008 +0.0006 +0.0002 +0.0001 +0.0002 +0.0000 +0.0001 +0.0011
-+0.0002 +0.0019 +0.0013 +0.0003 +0.0000 +0.0006 +0.0004 +0.0002 +0.0001 +0.0002 +0.0002 +0.9926 +0.0004 +0.0000 +0.0002 +0.0007 +0.0008 +0.0000 +0.0000 +0.0001
-+0.0006 +0.0004 +0.0000 +0.0000 +0.0000 +0.0004 +0.0001 +0.0002 +0.0000 +0.0012 +0.0044 +0.0019 +0.9875 +0.0004 +0.0001 +0.0004 +0.0006 +0.0000 +0.0000 +0.0017
-+0.0002 +0.0001 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0002 +0.0007 +0.0013 +0.0000 +0.0001 +0.9946 +0.0001 +0.0003 +0.0001 +0.0001 +0.0021 +0.0001
-+0.0022 +0.0004 +0.0002 +0.0001 +0.0001 +0.0006 +0.0003 +0.0003 +0.0003 +0.0000 +0.0003 +0.0003 +0.0000 +0.0000 +0.9926 +0.0017 +0.0005 +0.0000 +0.0000 +0.0003
-+0.0035 +0.0006 +0.0020 +0.0004 +0.0005 +0.0002 +0.0004 +0.0020 +0.0001 +0.0001 +0.0001 +0.0008 +0.0001 +0.0002 +0.0012 +0.9841 +0.0032 +0.0001 +0.0001 +0.0002
-+0.0032 +0.0001 +0.0009 +0.0003 +0.0001 +0.0002 +0.0002 +0.0003 +0.0001 +0.0007 +0.0003 +0.0011 +0.0002 +0.0001 +0.0004 +0.0038 +0.9872 +0.0000 +0.0001 +0.0010
-+0.0000 +0.0008 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0004 +0.0000 +0.0000 +0.0003 +0.0000 +0.0005 +0.0000 +0.9976 +0.0002 +0.0000
-+0.0002 +0.0000 +0.0004 +0.0000 +0.0003 +0.0000 +0.0001 +0.0000 +0.0004 +0.0001 +0.0002 +0.0001 +0.0000 +0.0027 +0.0000 +0.0002 +0.0002 +0.0001 +0.9946 +0.0002
-+0.0018 +0.0001 +0.0001 +0.0001 +0.0002 +0.0001 +0.0002 +0.0005 +0.0001 +0.0032 +0.0015 +0.0001 +0.0004 +0.0000 +0.0002 +0.0002 +0.0009 +0.0000 +0.0001 +0.9902
-
-+0.9050 +0.0009 +0.0030 +0.0041 +0.0009 +0.0025 +0.0069 +0.0151 +0.0006 +0.0018 +0.0026 +0.0017 +0.0008 +0.0005 +0.0090 +0.0196 +0.0151 +0.0000 +0.0005 +0.0094
-+0.0018 +0.9370 +0.0011 +0.0001 +0.0006 +0.0067 +0.0002 +0.0007 +0.0058 +0.0017 +0.0010 +0.0265 +0.0010 +0.0004 +0.0038 +0.0075 +0.0013 +0.0015 +0.0002 +0.0012
-+0.0064 +0.0011 +0.8745 +0.0285 +0.0001 +0.0029 +0.0057 +0.0089 +0.0123 +0.0020 +0.0021 +0.0177 +0.0001 +0.0004 +0.0017 +0.0232 +0.0094 +0.0002 +0.0020 +0.0008
-+0.0076 +0.0001 +0.0246 +0.8999 +0.0000 +0.0040 +0.0388 +0.0080 +0.0022 +0.0007 +0.0001 +0.0044 +0.0000 +0.0000 +0.0006 +0.0050 +0.0029 +0.0000 +0.0000 +0.0009
-+0.0024 +0.0007 +0.0001 +0.0000 +0.9801 +0.0000 +0.0000 +0.0008 +0.0007 +0.0012 +0.0000 +0.0000 +0.0000 +0.0000 +0.0008 +0.0079 +0.0008 +0.0000 +0.0021 +0.0023
-+0.0056 +0.0071 +0.0031 +0.0049 +0.0000 +0.9112 +0.0243 +0.0019 +0.0142 +0.0005 +0.0045 +0.0088 +0.0012 +0.0000 +0.0055 +0.0029 +0.0023 +0.0000 +0.0000 +0.0017
-+0.0121 +0.0002 +0.0046 +0.0368 +0.0000 +0.0188 +0.9035 +0.0053 +0.0012 +0.0016 +0.0008 +0.0049 +0.0003 +0.0000 +0.0020 +0.0041 +0.0016 +0.0000 +0.0005 +0.0018
-+0.0148 +0.0003 +0.0040 +0.0043 +0.0003 +0.0008 +0.0030 +0.9523 +0.0003 +0.0001 +0.0005 +0.0017 +0.0002 +0.0004 +0.0014 +0.0115 +0.0015 +0.0000 +0.0000 +0.0026
-+0.0016 +0.0070 +0.0148 +0.0031 +0.0007 +0.0162 +0.0018 +0.0008 +0.9362 +0.0003 +0.0028 +0.0018 +0.0000 +0.0014 +0.0035 +0.0020 +0.0011 +0.0002 +0.0027 +0.0021
-+0.0043 +0.0019 +0.0022 +0.0009 +0.0011 +0.0006 +0.0021 +0.0002 +0.0002 +0.9086 +0.0157 +0.0027 +0.0035 +0.0055 +0.0005 +0.0014 +0.0079 +0.0000 +0.0008 +0.0399
-+0.0026 +0.0005 +0.0010 +0.0000 +0.0000 +0.0020 +0.0004 +0.0005 +0.0011 +0.0068 +0.9610 +0.0011 +0.0055 +0.0045 +0.0012 +0.0009 +0.0015 +0.0004 +0.0007 +0.0082
-+0.0018 +0.0135 +0.0089 +0.0025 +0.0000 +0.0042 +0.0030 +0.0018 +0.0008 +0.0012 +0.0012 +0.9457 +0.0025 +0.0000 +0.0013 +0.0049 +0.0057 +0.0000 +0.0003 +0.0006
-+0.0046 +0.0027 +0.0002 +0.0001 +0.0000 +0.0031 +0.0011 +0.0012 +0.0001 +0.0088 +0.0318 +0.0138 +0.9099 +0.0027 +0.0007 +0.0031 +0.0044 +0.0000 +0.0000 +0.0119
-+0.0012 +0.0004 +0.0005 +0.0000 +0.0000 +0.0000 +0.0000 +0.0010 +0.0012 +0.0051 +0.0098 +0.0000 +0.0010 +0.9600 +0.0004 +0.0023 +0.0006 +0.0006 +0.0151 +0.0007
-+0.0154 +0.0031 +0.0013 +0.0006 +0.0005 +0.0042 +0.0019 +0.0024 +0.0023 +0.0004 +0.0020 +0.0020 +0.0002 +0.0003 +0.9456 +0.0120 +0.0035 +0.0000 +0.0000 +0.0023
-+0.0245 +0.0044 +0.0135 +0.0034 +0.0038 +0.0016 +0.0029 +0.0146 +0.0010 +0.0007 +0.0011 +0.0057 +0.0007 +0.0013 +0.0087 +0.8871 +0.0220 +0.0006 +0.0008 +0.0016
-+0.0225 +0.0009 +0.0065 +0.0023 +0.0005 +0.0015 +0.0014 +0.0023 +0.0006 +0.0050 +0.0021 +0.0078 +0.0011 +0.0004 +0.0030 +0.0262 +0.9076 +0.0000 +0.0009 +0.0073
-+0.0001 +0.0059 +0.0007 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0007 +0.0000 +0.0029 +0.0001 +0.0000 +0.0022 +0.0000 +0.0037 +0.0001 +0.9821 +0.0014 +0.0000
-+0.0016 +0.0003 +0.0027 +0.0001 +0.0023 +0.0000 +0.0008 +0.0001 +0.0031 +0.0010 +0.0019 +0.0008 +0.0000 +0.0200 +0.0000 +0.0018 +0.0018 +0.0005 +0.9599 +0.0013
-+0.0127 +0.0007 +0.0005 +0.0007 +0.0012 +0.0010 +0.0014 +0.0035 +0.0011 +0.0227 +0.0109 +0.0007 +0.0027 +0.0004 +0.0018 +0.0017 +0.0066 +0.0000 +0.0006 +0.9290
-
-+0.7275 +0.0030 +0.0095 +0.0124 +0.0030 +0.0075 +0.0192 +0.0433 +0.0022 +0.0060 +0.0082 +0.0062 +0.0023 +0.0018 +0.0255 +0.0527 +0.0416 +0.0001 +0.0017 +0.0264
-+0.0064 +0.8108 +0.0045 +0.0010 +0.0018 +0.0190 +0.0016 +0.0028 +0.0167 +0.0049 +0.0036 +0.0759 +0.0030 +0.0014 +0.0114 +0.0210 +0.0049 +0.0045 +0.0007 +0.0039
-+0.0204 +0.0046 +0.6510 +0.0725 +0.0006 +0.0094 +0.0187 +0.0261 +0.0327 +0.0056 +0.0063 +0.0484 +0.0005 +0.0016 +0.0058 +0.0594 +0.0266 +0.0006 +0.0057 +0.0035
-+0.0230 +0.0008 +0.0626 +0.7167 +0.0002 +0.0133 +0.1015 +0.0242 +0.0074 +0.0024 +0.0008 +0.0144 +0.0002 +0.0002 +0.0026 +0.0163 +0.0096 +0.0000 +0.0004 +0.0034
-+0.0077 +0.0023 +0.0007 +0.0003 +0.9368 +0.0002 +0.0003 +0.0030 +0.0021 +0.0037 +0.0004 +0.0004 +0.0001 +0.0003 +0.0026 +0.0224 +0.0031 +0.0000 +0.0064 +0.0072
-+0.0171 +0.0204 +0.0099 +0.0163 +0.0002 +0.7415 +0.0648 +0.0067 +0.0393 +0.0021 +0.0132 +0.0261 +0.0034 +0.0003 +0.0161 +0.0095 +0.0073 +0.0001 +0.0004 +0.0055
-+0.0338 +0.0013 +0.0153 +0.0960 +0.0002 +0.0501 +0.7252 +0.0169 +0.0048 +0.0046 +0.0028 +0.0151 +0.0011 +0.0002 +0.0064 +0.0129 +0.0061 +0.0000 +0.0014 +0.0058
-+0.0425 +0.0013 +0.0119 +0.0128 +0.0011 +0.0029 +0.0094 +0.8546 +0.0012 +0.0006 +0.0018 +0.0056 +0.0007 +0.0014 +0.0049 +0.0327 +0.0062 +0.0000 +0.0002 +0.0080
-+0.0058 +0.0203 +0.0393 +0.0103 +0.0021 +0.0447 +0.0070 +0.0032 +0.8086 +0.0012 +0.0086 +0.0074 +0.0003 +0.0044 +0.0105 +0.0073 +0.0039 +0.0007 +0.0081 +0.0062
-+0.0141 +0.0055 +0.0061 +0.0030 +0.0033 +0.0021 +0.0062 +0.0015 +0.0011 +0.7356 +0.0463 +0.0084 +0.0100 +0.0159 +0.0021 +0.0053 +0.0222 +0.0001 +0.0028 +0.1083
-+0.0083 +0.0017 +0.0030 +0.0005 +0.0001 +0.0059 +0.0017 +0.0019 +0.0034 +0.0200 +0.8799 +0.0039 +0.0156 +0.0138 +0.0038 +0.0032 +0.0049 +0.0011 +0.0022 +0.0250
-+0.0067 +0.0386 +0.0243 +0.0084 +0.0002 +0.0124 +0.0093 +0.0062 +0.0031 +0.0039 +0.0042 +0.8362 +0.0071 +0.0002 +0.0043 +0.0151 +0.0166 +0.0001 +0.0010 +0.0023
-+0.0138 +0.0083 +0.0014 +0.0008 +0.0002 +0.0088 +0.0037 +0.0040 +0.0007 +0.0249 +0.0903 +0.0387 +0.7363 +0.0082 +0.0026 +0.0093 +0.0130 +0.0001 +0.0004 +0.0345
-+0.0040 +0.0014 +0.0016 +0.0002 +0.0003 +0.0003 +0.0003 +0.0032 +0.0037 +0.0148 +0.0296 +0.0005 +0.0030 +0.8769 +0.0015 +0.0066 +0.0023 +0.0018 +0.0448 +0.0033
-+0.0439 +0.0092 +0.0047 +0.0024 +0.0017 +0.0121 +0.0062 +0.0085 +0.0070 +0.0015 +0.0064 +0.0069 +0.0008 +0.0011 +0.8345 +0.0339 +0.0115 +0.0001 +0.0002 +0.0074
-+0.0660 +0.0124 +0.0345 +0.0110 +0.0108 +0.0052 +0.0092 +0.0417 +0.0035 +0.0028 +0.0040 +0.0174 +0.0020 +0.0038 +0.0247 +0.6827 +0.0583 +0.0016 +0.0024 +0.0060
-+0.0619 +0.0034 +0.0183 +0.0077 +0.0018 +0.0048 +0.0051 +0.0093 +0.0023 +0.0140 +0.0071 +0.0229 +0.0033 +0.0016 +0.0099 +0.0693 +0.7331 +0.0001 +0.0028 +0.0213
-+0.0006 +0.0177 +0.0022 +0.0002 +0.0001 +0.0003 +0.0001 +0.0004 +0.0022 +0.0002 +0.0089 +0.0010 +0.0001 +0.0070 +0.0003 +0.0106 +0.0005 +0.9429 +0.0043 +0.0002
-+0.0049 +0.0010 +0.0076 +0.0007 +0.0072 +0.0005 +0.0024 +0.0006 +0.0091 +0.0035 +0.0064 +0.0027 +0.0002 +0.0596 +0.0003 +0.0056 +0.0055 +0.0015 +0.8765 +0.0043
-+0.0356 +0.0025 +0.0022 +0.0024 +0.0037 +0.0032 +0.0045 +0.0109 +0.0032 +0.0617 +0.0329 +0.0028 +0.0079 +0.0020 +0.0058 +0.0065 +0.0193 +0.0000 +0.0020 +0.7908
-
-+0.3609 +0.0116 +0.0276 +0.0332 +0.0098 +0.0206 +0.0420 +0.0995 +0.0094 +0.0190 +0.0256 +0.0253 +0.0064 +0.0065 +0.0574 +0.0990 +0.0829 +0.0006 +0.0055 +0.0573
-+0.0247 +0.4914 +0.0194 +0.0093 +0.0061 +0.0433 +0.0124 +0.0145 +0.0397 +0.0128 +0.0146 +0.1710 +0.0083 +0.0050 +0.0306 +0.0469 +0.0207 +0.0119 +0.0034 +0.0140
-+0.0594 +0.0197 +0.2486 +0.1133 +0.0044 +0.0286 +0.0548 +0.0662 +0.0588 +0.0134 +0.0187 +0.0967 +0.0036 +0.0066 +0.0214 +0.0974 +0.0574 +0.0018 +0.0129 +0.0164
-+0.0617 +0.0081 +0.0978 +0.3524 +0.0020 +0.0411 +0.1699 +0.0653 +0.0238 +0.0088 +0.0077 +0.0461 +0.0022 +0.0020 +0.0141 +0.0484 +0.0308 +0.0004 +0.0033 +0.0143
-+0.0254 +0.0074 +0.0053 +0.0028 +0.7958 +0.0022 +0.0028 +0.0134 +0.0066 +0.0107 +0.0038 +0.0045 +0.0009 +0.0032 +0.0102 +0.0514 +0.0138 +0.0003 +0.0183 +0.0211
-+0.0469 +0.0463 +0.0303 +0.0503 +0.0019 +0.3682 +0.1163 +0.0262 +0.0784 +0.0088 +0.0340 +0.0660 +0.0080 +0.0030 +0.0388 +0.0311 +0.0232 +0.0008 +0.0031 +0.0183
-+0.0739 +0.0102 +0.0447 +0.1608 +0.0019 +0.0898 +0.3634 +0.0514 +0.0200 +0.0120 +0.0128 +0.0440 +0.0038 +0.0022 +0.0213 +0.0392 +0.0246 +0.0003 +0.0043 +0.0194
-+0.0978 +0.0067 +0.0302 +0.0345 +0.0051 +0.0113 +0.0287 +0.5894 +0.0063 +0.0055 +0.0091 +0.0211 +0.0027 +0.0048 +0.0193 +0.0741 +0.0271 +0.0004 +0.0019 +0.0240
-+0.0245 +0.0483 +0.0708 +0.0332 +0.0065 +0.0892 +0.0294 +0.0167 +0.4847 +0.0067 +0.0260 +0.0339 +0.0025 +0.0131 +0.0290 +0.0278 +0.0169 +0.0024 +0.0207 +0.0178
-+0.0448 +0.0142 +0.0147 +0.0111 +0.0097 +0.0092 +0.0162 +0.0133 +0.0061 +0.3647 +0.1146 +0.0253 +0.0222 +0.0375 +0.0106 +0.0219 +0.0490 +0.0007 +0.0102 +0.2041
-+0.0261 +0.0070 +0.0088 +0.0042 +0.0015 +0.0153 +0.0074 +0.0094 +0.0102 +0.0495 +0.6509 +0.0154 +0.0343 +0.0378 +0.0122 +0.0130 +0.0172 +0.0033 +0.0089 +0.0675
-+0.0273 +0.0869 +0.0486 +0.0268 +0.0019 +0.0314 +0.0271 +0.0232 +0.0142 +0.0116 +0.0163 +0.5517 +0.0152 +0.0024 +0.0159 +0.0419 +0.0410 +0.0012 +0.0037 +0.0117
-+0.0380 +0.0231 +0.0099 +0.0069 +0.0021 +0.0209 +0.0128 +0.0161 +0.0058 +0.0554 +0.1985 +0.0829 +0.3471 +0.0235 +0.0114 +0.0258 +0.0332 +0.0009 +0.0041 +0.0815
-+0.0143 +0.0051 +0.0067 +0.0023 +0.0027 +0.0029 +0.0028 +0.0106 +0.0111 +0.0348 +0.0812 +0.0048 +0.0087 +0.6415 +0.0057 +0.0172 +0.0101 +0.0056 +0.1145 +0.0175
-+0.0987 +0.0247 +0.0171 +0.0130 +0.0067 +0.0293 +0.0208 +0.0338 +0.0192 +0.0077 +0.0206 +0.0253 +0.0033 +0.0045 +0.5374 +0.0749 +0.0368 +0.0006 +0.0020 +0.0237
-+0.1240 +0.0276 +0.0566 +0.0326 +0.0247 +0.0171 +0.0279 +0.0943 +0.0134 +0.0116 +0.0159 +0.0485 +0.0055 +0.0098 +0.0545 +0.2975 +0.1029 +0.0038 +0.0074 +0.0242
-+0.1233 +0.0145 +0.0396 +0.0247 +0.0079 +0.0152 +0.0208 +0.0411 +0.0097 +0.0309 +0.0250 +0.0563 +0.0084 +0.0068 +0.0319 +0.1223 +0.3605 +0.0008 +0.0080 +0.0522
-+0.0054 +0.0462 +0.0068 +0.0018 +0.0011 +0.0030 +0.0015 +0.0035 +0.0076 +0.0023 +0.0268 +0.0091 +0.0013 +0.0212 +0.0031 +0.0255 +0.0045 +0.8132 +0.0135 +0.0026
-+0.0161 +0.0046 +0.0175 +0.0051 +0.0205 +0.0040 +0.0072 +0.0056 +0.0233 +0.0126 +0.0253 +0.0100 +0.0020 +0.1522 +0.0034 +0.0173 +0.0156 +0.0047 +0.6386 +0.0142
-+0.0772 +0.0089 +0.0102 +0.0103 +0.0109 +0.0108 +0.0148 +0.0328 +0.0092 +0.1163 +0.0890 +0.0145 +0.0186 +0.0108 +0.0185 +0.0261 +0.0472 +0.0004 +0.0066 +0.4668
-
-
-[0] P-matrix for branch length 0.200000
-+0.9912 +0.0001 +0.0003 +0.0004 +0.0001 +0.0002 +0.0006 +0.0014 +0.0001 +0.0002 +0.0002 +0.0001 +0.0001 +0.0000 +0.0008 +0.0019 +0.0014 +0.0000 +0.0000 +0.0009
-+0.0002 +0.9942 +0.0001 +0.0000 +0.0001 +0.0006 +0.0000 +0.0001 +0.0005 +0.0002 +0.0001 +0.0025 +0.0001 +0.0000 +0.0003 +0.0007 +0.0001 +0.0001 +0.0000 +0.0001
-+0.0006 +0.0001 +0.9881 +0.0028 +0.0000 +0.0003 +0.0005 +0.0008 +0.0012 +0.0002 +0.0002 +0.0017 +0.0000 +0.0000 +0.0001 +0.0023 +0.0009 +0.0000 +0.0002 +0.0001
-+0.0007 +0.0000 +0.0024 +0.9906 +0.0000 +0.0003 +0.0038 +0.0007 +0.0002 +0.0001 +0.0000 +0.0004 +0.0000 +0.0000 +0.0000 +0.0004 +0.0003 +0.0000 +0.0000 +0.0001
-+0.0002 +0.0001 +0.0000 +0.0000 +0.9982 +0.0000 +0.0000 +0.0001 +0.0001 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0007 +0.0001 +0.0000 +0.0002 +0.0002
-+0.0005 +0.0007 +0.0003 +0.0004 +0.0000 +0.9918 +0.0023 +0.0002 +0.0013 +0.0000 +0.0004 +0.0008 +0.0001 +0.0000 +0.0005 +0.0003 +0.0002 +0.0000 +0.0000 +0.0002
-+0.0011 +0.0000 +0.0004 +0.0036 +0.0000 +0.0018 +0.9910 +0.0005 +0.0001 +0.0001 +0.0001 +0.0004 +0.0000 +0.0000 +0.0002 +0.0004 +0.0001 +0.0000 +0.0000 +0.0002
-+0.0014 +0.0000 +0.0004 +0.0004 +0.0000 +0.0001 +0.0003 +0.9957 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0000 +0.0001 +0.0011 +0.0001 +0.0000 +0.0000 +0.0002
-+0.0001 +0.0006 +0.0014 +0.0003 +0.0001 +0.0015 +0.0001 +0.0001 +0.9942 +0.0000 +0.0002 +0.0001 +0.0000 +0.0001 +0.0003 +0.0002 +0.0001 +0.0000 +0.0003 +0.0002
-+0.0004 +0.0002 +0.0002 +0.0001 +0.0001 +0.0000 +0.0002 +0.0000 +0.0000 +0.9915 +0.0015 +0.0002 +0.0003 +0.0005 +0.0000 +0.0001 +0.0007 +0.0000 +0.0001 +0.0038
-+0.0002 +0.0000 +0.0001 +0.0000 +0.0000 +0.0002 +0.0000 +0.0000 +0.0001 +0.0006 +0.9965 +0.0001 +0.0005 +0.0004 +0.0001 +0.0001 +0.0001 +0.0000 +0.0001 +0.0007
-+0.0002 +0.0013 +0.0008 +0.0002 +0.0000 +0.0004 +0.0003 +0.0002 +0.0001 +0.0001 +0.0001 +0.9950 +0.0002 +0.0000 +0.0001 +0.0004 +0.0005 +0.0000 +0.0000 +0.0000
-+0.0004 +0.0002 +0.0000 +0.0000 +0.0000 +0.0003 +0.0001 +0.0001 +0.0000 +0.0008 +0.0030 +0.0013 +0.9917 +0.0002 +0.0001 +0.0003 +0.0004 +0.0000 +0.0000 +0.0011
-+0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0001 +0.0005 +0.0009 +0.0000 +0.0001 +0.9964 +0.0000 +0.0002 +0.0001 +0.0001 +0.0014 +0.0001
-+0.0014 +0.0003 +0.0001 +0.0000 +0.0000 +0.0004 +0.0002 +0.0002 +0.0002 +0.0000 +0.0002 +0.0002 +0.0000 +0.0000 +0.9951 +0.0011 +0.0003 +0.0000 +0.0000 +0.0002
-+0.0023 +0.0004 +0.0013 +0.0003 +0.0004 +0.0001 +0.0003 +0.0014 +0.0001 +0.0001 +0.0001 +0.0005 +0.0001 +0.0001 +0.0008 +0.9894 +0.0021 +0.0001 +0.0001 +0.0001
-+0.0021 +0.0001 +0.0006 +0.0002 +0.0000 +0.0001 +0.0001 +0.0002 +0.0000 +0.0005 +0.0002 +0.0007 +0.0001 +0.0000 +0.0003 +0.0025 +0.9914 +0.0000 +0.0001 +0.0007
-+0.0000 +0.0005 +0.0001 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0001 +0.0000 +0.0003 +0.0000 +0.0000 +0.0002 +0.0000 +0.0003 +0.0000 +0.9984 +0.0001 +0.0000
-+0.0001 +0.0000 +0.0003 +0.0000 +0.0002 +0.0000 +0.0001 +0.0000 +0.0003 +0.0001 +0.0002 +0.0001 +0.0000 +0.0018 +0.0000 +0.0002 +0.0002 +0.0000 +0.9964 +0.0001
-+0.0012 +0.0001 +0.0000 +0.0001 +0.0001 +0.0001 +0.0001 +0.0003 +0.0001 +0.0022 +0.0010 +0.0001 +0.0003 +0.0000 +0.0002 +0.0001 +0.0006 +0.0000 +0.0001 +0.9935
-
-+0.9355 +0.0006 +0.0020 +0.0028 +0.0006 +0.0017 +0.0047 +0.0103 +0.0004 +0.0012 +0.0017 +0.0011 +0.0005 +0.0004 +0.0061 +0.0134 +0.0103 +0.0000 +0.0004 +0.0064
-+0.0012 +0.9575 +0.0007 +0.0000 +0.0004 +0.0045 +0.0001 +0.0004 +0.0039 +0.0011 +0.0007 +0.0180 +0.0007 +0.0003 +0.0026 +0.0051 +0.0008 +0.0010 +0.0001 +0.0008
-+0.0043 +0.0007 +0.9143 +0.0197 +0.0000 +0.0020 +0.0037 +0.0060 +0.0085 +0.0014 +0.0014 +0.0121 +0.0000 +0.0003 +0.0011 +0.0160 +0.0064 +0.0001 +0.0014 +0.0005
-+0.0051 +0.0000 +0.0170 +0.9318 +0.0000 +0.0026 +0.0268 +0.0054 +0.0015 +0.0005 +0.0000 +0.0029 +0.0000 +0.0000 +0.0004 +0.0033 +0.0019 +0.0000 +0.0000 +0.0006
-+0.0016 +0.0005 +0.0000 +0.0000 +0.9867 +0.0000 +0.0000 +0.0005 +0.0005 +0.0008 +0.0000 +0.0000 +0.0000 +0.0000 +0.0005 +0.0054 +0.0005 +0.0000 +0.0014 +0.0016
-+0.0038 +0.0048 +0.0021 +0.0032 +0.0000 +0.9398 +0.0167 +0.0013 +0.0097 +0.0004 +0.0030 +0.0060 +0.0008 +0.0000 +0.0038 +0.0020 +0.0015 +0.0000 +0.0000 +0.0011
-+0.0082 +0.0001 +0.0031 +0.0253 +0.0000 +0.0129 +0.9343 +0.0036 +0.0008 +0.0011 +0.0005 +0.0033 +0.0002 +0.0000 +0.0013 +0.0027 +0.0011 +0.0000 +0.0003 +0.0012
-+0.0101 +0.0002 +0.0027 +0.0029 +0.0002 +0.0005 +0.0020 +0.9679 +0.0002 +0.0000 +0.0003 +0.0011 +0.0001 +0.0003 +0.0009 +0.0078 +0.0010 +0.0000 +0.0000 +0.0017
-+0.0010 +0.0047 +0.0102 +0.0021 +0.0005 +0.0111 +0.0012 +0.0005 +0.9570 +0.0002 +0.0019 +0.0012 +0.0000 +0.0009 +0.0023 +0.0013 +0.0007 +0.0001 +0.0019 +0.0014
-+0.0029 +0.0013 +0.0015 +0.0006 +0.0007 +0.0004 +0.0015 +0.0001 +0.0001 +0.9379 +0.0107 +0.0018 +0.0024 +0.0038 +0.0003 +0.0009 +0.0054 +0.0000 +0.0006 +0.0273
-+0.0018 +0.0003 +0.0007 +0.0000 +0.0000 +0.0014 +0.0003 +0.0003 +0.0007 +0.0046 +0.9737 +0.0007 +0.0037 +0.0031 +0.0008 +0.0006 +0.0010 +0.0002 +0.0004 +0.0056
-+0.0012 +0.0092 +0.0061 +0.0017 +0.0000 +0.0028 +0.0020 +0.0012 +0.0005 +0.0008 +0.0008 +0.9634 +0.0017 +0.0000 +0.0008 +0.0033 +0.0039 +0.0000 +0.0002 +0.0004
-+0.0031 +0.0018 +0.0001 +0.0000 +0.0000 +0.0021 +0.0007 +0.0008 +0.0000 +0.0060 +0.0216 +0.0094 +0.9389 +0.0018 +0.0005 +0.0021 +0.0030 +0.0000 +0.0000 +0.0081
-+0.0008 +0.0003 +0.0003 +0.0000 +0.0000 +0.0000 +0.0000 +0.0007 +0.0008 +0.0035 +0.0066 +0.0000 +0.0007 +0.9731 +0.0003 +0.0015 +0.0004 +0.0004 +0.0102 +0.0005
-+0.0105 +0.0021 +0.0009 +0.0003 +0.0003 +0.0028 +0.0013 +0.0016 +0.0015 +0.0002 +0.0014 +0.0013 +0.0001 +0.0002 +0.9633 +0.0082 +0.0023 +0.0000 +0.0000 +0.0015
-+0.0168 +0.0030 +0.0093 +0.0022 +0.0026 +0.0011 +0.0019 +0.0100 +0.0006 +0.0005 +0.0007 +0.0038 +0.0004 +0.0009 +0.0060 +0.9230 +0.0152 +0.0004 +0.0005 +0.0010
-+0.0154 +0.0006 +0.0044 +0.0016 +0.0003 +0.0010 +0.0009 +0.0015 +0.0004 +0.0034 +0.0014 +0.0053 +0.0007 +0.0003 +0.0020 +0.0180 +0.9373 +0.0000 +0.0006 +0.0049
-+0.0000 +0.0040 +0.0005 +0.0000 +0.0000 +0.0000 +0.0000 +0.0000 +0.0005 +0.0000 +0.0019 +0.0000 +0.0000 +0.0015 +0.0000 +0.0025 +0.0000 +0.9880 +0.0009 +0.0000
-+0.0010 +0.0002 +0.0018 +0.0000 +0.0016 +0.0000 +0.0005 +0.0000 +0.0021 +0.0007 +0.0012 +0.0005 +0.0000 +0.0135 +0.0000 +0.0012 +0.0012 +0.0003 +0.9731 +0.0009
-+0.0087 +0.0005 +0.0003 +0.0004 +0.0008 +0.0007 +0.0009 +0.0024 +0.0007 +0.0156 +0.0073 +0.0004 +0.0018 +0.0003 +0.0012 +0.0011 +0.0045 +0.0000 +0.0004 +0.9519
-
-+0.8071 +0.0020 +0.0064 +0.0085 +0.0020 +0.0052 +0.0138 +0.0306 +0.0014 +0.0040 +0.0055 +0.0039 +0.0016 +0.0012 +0.0181 +0.0385 +0.0301 +0.0000 +0.0011 +0.0189
-+0.0042 +0.8689 +0.0028 +0.0004 +0.0012 +0.0135 +0.0008 +0.0017 +0.0118 +0.0035 +0.0023 +0.0538 +0.0020 +0.0009 +0.0079 +0.0150 +0.0030 +0.0032 +0.0005 +0.0026
-+0.0138 +0.0028 +0.7493 +0.0544 +0.0003 +0.0063 +0.0125 +0.0183 +0.0240 +0.0040 +0.0044 +0.0351 +0.0003 +0.0010 +0.0038 +0.0444 +0.0190 +0.0004 +0.0040 +0.0021
-+0.0159 +0.0004 +0.0469 +0.7983 +0.0001 +0.0088 +0.0751 +0.0168 +0.0049 +0.0016 +0.0004 +0.0096 +0.0001 +0.0001 +0.0016 +0.0109 +0.0064 +0.0000 +0.0002 +0.0021
-+0.0051 +0.0015 +0.0003 +0.0001 +0.9574 +0.0001 +0.0001 +0.0019 +0.0015 +0.0025 +0.0002 +0.0002 +0.0000 +0.0001 +0.0017 +0.0160 +0.0019 +0.0000 +0.0044 +0.0049
-+0.0118 +0.0144 +0.0067 +0.0108 +0.0001 +0.8182 +0.0476 +0.0043 +0.0283 +0.0013 +0.0092 +0.0182 +0.0024 +0.0001 +0.0113 +0.0064 +0.0049 +0.0000 +0.0002 +0.0037
-+0.0242 +0.0006 +0.0102 +0.0711 +0.0001 +0.0367 +0.8048 +0.0114 +0.0030 +0.0033 +0.0018 +0.0103 +0.0007 +0.0001 +0.0043 +0.0087 +0.0038 +0.0000 +0.0010 +0.0039
-+0.0301 +0.0008 +0.0083 +0.0089 +0.0007 +0.0019 +0.0064 +0.9000 +0.0007 +0.0003 +0.0011 +0.0037 +0.0004 +0.0010 +0.0031 +0.0233 +0.0038 +0.0000 +0.0001 +0.0054
-+0.0037 +0.0143 +0.0289 +0.0068 +0.0015 +0.0322 +0.0044 +0.0019 +0.8674 +0.0007 +0.0059 +0.0045 +0.0001 +0.0030 +0.0073 +0.0046 +0.0025 +0.0005 +0.0057 +0.0043
-+0.0094 +0.0038 +0.0044 +0.0020 +0.0023 +0.0013 +0.0044 +0.0007 +0.0006 +0.8135 +0.0324 +0.0058 +0.0071 +0.0113 +0.0013 +0.0033 +0.0159 +0.0000 +0.0019 +0.0787
-+0.0056 +0.0011 +0.0021 +0.0002 +0.0001 +0.0041 +0.0010 +0.0012 +0.0023 +0.0140 +0.9177 +0.0025 +0.0111 +0.0095 +0.0026 +0.0021 +0.0032 +0.0008 +0.0015 +0.0172
-+0.0042 +0.0273 +0.0176 +0.0056 +0.0001 +0.0087 +0.0063 +0.0041 +0.0019 +0.0026 +0.0027 +0.8867 +0.0051 +0.0001 +0.0028 +0.0103 +0.0117 +0.0001 +0.0007 +0.0014
-+0.0095 +0.0057 +0.0007 +0.0004 +0.0001 +0.0063 +0.0025 +0.0026 +0.0003 +0.0177 +0.0643 +0.0276 +0.8150 +0.0056 +0.0016 +0.0065 +0.0090 +0.0000 +0.0002 +0.0243
-+0.0026 +0.0009 +0.0010 +0.0001 +0.0001 +0.0001 +0.0001 +0.0021 +0.0025 +0.0104 +0.0204 +0.0002 +0.0021 +0.9157 +0.0010 +0.0047 +0.0015 +0.0013 +0.0312 +0.0019
-+0.0312 +0.0064 +0.0030 +0.0014 +0.0011 +0.0085 +0.0042 +0.0055 +0.0048 +0.0009 +0.0043 +0.0045 +0.0005 +0.0007 +0.8860 +0.0242 +0.0076 +0.0000 +0.0001 +0.0050
-+0.0482 +0.0088 +0.0258 +0.0074 +0.0077 +0.0035 +0.0062 +0.0296 +0.0022 +0.0017 +0.0026 +0.0120 +0.0014 +0.0027 +0.0176 +0.7732 +0.0429 +0.0011 +0.0016 +0.0038
-+0.0447 +0.0021 +0.0131 +0.0051 +0.0011 +0.0032 +0.0032 +0.0057 +0.0014 +0.0100 +0.0047 +0.0160 +0.0023 +0.0010 +0.0066 +0.0510 +0.8117 +0.0000 +0.0019 +0.0150
-+0.0003 +0.0123 +0.0015 +0.0001 +0.0001 +0.0002 +0.0000 +0.0002 +0.0015 +0.0001 +0.0061 +0.0005 +0.0001 +0.0047 +0.0001 +0.0075 +0.0002 +0.9616 +0.0029 +0.0001
-+0.0033 +0.0006 +0.0054 +0.0003 +0.0049 +0.0002 +0.0016 +0.0003 +0.0064 +0.0023 +0.0042 +0.0018 +0.0001 +0.0415 +0.0002 +0.0038 +0.0038 +0.0010 +0.9155 +0.0029
-+0.0255 +0.0016 +0.0013 +0.0015 +0.0025 +0.0022 +0.0030 +0.0075 +0.0022 +0.0449 +0.0227 +0.0017 +0.0055 +0.0012 +0.0039 +0.0041 +0.0135 +0.0000 +0.0013 +0.8537
-
-+0.4899 +0.0076 +0.0204 +0.0251 +0.0068 +0.0154 +0.0345 +0.0804 +0.0060 +0.0135 +0.0180 +0.0162 +0.0048 +0.0043 +0.0469 +0.0873 +0.0714 +0.0003 +0.0038 +0.0474
-+0.0162 +0.6169 +0.0126 +0.0047 +0.0042 +0.0351 +0.0068 +0.0085 +0.0316 +0.0097 +0.0093 +0.1400 +0.0062 +0.0033 +0.0231 +0.0380 +0.0133 +0.0091 +0.0020 +0.0093
-+0.0439 +0.0127 +0.3793 +0.1085 +0.0024 +0.0207 +0.0411 +0.0512 +0.0529 +0.0104 +0.0133 +0.0827 +0.0021 +0.0042 +0.0144 +0.0908 +0.0477 +0.0012 +0.0104 +0.0101
-+0.0467 +0.0041 +0.0936 +0.4790 +0.0009 +0.0300 +0.1583 +0.0492 +0.0169 +0.0059 +0.0039 +0.0327 +0.0011 +0.0009 +0.0083 +0.0356 +0.0217 +0.0002 +0.0018 +0.0090
-+0.0176 +0.0051 +0.0029 +0.0013 +0.8583 +0.0011 +0.0014 +0.0082 +0.0046 +0.0078 +0.0018 +0.0022 +0.0005 +0.0016 +0.0066 +0.0414 +0.0087 +0.0002 +0.0135 +0.0152
-+0.0350 +0.0376 +0.0219 +0.0368 +0.0009 +0.5044 +0.1050 +0.0170 +0.0677 +0.0056 +0.0260 +0.0510 +0.0064 +0.0015 +0.0306 +0.0217 +0.0162 +0.0004 +0.0016 +0.0126
-+0.0606 +0.0056 +0.0335 +0.1498 +0.0009 +0.0811 +0.4904 +0.0369 +0.0130 +0.0091 +0.0079 +0.0320 +0.0026 +0.0011 +0.0147 +0.0282 +0.0161 +0.0001 +0.0030 +0.0134
-+0.0790 +0.0039 +0.0234 +0.0260 +0.0031 +0.0073 +0.0206 +0.6974 +0.0037 +0.0029 +0.0053 +0.0139 +0.0017 +0.0032 +0.0126 +0.0602 +0.0173 +0.0002 +0.0009 +0.0172
-+0.0155 +0.0385 +0.0636 +0.0236 +0.0046 +0.0770 +0.0192 +0.0098 +0.6122 +0.0039 +0.0186 +0.0213 +0.0013 +0.0094 +0.0216 +0.0186 +0.0107 +0.0016 +0.0160 +0.0129
-+0.0319 +0.0108 +0.0114 +0.0074 +0.0070 +0.0058 +0.0122 +0.0069 +0.0036 +0.4982 +0.0897 +0.0182 +0.0182 +0.0299 +0.0063 +0.0142 +0.0402 +0.0003 +0.0069 +0.1809
-+0.0184 +0.0044 +0.0063 +0.0021 +0.0007 +0.0117 +0.0046 +0.0055 +0.0073 +0.0388 +0.7460 +0.0099 +0.0284 +0.0283 +0.0085 +0.0083 +0.0116 +0.0024 +0.0057 +0.0510
-+0.0176 +0.0712 +0.0416 +0.0190 +0.0009 +0.0243 +0.0197 +0.0153 +0.0089 +0.0083 +0.0105 +0.6651 +0.0127 +0.0012 +0.0105 +0.0313 +0.0321 +0.0006 +0.0024 +0.0069
-+0.0282 +0.0172 +0.0057 +0.0035 +0.0011 +0.0166 +0.0087 +0.0103 +0.0030 +0.0455 +0.1641 +0.0692 +0.4902 +0.0173 +0.0071 +0.0191 +0.0255 +0.0005 +0.0021 +0.0652
-+0.0095 +0.0034 +0.0043 +0.0011 +0.0013 +0.0014 +0.0013 +0.0072 +0.0079 +0.0277 +0.0607 +0.0024 +0.0064 +0.7393 +0.0036 +0.0130 +0.0063 +0.0040 +0.0886 +0.0104
-+0.0806 +0.0187 +0.0115 +0.0077 +0.0044 +0.0231 +0.0144 +0.0220 +0.0143 +0.0046 +0.0143 +0.0167 +0.0021 +0.0029 +0.6573 +0.0615 +0.0261 +0.0003 +0.0010 +0.0166
-+0.1093 +0.0224 +0.0527 +0.0240 +0.0199 +0.0119 +0.0200 +0.0766 +0.0090 +0.0075 +0.0102 +0.0362 +0.0040 +0.0074 +0.0448 +0.4262 +0.0935 +0.0030 +0.0053 +0.0159
-+0.1063 +0.0093 +0.0329 +0.0174 +0.0050 +0.0106 +0.0136 +0.0262 +0.0062 +0.0253 +0.0169 +0.0441 +0.0064 +0.0043 +0.0226 +0.1112 +0.4943 +0.0004 +0.0058 +0.0411
-+0.0028 +0.0353 +0.0048 +0.0009 +0.0005 +0.0015 +0.0007 +0.0017 +0.0052 +0.0012 +0.0192 +0.0047 +0.0006 +0.0152 +0.0015 +0.0201 +0.0024 +0.8711 +0.0095 +0.0012
-+0.0111 +0.0028 +0.0140 +0.0028 +0.0151 +0.0021 +0.0050 +0.0028 +0.0180 +0.0085 +0.0163 +0.0066 +0.0010 +0.1178 +0.0017 +0.0123 +0.0114 +0.0033 +0.7377 +0.0097
-+0.0638 +0.0059 +0.0063 +0.0065 +0.0079 +0.0074 +0.0102 +0.0236 +0.0067 +0.1031 +0.0672 +0.0086 +0.0149 +0.0064 +0.0130 +0.0171 +0.0372 +0.0002 +0.0045 +0.5896
-
-
-[0] CLV 5: [ {(0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00010,0.00000,0.00000,0.00000,0.00000,0.00007,0.00000,0.00000,0.00000,0.00000,0.00000),(0.00004,0.00002,0.00001,0.00000,0.00000,0.00001,0.00001,0.00000,0.00000,0.00080,0.00002,0.00000,0.00002,0.00001,0.00062,0.00002,0.00004,0.00000,0.00000,0.00011),(0.00037,0.00013,0.00008,0.00002,0.00003,0.00009,0.00007,0.00001,0.00004,0.00245,0.00019,0.00005,0.00017,0.00006,0.00218,0.00018,0.00034,0.00000,0.00001,0 [...]
-[0] CLV 6: [ {(0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00010,0.00000,0.00000,0.00000,0.00000,0.00007,0.00000,0.00000,0.00000,0.00000,0.00000),(0.00005,0.00002,0.00001,0.00000,0.00001,0.00002,0.00001,0.00000,0.00001,0.00069,0.00003,0.00001,0.00003,0.00001,0.00057,0.00003,0.00005,0.00000,0.00000,0.00013),(0.00040,0.00018,0.00014,0.00008,0.00007,0.00016,0.00013,0.00009,0.00011,0.00165,0.00029,0.00010,0.00030,0.00013,0.00168,0.00027,0.00037,0.00002,0.00004,0 [...]
-[0] CLV 7: [ {(0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00004,0.00000,0.00000,0.00000,0.00000,0.00025,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000,0.00000),(0.00003,0.00000,0.00000,0.00000,0.00000,0.00001,0.00000,0.00031,0.00000,0.00000,0.00001,0.00001,0.00170,0.00000,0.00000,0.00003,0.00001,0.00000,0.00000,0.00003),(0.00023,0.00003,0.00005,0.00002,0.00000,0.00006,0.00005,0.00091,0.00000,0.00006,0.00008,0.00011,0.00424,0.00002,0.00002,0.00019,0.00009,0.00000,0.00000,0 [...]
-
-inner-inner logL: -165.415219
-persite logL: -15.1027349 -14.4745285 -13.0941374 -16.6015569 -17.2163821 -13.0496614 -13.3573518 -13.3502665 -13.2075588 -14.0316208 -10.0930399 -11.8363799
-checksum logL: -165.415219
-tip-inner logL: -165.415219
-persite logL: -15.1027349 -14.4745285 -13.0941374 -16.6015569 -17.2163821 -13.0496614 -13.3573518 -13.3502665 -13.2075588 -14.0316208 -10.0930399 -11.8363799
-checksum logL: -165.415219
diff --git a/test/out/00022_NMOR_lkcalc.out b/test/out/00022_NMOR_lkcalc.out
deleted file mode 100644
index 6fa06d6..0000000
--- a/test/out/00022_NMOR_lkcalc.out
+++ /dev/null
@@ -1,146 +0,0 @@
-[0] P-matrix for branch length 0.500000
-+0.9795 +0.0007 +0.0026 +0.0033 +0.0060 +0.0065 +0.0013
-+0.0006 +0.9897 +0.0016 +0.0014 +0.0021 +0.0020 +0.0025
-+0.0024 +0.0017 +0.9838 +0.0024 +0.0035 +0.0031 +0.0030
-+0.0036 +0.0018 +0.0029 +0.9788 +0.0047 +0.0042 +0.0040
-+0.0048 +0.0020 +0.0030 +0.0034 +0.9781 +0.0044 +0.0042
-+0.0060 +0.0021 +0.0031 +0.0035 +0.0051 +0.9789 +0.0012
-+0.0013 +0.0030 +0.0033 +0.0036 +0.0053 +0.0013 +0.9822
-
-+0.8572 +0.0059 +0.0188 +0.0231 +0.0409 +0.0440 +0.0102
-+0.0050 +0.9255 +0.0116 +0.0105 +0.0153 +0.0140 +0.0180
-+0.0173 +0.0124 +0.8851 +0.0173 +0.0245 +0.0221 +0.0212
-+0.0252 +0.0134 +0.0204 +0.8525 +0.0323 +0.0288 +0.0274
-+0.0328 +0.0143 +0.0213 +0.0237 +0.8487 +0.0305 +0.0288
-+0.0406 +0.0151 +0.0221 +0.0244 +0.0352 +0.8532 +0.0095
-+0.0102 +0.0210 +0.0230 +0.0251 +0.0360 +0.0103 +0.8745
-
-+0.6185 +0.0213 +0.0533 +0.0614 +0.1036 +0.1089 +0.0329
-+0.0183 +0.7811 +0.0346 +0.0312 +0.0447 +0.0399 +0.0502
-+0.0492 +0.0373 +0.6798 +0.0481 +0.0677 +0.0603 +0.0576
-+0.0670 +0.0397 +0.0569 +0.6050 +0.0851 +0.0753 +0.0710
-+0.0829 +0.0417 +0.0587 +0.0624 +0.6018 +0.0790 +0.0736
-+0.1005 +0.0430 +0.0603 +0.0637 +0.0911 +0.6100 +0.0313
-+0.0329 +0.0585 +0.0624 +0.0651 +0.0920 +0.0339 +0.6551
-
-+0.2559 +0.0779 +0.1187 +0.1158 +0.1721 +0.1669 +0.0927
-+0.0668 +0.4500 +0.0909 +0.0794 +0.1102 +0.0947 +0.1080
-+0.1095 +0.0979 +0.3093 +0.1025 +0.1414 +0.1234 +0.1160
-+0.1263 +0.1011 +0.1212 +0.2309 +0.1570 +0.1369 +0.1266
-+0.1377 +0.1028 +0.1225 +0.1152 +0.2546 +0.1400 +0.1271
-+0.1541 +0.1020 +0.1234 +0.1158 +0.1616 +0.2516 +0.0916
-+0.0927 +0.1260 +0.1257 +0.1161 +0.1589 +0.0992 +0.2815
-
-
-[0] P-matrix for branch length 0.500000
-+0.9795 +0.0007 +0.0026 +0.0033 +0.0060 +0.0065 +0.0013
-+0.0006 +0.9897 +0.0016 +0.0014 +0.0021 +0.0020 +0.0025
-+0.0024 +0.0017 +0.9838 +0.0024 +0.0035 +0.0031 +0.0030
-+0.0036 +0.0018 +0.0029 +0.9788 +0.0047 +0.0042 +0.0040
-+0.0048 +0.0020 +0.0030 +0.0034 +0.9781 +0.0044 +0.0042
-+0.0060 +0.0021 +0.0031 +0.0035 +0.0051 +0.9789 +0.0012
-+0.0013 +0.0030 +0.0033 +0.0036 +0.0053 +0.0013 +0.9822
-
-+0.8572 +0.0059 +0.0188 +0.0231 +0.0409 +0.0440 +0.0102
-+0.0050 +0.9255 +0.0116 +0.0105 +0.0153 +0.0140 +0.0180
-+0.0173 +0.0124 +0.8851 +0.0173 +0.0245 +0.0221 +0.0212
-+0.0252 +0.0134 +0.0204 +0.8525 +0.0323 +0.0288 +0.0274
-+0.0328 +0.0143 +0.0213 +0.0237 +0.8487 +0.0305 +0.0288
-+0.0406 +0.0151 +0.0221 +0.0244 +0.0352 +0.8532 +0.0095
-+0.0102 +0.0210 +0.0230 +0.0251 +0.0360 +0.0103 +0.8745
-
-+0.6185 +0.0213 +0.0533 +0.0614 +0.1036 +0.1089 +0.0329
-+0.0183 +0.7811 +0.0346 +0.0312 +0.0447 +0.0399 +0.0502
-+0.0492 +0.0373 +0.6798 +0.0481 +0.0677 +0.0603 +0.0576
-+0.0670 +0.0397 +0.0569 +0.6050 +0.0851 +0.0753 +0.0710
-+0.0829 +0.0417 +0.0587 +0.0624 +0.6018 +0.0790 +0.0736
-+0.1005 +0.0430 +0.0603 +0.0637 +0.0911 +0.6100 +0.0313
-+0.0329 +0.0585 +0.0624 +0.0651 +0.0920 +0.0339 +0.6551
-
-+0.2559 +0.0779 +0.1187 +0.1158 +0.1721 +0.1669 +0.0927
-+0.0668 +0.4500 +0.0909 +0.0794 +0.1102 +0.0947 +0.1080
-+0.1095 +0.0979 +0.3093 +0.1025 +0.1414 +0.1234 +0.1160
-+0.1263 +0.1011 +0.1212 +0.2309 +0.1570 +0.1369 +0.1266
-+0.1377 +0.1028 +0.1225 +0.1152 +0.2546 +0.1400 +0.1271
-+0.1541 +0.1020 +0.1234 +0.1158 +0.1616 +0.2516 +0.0916
-+0.0927 +0.1260 +0.1257 +0.1161 +0.1589 +0.0992 +0.2815
-
-
-[0] P-matrix for branch length 0.300000
-+0.9876 +0.0004 +0.0016 +0.0020 +0.0036 +0.0039 +0.0008
-+0.0004 +0.9938 +0.0009 +0.0009 +0.0013 +0.0012 +0.0015
-+0.0015 +0.0010 +0.9902 +0.0015 +0.0021 +0.0019 +0.0018
-+0.0022 +0.0011 +0.0017 +0.9872 +0.0028 +0.0025 +0.0024
-+0.0029 +0.0012 +0.0018 +0.0021 +0.9868 +0.0027 +0.0025
-+0.0036 +0.0013 +0.0019 +0.0021 +0.0031 +0.9873 +0.0007
-+0.0008 +0.0018 +0.0020 +0.0022 +0.0032 +0.0008 +0.9893
-
-+0.9111 +0.0034 +0.0115 +0.0144 +0.0257 +0.0277 +0.0061
-+0.0029 +0.9545 +0.0070 +0.0064 +0.0094 +0.0086 +0.0111
-+0.0107 +0.0076 +0.9291 +0.0107 +0.0152 +0.0137 +0.0131
-+0.0157 +0.0082 +0.0126 +0.9082 +0.0202 +0.0180 +0.0171
-+0.0206 +0.0088 +0.0132 +0.0148 +0.9055 +0.0191 +0.0181
-+0.0256 +0.0093 +0.0137 +0.0152 +0.0220 +0.9085 +0.0056
-+0.0061 +0.0130 +0.0142 +0.0157 +0.0226 +0.0061 +0.9223
-
-+0.7439 +0.0121 +0.0346 +0.0413 +0.0717 +0.0763 +0.0200
-+0.0104 +0.8607 +0.0218 +0.0198 +0.0285 +0.0259 +0.0329
-+0.0319 +0.0235 +0.7901 +0.0316 +0.0446 +0.0400 +0.0383
-+0.0451 +0.0252 +0.0373 +0.7351 +0.0576 +0.0512 +0.0485
-+0.0574 +0.0266 +0.0387 +0.0423 +0.7304 +0.0540 +0.0506
-+0.0705 +0.0279 +0.0400 +0.0433 +0.0623 +0.7374 +0.0188
-+0.0200 +0.0384 +0.0415 +0.0444 +0.0633 +0.0203 +0.7721
-
-+0.3931 +0.0480 +0.0913 +0.0965 +0.1524 +0.1544 +0.0644
-+0.0411 +0.6036 +0.0642 +0.0570 +0.0801 +0.0698 +0.0842
-+0.0843 +0.0692 +0.4621 +0.0805 +0.1120 +0.0985 +0.0935
-+0.1053 +0.0725 +0.0951 +0.3710 +0.1321 +0.1158 +0.1082
-+0.1219 +0.0747 +0.0970 +0.0969 +0.3794 +0.1200 +0.1101
-+0.1425 +0.0752 +0.0985 +0.0980 +0.1385 +0.3845 +0.0627
-+0.0644 +0.0982 +0.1013 +0.0992 +0.1376 +0.0680 +0.4313
-
-
-[0] P-matrix for branch length 0.200000
-+0.9917 +0.0003 +0.0011 +0.0013 +0.0024 +0.0026 +0.0005
-+0.0002 +0.9959 +0.0006 +0.0006 +0.0009 +0.0008 +0.0010
-+0.0010 +0.0007 +0.9935 +0.0010 +0.0014 +0.0013 +0.0012
-+0.0015 +0.0007 +0.0012 +0.9915 +0.0019 +0.0017 +0.0016
-+0.0019 +0.0008 +0.0012 +0.0014 +0.9912 +0.0018 +0.0017
-+0.0024 +0.0009 +0.0013 +0.0014 +0.0021 +0.9915 +0.0005
-+0.0005 +0.0012 +0.0013 +0.0015 +0.0021 +0.0005 +0.9928
-
-+0.9396 +0.0022 +0.0078 +0.0098 +0.0176 +0.0190 +0.0041
-+0.0019 +0.9694 +0.0047 +0.0043 +0.0063 +0.0058 +0.0075
-+0.0072 +0.0051 +0.9520 +0.0072 +0.0103 +0.0093 +0.0089
-+0.0106 +0.0055 +0.0085 +0.9377 +0.0137 +0.0123 +0.0117
-+0.0141 +0.0059 +0.0089 +0.0101 +0.9358 +0.0130 +0.0123
-+0.0175 +0.0063 +0.0093 +0.0104 +0.0150 +0.9378 +0.0037
-+0.0041 +0.0088 +0.0097 +0.0107 +0.0154 +0.0040 +0.9474
-
-+0.8190 +0.0078 +0.0240 +0.0292 +0.0515 +0.0551 +0.0133
-+0.0067 +0.9044 +0.0149 +0.0135 +0.0197 +0.0179 +0.0230
-+0.0222 +0.0160 +0.8535 +0.0220 +0.0312 +0.0281 +0.0269
-+0.0319 +0.0172 +0.0261 +0.8130 +0.0409 +0.0364 +0.0345
-+0.0412 +0.0183 +0.0271 +0.0300 +0.8087 +0.0385 +0.0362
-+0.0509 +0.0193 +0.0281 +0.0308 +0.0444 +0.8141 +0.0124
-+0.0133 +0.0268 +0.0292 +0.0316 +0.0453 +0.0134 +0.8403
-
-+0.5176 +0.0312 +0.0695 +0.0774 +0.1271 +0.1318 +0.0454
-+0.0267 +0.7087 +0.0465 +0.0417 +0.0592 +0.0524 +0.0648
-+0.0642 +0.0501 +0.5860 +0.0621 +0.0870 +0.0771 +0.0735
-+0.0844 +0.0530 +0.0734 +0.5001 +0.1067 +0.0940 +0.0883
-+0.1017 +0.0553 +0.0754 +0.0782 +0.5005 +0.0981 +0.0908
-+0.1217 +0.0564 +0.0771 +0.0795 +0.1132 +0.5084 +0.0437
-+0.0454 +0.0756 +0.0796 +0.0810 +0.1135 +0.0473 +0.5575
-
-
-[0] CLV 5: [ {(0.95937,0.00000,0.00001,0.00001,0.00002,0.00004,0.00000),(0.73472,0.00003,0.00030,0.00063,0.00107,0.00165,0.00010),(0.38257,0.00033,0.00242,0.00449,0.00687,0.01010,0.00108),(0.06551,0.00446,0.01200,0.01595,0.01896,0.02374,0.00858)} {(0.00257,0.00000,0.00238,0.00001,0.00001,0.00002,0.00000),(0.01609,0.00006,0.01534,0.00051,0.00070,0.00090,0.00023),(0.03298,0.00063,0.03345,0.00381,0.00486,0.00606,0.00205),(0.03037,0.00607,0.03387,0.01530,0.01687,0.01902,0.01164)} {(0.00000,0 [...]
-[0] CLV 6: [ {(0.92040,0.00000,0.00001,0.00001,0.00002,0.00003,0.00000),(0.53992,0.00002,0.00023,0.00048,0.00082,0.00127,0.00008),(0.14775,0.00015,0.00107,0.00200,0.00308,0.00459,0.00048),(0.00727,0.00094,0.00214,0.00267,0.00303,0.00365,0.00165)} {(0.00252,0.00001,0.00234,0.00003,0.00003,0.00004,0.00000),(0.01402,0.00034,0.01361,0.00118,0.00145,0.00178,0.00010),(0.02288,0.00279,0.02392,0.00693,0.00789,0.00950,0.00188),(0.01923,0.01246,0.01949,0.01643,0.01672,0.01801,0.01254)} {(0.00000,0 [...]
-[0] CLV 7: [ {(0.95937,0.00000,0.00001,0.00001,0.00002,0.00004,0.00000),(0.73472,0.00003,0.00030,0.00063,0.00107,0.00165,0.00010),(0.38257,0.00033,0.00242,0.00449,0.00687,0.01010,0.00108),(0.06551,0.00446,0.01200,0.01595,0.01896,0.02374,0.00858)} {(0.00000,0.00143,0.00000,0.00180,0.00001,0.00001,0.00001),(0.00014,0.00974,0.00022,0.01142,0.00034,0.00037,0.00053),(0.00131,0.02437,0.00180,0.02402,0.00260,0.00274,0.00381),(0.00902,0.03575,0.01003,0.02335,0.01184,0.01181,0.01463)} {(0.00001,0 [...]
-
-inner-inner logL: -91.354267
-persite logL: -3.2903602 -9.4980286 -7.8246442 -2.1734041 -10.9373875 -11.2036761 -9.6507114 -0.4935143 -9.0099294 -7.1581318 -10.8856090 -9.2288708
-checksum logL: -91.354267
-tip-inner logL: -91.354267
-persite logL: -3.2903602 -9.4980286 -7.8246442 -2.1734041 -10.9373875 -11.2036761 -9.6507114 -0.4935143 -9.0099294 -7.1581318 -10.8856090 -9.2288708
-checksum logL: -91.354267
diff --git a/test/out/00030_NMDU_gamma.out b/test/out/00030_NMDU_gamma.out
deleted file mode 100644
index 4c2af8d..0000000
--- a/test/out/00030_NMDU_gamma.out
+++ /dev/null
@@ -1,98 +0,0 @@
-[0] P-matrix for branch length 0.100000
-+0.9973 +0.0013 +0.0008 +0.0006
-+0.0010 +0.9971 +0.0003 +0.0016
-+0.0024 +0.0013 +0.9956 +0.0006
-+0.0010 +0.0032 +0.0003 +0.9955
-
-+0.9795 +0.0097 +0.0060 +0.0048
-+0.0072 +0.9784 +0.0024 +0.0119
-+0.0179 +0.0097 +0.9676 +0.0048
-+0.0072 +0.0238 +0.0024 +0.9665
-
-+0.9356 +0.0306 +0.0184 +0.0153
-+0.0230 +0.9328 +0.0077 +0.0366
-+0.0553 +0.0306 +0.8988 +0.0153
-+0.0230 +0.0732 +0.0077 +0.8962
-
-+0.7992 +0.0980 +0.0538 +0.0490
-+0.0735 +0.7968 +0.0245 +0.1052
-+0.1614 +0.0980 +0.6917 +0.0490
-+0.0735 +0.2105 +0.0245 +0.6915
-
-
-[0] P-matrix for branch length 0.200000
-+0.9945 +0.0026 +0.0016 +0.0013
-+0.0019 +0.9942 +0.0006 +0.0032
-+0.0048 +0.0026 +0.9913 +0.0013
-+0.0019 +0.0064 +0.0006 +0.9910
-
-+0.9597 +0.0191 +0.0117 +0.0095
-+0.0143 +0.9577 +0.0048 +0.0232
-+0.0350 +0.0191 +0.9364 +0.0095
-+0.0143 +0.0464 +0.0048 +0.9345
-
-+0.8775 +0.0589 +0.0342 +0.0294
-+0.0442 +0.8737 +0.0147 +0.0674
-+0.1025 +0.0589 +0.8092 +0.0294
-+0.0442 +0.1348 +0.0147 +0.8063
-
-+0.6582 +0.1720 +0.0838 +0.0860
-+0.1290 +0.6666 +0.0430 +0.1614
-+0.2514 +0.1720 +0.4907 +0.0860
-+0.1290 +0.3228 +0.0430 +0.5052
-
-
-[0] P-matrix for branch length 1.000000
-+0.9730 +0.0128 +0.0079 +0.0064
-+0.0096 +0.9716 +0.0032 +0.0157
-+0.0236 +0.0128 +0.9573 +0.0064
-+0.0096 +0.0313 +0.0032 +0.9559
-
-+0.8214 +0.0868 +0.0484 +0.0434
-+0.0651 +0.8183 +0.0217 +0.0950
-+0.1452 +0.0868 +0.7246 +0.0434
-+0.0651 +0.1899 +0.0217 +0.7233
-
-+0.5728 +0.2196 +0.0977 +0.1098
-+0.1647 +0.5937 +0.0549 +0.1867
-+0.2932 +0.2196 +0.3774 +0.1098
-+0.1647 +0.3734 +0.0549 +0.4069
-
-+0.3299 +0.3759 +0.1062 +0.1880
-+0.2819 +0.4177 +0.0940 +0.2064
-+0.3187 +0.3759 +0.1174 +0.1880
-+0.2819 +0.4129 +0.0940 +0.2112
-
-
-[0] P-matrix for branch length 1.000000
-+0.9730 +0.0128 +0.0079 +0.0064
-+0.0096 +0.9716 +0.0032 +0.0157
-+0.0236 +0.0128 +0.9573 +0.0064
-+0.0096 +0.0313 +0.0032 +0.9559
-
-+0.8214 +0.0868 +0.0484 +0.0434
-+0.0651 +0.8183 +0.0217 +0.0950
-+0.1452 +0.0868 +0.7246 +0.0434
-+0.0651 +0.1899 +0.0217 +0.7233
-
-+0.5728 +0.2196 +0.0977 +0.1098
-+0.1647 +0.5937 +0.0549 +0.1867
-+0.2932 +0.2196 +0.3774 +0.1098
-+0.1647 +0.3734 +0.0549 +0.4069
-
-+0.3299 +0.3759 +0.1062 +0.1880
-+0.2819 +0.4177 +0.0940 +0.2064
-+0.3187 +0.3759 +0.1174 +0.1880
-+0.2819 +0.4129 +0.0940 +0.2112
-
-
-[0] CLV 5: [ {(0.00257,0.00513,0.00002,0.00639),(0.01851,0.03595,0.00085,0.04406),(0.05342,0.09749,0.00777,0.11466),(0.12799,0.19359,0.05802,0.20474)} {(0.00257,0.00193,0.00001,0.00001),(0.01833,0.01372,0.00067,0.00067),(0.05168,0.03859,0.00603,0.00596),(0.11320,0.08598,0.04323,0.04164)} {(0.00001,0.98843,0.00001,0.00004),(0.00036,0.91716,0.00036,0.00216),(0.00347,0.76334,0.00347,0.01818),(0.02958,0.44435,0.02958,0.10423)} {(1.00000,1.00000,1.00000,1.00000),(1.00000,1.00000,1.00000,1.000 [...]
-[0] CLV 6: [ {(0.00256,0.00001,0.00000,0.00001),(0.01794,0.00051,0.00006,0.00062),(0.04814,0.00426,0.00150,0.00491),(0.08848,0.02407,0.02257,0.02491)} {(0.00257,0.00192,0.00002,0.00002),(0.01809,0.01356,0.00111,0.00110),(0.04974,0.03745,0.00955,0.00939),(0.10327,0.08227,0.05863,0.05627)} {(0.00000,0.97983,0.00000,0.00002),(0.00018,0.85943,0.00018,0.00111),(0.00159,0.62277,0.00159,0.00974),(0.01271,0.24525,0.01271,0.05440)} {(1.00000,1.00000,1.00000,1.00000),(1.00000,1.00000,1.00000,1.000 [...]
-[0] CLV 7: [ {(0.00001,0.98843,0.00001,0.00004),(0.00036,0.91716,0.00036,0.00216),(0.00347,0.76334,0.00347,0.01818),(0.02958,0.44435,0.02958,0.10423)} {(0.00129,0.00001,0.00001,0.00192),(0.00916,0.00033,0.00033,0.01338),(0.02584,0.00298,0.00302,0.03561),(0.05660,0.02082,0.02161,0.06516)} {(0.00001,0.98843,0.00001,0.00004),(0.00036,0.91716,0.00036,0.00216),(0.00347,0.76334,0.00347,0.01818),(0.02958,0.44435,0.02958,0.10423)} {(0.00129,0.00322,0.00129,0.99098),(0.00955,0.02322,0.00955,0.934 [...]
-
-inner-inner logL: -58.887310
-persite logL: -6.1622140 -6.9407523 -1.4797267 -1.6094379 -5.2773906 -8.1327377 -5.7500211 -0.0000000 -5.1947970 -2.1438344 -8.0304760 -8.1659221
-checksum logL: -58.887310
-tip-inner logL: -58.887310
-persite logL: -6.1622140 -6.9407523 -1.4797267 -1.6094379 -5.2773906 -8.1327377 -5.7500211 -0.0000000 -5.1947970 -2.1438344 -8.0304760 -8.1659221
-checksum logL: -58.887310
diff --git a/test/out/asc-bias.out b/test/out/asc-bias.out
index b8706fd..2195882 100644
--- a/test/out/asc-bias.out
+++ b/test/out/asc-bias.out
@@ -1,95 +1,9 @@
Read testdata/2000.tree: 2000 taxa
-Read testdata/2000.fas: 1251 sites
-
-TEST 1: NO ASC BIAS
-Log-L: -376539.211547
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -376569.858622 -7.17805288e+03 9.00973704e+06 *
- 0.0010 -376565.211482 -4.02412312e+03 1.60951377e+06 *
- 0.0100 -376549.092340 -9.26475886e+02 9.12042854e+04 *
- 0.1000 -376546.759479 2.18660011e+02 1.79731004e+03 *
- 1.0000 -376790.406580 2.22401826e+02 -1.04126523e+02
- 10.0000 -377445.004318 2.42918481e+01 -3.40494037e+00
-100.0000 -377836.767226 7.72835622e-01 -1.91544043e-02
-
-TEST 2: ASC BIAS LEWIS
-Log-L: -376534.406057
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -376565.047252 -7.17817732e+03 9.00973705e+06 *
- 0.0010 -376560.400224 -4.02424756e+03 1.60951377e+06 *
- 0.0100 -376544.282202 -9.26600271e+02 9.12042916e+04 *
- 0.1000 -376541.960510 2.18536185e+02 1.79731623e+03 *
- 1.0000 -376785.716589 2.22283429e+02 -1.04120649e+02
- 10.0000 -377441.178362 2.42147192e+01 -3.40142409e+00
-100.0000 -377834.948574 7.67928196e-01 -1.90429535e-02
-
-TEST 2: ASC BIAS FELSENSTEIN
-Log-L: -377485.067669
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -377515.507269 -7.18244147e+03 9.00973715e+06 *
- 0.0010 -377510.864079 -4.02851161e+03 1.60951387e+06 *
- 0.0100 -377494.784429 -9.30863425e+02 9.12043913e+04 *
- 0.1000 -377492.846018 2.14281997e+02 1.79741579e+03 *
- 1.0000 -377740.390709 2.18118294e+02 -1.04022325e+02
- 10.0000 -378429.545536 2.08699917e+01 -3.31802737e+00
-100.0000 -378947.603295 3.14443304e-01 -9.98182917e-03
-
-TEST 2: ASC BIAS STAMATAKIS
-Log-L: -377961.619605
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -377991.971916 -7.17181912e+03 9.00973694e+06 *
- 0.0010 -377987.330386 -4.01788946e+03 1.60951367e+06 *
- 0.0100 -377971.267343 -9.20243116e+02 9.12041859e+04 *
- 0.1000 -377969.495029 2.24883827e+02 1.79721051e+03 *
- 1.0000 -378218.703151 2.28535724e+02 -1.04226800e+02
- 10.0000 -378924.372499 2.95020195e+01 -3.50863767e+00
-100.0000 -379504.407122 1.30619027e+00 -3.15896886e-02
-
-TEST 1: NO ASC BIAS
-Log-L: -376539.211547
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -376588.767896 -2.01491393e+04 4.35212664e+07 *
- 0.0010 -376578.147065 -7.83726887e+03 4.69011502e+06 *
- 0.0100 -376552.867352 -1.27249532e+03 1.36077377e+05 *
- 0.1000 -376546.153557 2.15083632e+02 1.92380335e+03 *
- 1.0000 -376787.910260 2.20059204e+02 -1.02352431e+02
- 10.0000 -377440.724115 2.43890918e+01 -3.40966697e+00
-100.0000 -377835.804935 7.80659251e-01 -1.93956876e-02
-
-TEST 2: ASC BIAS LEWIS
-Log-L: -376534.406057
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -376583.956195 -2.01492638e+04 4.35212664e+07 *
- 0.0010 -376573.335476 -7.83739332e+03 4.69011503e+06 *
- 0.0100 -376548.056883 -1.27261971e+03 1.36077383e+05 *
- 0.1000 -376541.354258 2.14959797e+02 1.92380954e+03 *
- 1.0000 -376783.219948 2.19940799e+02 -1.02346556e+02
- 10.0000 -377436.897900 2.43119573e+01 -3.40615043e+00
-100.0000 -377833.986162 7.75751506e-01 -1.92842294e-02
-
-TEST 2: ASC BIAS FELSENSTEIN
-Log-L: -377485.067669
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -377534.404871 -2.01535279e+04 4.35212665e+07 *
- 0.0010 -377523.787990 -7.84165738e+03 4.69011513e+06 *
- 0.0100 -377498.547769 -1.27688288e+03 1.36077483e+05 *
- 0.1000 -377492.228426 2.10705597e+02 1.92390910e+03 *
- 1.0000 -377737.882738 2.15775653e+02 -1.02248232e+02
- 10.0000 -378425.253834 2.09672214e+01 -3.32275333e+00
-100.0000 -378946.629686 3.22267661e-01 -1.02231200e-02
-
-TEST 2: ASC BIAS STAMATAKIS
-Log-L: -377961.619605
- Br.Len logLikelihood 1st Deriv 2nd Deriv
- 0.0001 -378010.864604 -2.01429056e+04 4.35212663e+07 *
- 0.0010 -378000.249384 -7.83103519e+03 4.69011492e+06 *
- 0.0100 -377975.025770 -1.26626254e+03 1.36077278e+05 *
- 0.1000 -377968.872522 2.21307457e+02 1.92370382e+03 *
- 1.0000 -378216.190255 2.26193111e+02 -1.02452708e+02
- 10.0000 -378920.075798 2.95992716e+01 -3.51336437e+00
-100.0000 -379503.428611 1.31401425e+00 -3.18309848e-02
+ Traversal buffer: 0(-1) 1(-1) 2000(0) 2(-1) 3(-1) 2001(1) 2002(2) 4(-1) 5(-1) 6(-1) 2003(3) 2004(4) 7(-1) 8(-1) 9(-1) 10(-1) 2005(5) 2006(6) 2007(7) 11(-1) 12(-1) 13(-1) 2008(8) 2009(9) 14(-1) 15(-1) 16(-1) 17(-1) 18(-1) 2010(10) 2011(11) 19(-1) 2012(12) 2013(13) 20(-1) 21(-1) 2014(14) 2015(15) 22(-1) 23(-1) 2016(16) 24(-1) 25(-1) 2017(17) 26(-1) 2018(18) 2019(19) 2020(20) 2021(21) 27(-1) 28(-1) 29(-1) 30(-1) 31(-1) 2022(22) 2023(23) 2024(24) 2025(25) 2026(26) 32(-1) 33(-1) 34(-1) 35(- [...]
+ Operations: 0[0]+1[1]->2000 2[2]+3[3]->2001 2000[2000]+2001[2001]->2002 5[5]+6[6]->2003 4[4]+2003[2003]->2004 9[9]+10[10]->2005 8[8]+2005[2005]->2006 7[7]+2006[2006]->2007 12[12]+13[13]->2008 11[11]+2008[2008]->2009 17[17]+18[18]->2010 16[16]+2010[2010]->2011 2011[2011]+19[19]->2012 15[15]+2012[2012]->2013 20[20]+21[21]->2014 2013[2013]+2014[2014]->2015 22[22]+23[23]->2016 24[24]+25[25]->2017 2017[2017]+26[26]->2018 2016[2016]+2018[2018]->2019 2015[2015]+2019[2019]->2020 14[14]+2020[20 [...]
TEST 1: NO ASC BIAS
+Read testdata/2000.fas: 1251 sites
Log-L: -376539.211547
Br.Len logLikelihood 1st Deriv 2nd Deriv
0.0001 -376662.410545 -2.83159180e+04 5.91239012e+07 *
diff --git a/test/out/derivatives-oddstates.out b/test/out/derivatives-oddstates.out
index b9dc507..4443c85 100644
--- a/test/out/derivatives-oddstates.out
+++ b/test/out/derivatives-oddstates.out
@@ -29,75 +29,75 @@ Test -93.655614 = -93.655614
TEST alpha(ncats) = 0.10( 1) ; pinv = 0.30
1.000000
-Branch 0.1 : -96.794137 2.8357e+00 3.9279e+01
-Branch 0.2 : -97.202283 4.8421e+00 8.5988e+00
-Branch 0.5 : -98.720974 4.7313e+00 -4.0098e+00
-Branch 0.9 : -100.264298 2.9979e+00 -3.9846e+00
-Branch 1.5 : -101.478774 1.2639e+00 -1.8916e+00
-Branch 5.0 : -102.332278 9.2874e-03 -1.2299e-02
-Branch 10.0 : -102.339336 1.3871e-05 -1.7909e-05
-Branch 50.0 : -102.339347 2.7270e-15 -8.7487e-28
-Branch 90.0 : -102.339347 2.7270e-15 -1.8285e-32
+Branch 0.1 : -96.794137 1.9850e+00 1.9247e+01
+Branch 0.2 : -97.202283 3.3895e+00 4.2134e+00
+Branch 0.5 : -98.720974 3.3119e+00 -1.9648e+00
+Branch 0.9 : -100.264298 2.0985e+00 -1.9525e+00
+Branch 1.5 : -101.478774 8.8475e-01 -9.2688e-01
+Branch 5.0 : -102.332278 6.5012e-03 -6.0266e-03
+Branch 10.0 : -102.339336 9.7096e-06 -8.7755e-06
+Branch 50.0 : -102.339347 1.9089e-15 -4.2869e-28
+Branch 90.0 : -102.339347 1.9089e-15 -8.9598e-33
Test -96.794137 = -96.794137
-Branch(Tip) 0.1 : -95.654016 -3.5089e+00 1.5404e+02
-Branch(Tip) 0.2 : -95.783099 4.2894e+00 3.7207e+01
-Branch(Tip) 0.5 : -97.748757 7.1172e+00 -2.0770e+00
-Branch(Tip) 0.9 : -100.251762 5.1803e+00 -5.7371e+00
-Branch(Tip) 1.5 : -102.436243 2.3477e+00 -3.4138e+00
-Branch(Tip) 5.0 : -104.017665 1.6578e-02 -2.1989e-02
-Branch(Tip) 10.0 : -104.030262 2.4924e-05 -3.2141e-05
-Branch(Tip) 50.0 : -104.030281 2.7346e-15 -1.5841e-27
-Branch(Tip) 90.0 : -104.030281 2.7346e-15 -1.9386e-32
+Branch(Tip) 0.1 : -95.654016 -2.4563e+00 7.5478e+01
+Branch(Tip) 0.2 : -95.783099 3.0026e+00 1.8232e+01
+Branch(Tip) 0.5 : -97.748757 4.9821e+00 -1.0177e+00
+Branch(Tip) 0.9 : -100.251762 3.6262e+00 -2.8112e+00
+Branch(Tip) 1.5 : -102.436243 1.6434e+00 -1.6728e+00
+Branch(Tip) 5.0 : -104.017665 1.1604e-02 -1.0775e-02
+Branch(Tip) 10.0 : -104.030262 1.7447e-05 -1.5749e-05
+Branch(Tip) 50.0 : -104.030281 1.9142e-15 -7.7622e-28
+Branch(Tip) 90.0 : -104.030281 1.9142e-15 -9.4990e-33
Test -95.783099 = -95.783099
TEST alpha(ncats) = 0.10( 1) ; pinv = 0.60
1.000000
-Branch 0.1 : -105.234564 7.4230e+00 7.3740e+00
-Branch 0.2 : -105.979235 7.2309e+00 -7.5912e+00
-Branch 0.5 : -107.694200 4.1603e+00 -9.4659e+00
-Branch 0.9 : -108.763225 1.5595e+00 -3.9497e+00
-Branch 1.5 : -109.245342 3.4684e-01 -8.5204e-01
-Branch 5.0 : -109.389867 1.0493e-04 -2.3772e-04
-Branch 10.0 : -109.389914 1.3360e-09 -3.0041e-09
-Branch 50.0 : -109.389914 4.5326e-15 -1.8679e-32
-Branch 90.0 : -109.389914 4.5326e-15 -1.8679e-32
+Branch 0.1 : -105.234564 2.9692e+00 1.1798e+00
+Branch 0.2 : -105.979235 2.8923e+00 -1.2146e+00
+Branch 0.5 : -107.694200 1.6641e+00 -1.5145e+00
+Branch 0.9 : -108.763225 6.2380e-01 -6.3195e-01
+Branch 1.5 : -109.245342 1.3874e-01 -1.3633e-01
+Branch 5.0 : -109.389867 4.1972e-05 -3.8035e-05
+Branch 10.0 : -109.389914 5.3442e-10 -4.8066e-10
+Branch 50.0 : -109.389914 1.8130e-15 -2.9886e-33
+Branch 90.0 : -109.389914 1.8130e-15 -2.9886e-33
Test -105.234564 = -105.234564
-Branch(Tip) 0.1 : -102.669187 5.5139e+00 1.1971e+02
-Branch(Tip) 0.2 : -103.565615 1.0804e+01 1.6052e+01
-Branch(Tip) 0.5 : -106.644437 8.3920e+00 -1.5588e+01
-Branch(Tip) 0.9 : -108.893328 3.3646e+00 -8.5057e+00
-Branch(Tip) 1.5 : -109.923941 7.2417e-01 -1.8259e+00
-Branch(Tip) 5.0 : -110.220389 2.1206e-04 -4.7948e-04
-Branch(Tip) 10.0 : -110.220483 2.7300e-09 -6.1364e-09
-Branch(Tip) 50.0 : -110.220483 4.5345e-15 -1.9223e-32
-Branch(Tip) 90.0 : -110.220483 4.5345e-15 -1.9223e-32
+Branch(Tip) 0.1 : -102.669187 2.2056e+00 1.9154e+01
+Branch(Tip) 0.2 : -103.565615 4.3216e+00 2.5684e+00
+Branch(Tip) 0.5 : -106.644437 3.3568e+00 -2.4941e+00
+Branch(Tip) 0.9 : -108.893328 1.3459e+00 -1.3609e+00
+Branch(Tip) 1.5 : -109.923941 2.8967e-01 -2.9214e-01
+Branch(Tip) 5.0 : -110.220389 8.4824e-05 -7.6716e-05
+Branch(Tip) 10.0 : -110.220483 1.0920e-09 -9.8183e-10
+Branch(Tip) 50.0 : -110.220483 1.8138e-15 -3.0757e-33
+Branch(Tip) 90.0 : -110.220483 1.8138e-15 -3.0757e-33
Test -103.565615 = -103.565615
TEST alpha(ncats) = 0.10( 1) ; pinv = 0.90
1.000000
-Branch 0.1 : -135.403784 1.3449e+00 -1.2487e+01
-Branch 0.2 : -135.491444 5.3257e-01 -4.9217e+00
-Branch 0.5 : -135.545622 3.3897e-02 -3.0954e-01
-Branch 0.9 : -135.549245 8.9286e-04 -8.0898e-03
-Branch 1.5 : -135.549343 3.9519e-06 -3.5623e-05
-Branch 5.0 : -135.549344 1.7868e-14 -7.7070e-19
-Branch 10.0 : -135.549344 1.7868e-14 -2.0525e-32
-Branch 50.0 : -135.549344 1.7868e-14 -2.0525e-32
-Branch 90.0 : -135.549344 1.7868e-14 -2.0525e-32
+Branch 0.1 : -135.403784 1.3449e-01 -1.2487e-01
+Branch 0.2 : -135.491444 5.3257e-02 -4.9217e-02
+Branch 0.5 : -135.545622 3.3897e-03 -3.0954e-03
+Branch 0.9 : -135.549245 8.9286e-05 -8.0898e-05
+Branch 1.5 : -135.549343 3.9519e-07 -3.5623e-07
+Branch 5.0 : -135.549344 1.7868e-15 -7.7070e-21
+Branch 10.0 : -135.549344 1.7868e-15 -2.0525e-34
+Branch 50.0 : -135.549344 1.7868e-15 -2.0525e-34
+Branch 90.0 : -135.549344 1.7868e-15 -2.0525e-34
Test -135.403784 = -135.403784
-Branch(Tip) 0.1 : -133.446326 2.1381e+01 -1.9967e+02
-Branch(Tip) 0.2 : -134.810864 7.9184e+00 -8.0598e+01
-Branch(Tip) 0.5 : -135.561972 4.1872e-01 -3.9416e+00
-Branch(Tip) 0.9 : -135.605905 1.0538e-02 -9.5817e-02
-Branch(Tip) 1.5 : -135.607062 4.6350e-05 -4.1792e-04
-Branch(Tip) 5.0 : -135.607067 1.7869e-14 -9.0274e-18
-Branch(Tip) 10.0 : -135.607067 1.7868e-14 -2.0531e-32
-Branch(Tip) 50.0 : -135.607067 1.7868e-14 -2.0531e-32
-Branch(Tip) 90.0 : -135.607067 1.7868e-14 -2.0531e-32
+Branch(Tip) 0.1 : -133.446326 2.1381e+00 -1.9967e+00
+Branch(Tip) 0.2 : -134.810864 7.9184e-01 -8.0598e-01
+Branch(Tip) 0.5 : -135.561972 4.1872e-02 -3.9416e-02
+Branch(Tip) 0.9 : -135.605905 1.0538e-03 -9.5817e-04
+Branch(Tip) 1.5 : -135.607062 4.6350e-06 -4.1792e-06
+Branch(Tip) 5.0 : -135.607067 1.7869e-15 -9.0274e-20
+Branch(Tip) 10.0 : -135.607067 1.7868e-15 -2.0531e-34
+Branch(Tip) 50.0 : -135.607067 1.7868e-15 -2.0531e-34
+Branch(Tip) 90.0 : -135.607067 1.7868e-15 -2.0531e-34
Test -134.810864 = -134.810864
@@ -129,75 +129,75 @@ Test -93.655614 = -93.655614
TEST alpha(ncats) = 0.75( 1) ; pinv = 0.30
1.000000
-Branch 0.1 : -96.794137 2.8357e+00 3.9279e+01
-Branch 0.2 : -97.202283 4.8421e+00 8.5988e+00
-Branch 0.5 : -98.720974 4.7313e+00 -4.0098e+00
-Branch 0.9 : -100.264298 2.9979e+00 -3.9846e+00
-Branch 1.5 : -101.478774 1.2639e+00 -1.8916e+00
-Branch 5.0 : -102.332278 9.2874e-03 -1.2299e-02
-Branch 10.0 : -102.339336 1.3871e-05 -1.7909e-05
-Branch 50.0 : -102.339347 2.7270e-15 -8.7487e-28
-Branch 90.0 : -102.339347 2.7270e-15 -1.8285e-32
+Branch 0.1 : -96.794137 1.9850e+00 1.9247e+01
+Branch 0.2 : -97.202283 3.3895e+00 4.2134e+00
+Branch 0.5 : -98.720974 3.3119e+00 -1.9648e+00
+Branch 0.9 : -100.264298 2.0985e+00 -1.9525e+00
+Branch 1.5 : -101.478774 8.8475e-01 -9.2688e-01
+Branch 5.0 : -102.332278 6.5012e-03 -6.0266e-03
+Branch 10.0 : -102.339336 9.7096e-06 -8.7755e-06
+Branch 50.0 : -102.339347 1.9089e-15 -4.2869e-28
+Branch 90.0 : -102.339347 1.9089e-15 -8.9598e-33
Test -96.794137 = -96.794137
-Branch(Tip) 0.1 : -95.654016 -3.5089e+00 1.5404e+02
-Branch(Tip) 0.2 : -95.783099 4.2894e+00 3.7207e+01
-Branch(Tip) 0.5 : -97.748757 7.1172e+00 -2.0770e+00
-Branch(Tip) 0.9 : -100.251762 5.1803e+00 -5.7371e+00
-Branch(Tip) 1.5 : -102.436243 2.3477e+00 -3.4138e+00
-Branch(Tip) 5.0 : -104.017665 1.6578e-02 -2.1989e-02
-Branch(Tip) 10.0 : -104.030262 2.4924e-05 -3.2141e-05
-Branch(Tip) 50.0 : -104.030281 2.7346e-15 -1.5841e-27
-Branch(Tip) 90.0 : -104.030281 2.7346e-15 -1.9386e-32
+Branch(Tip) 0.1 : -95.654016 -2.4563e+00 7.5478e+01
+Branch(Tip) 0.2 : -95.783099 3.0026e+00 1.8232e+01
+Branch(Tip) 0.5 : -97.748757 4.9821e+00 -1.0177e+00
+Branch(Tip) 0.9 : -100.251762 3.6262e+00 -2.8112e+00
+Branch(Tip) 1.5 : -102.436243 1.6434e+00 -1.6728e+00
+Branch(Tip) 5.0 : -104.017665 1.1604e-02 -1.0775e-02
+Branch(Tip) 10.0 : -104.030262 1.7447e-05 -1.5749e-05
+Branch(Tip) 50.0 : -104.030281 1.9142e-15 -7.7622e-28
+Branch(Tip) 90.0 : -104.030281 1.9142e-15 -9.4990e-33
Test -95.783099 = -95.783099
TEST alpha(ncats) = 0.75( 1) ; pinv = 0.60
1.000000
-Branch 0.1 : -105.234564 7.4230e+00 7.3740e+00
-Branch 0.2 : -105.979235 7.2309e+00 -7.5912e+00
-Branch 0.5 : -107.694200 4.1603e+00 -9.4659e+00
-Branch 0.9 : -108.763225 1.5595e+00 -3.9497e+00
-Branch 1.5 : -109.245342 3.4684e-01 -8.5204e-01
-Branch 5.0 : -109.389867 1.0493e-04 -2.3772e-04
-Branch 10.0 : -109.389914 1.3360e-09 -3.0041e-09
-Branch 50.0 : -109.389914 4.5326e-15 -1.8679e-32
-Branch 90.0 : -109.389914 4.5326e-15 -1.8679e-32
+Branch 0.1 : -105.234564 2.9692e+00 1.1798e+00
+Branch 0.2 : -105.979235 2.8923e+00 -1.2146e+00
+Branch 0.5 : -107.694200 1.6641e+00 -1.5145e+00
+Branch 0.9 : -108.763225 6.2380e-01 -6.3195e-01
+Branch 1.5 : -109.245342 1.3874e-01 -1.3633e-01
+Branch 5.0 : -109.389867 4.1972e-05 -3.8035e-05
+Branch 10.0 : -109.389914 5.3442e-10 -4.8066e-10
+Branch 50.0 : -109.389914 1.8130e-15 -2.9886e-33
+Branch 90.0 : -109.389914 1.8130e-15 -2.9886e-33
Test -105.234564 = -105.234564
-Branch(Tip) 0.1 : -102.669187 5.5139e+00 1.1971e+02
-Branch(Tip) 0.2 : -103.565615 1.0804e+01 1.6052e+01
-Branch(Tip) 0.5 : -106.644437 8.3920e+00 -1.5588e+01
-Branch(Tip) 0.9 : -108.893328 3.3646e+00 -8.5057e+00
-Branch(Tip) 1.5 : -109.923941 7.2417e-01 -1.8259e+00
-Branch(Tip) 5.0 : -110.220389 2.1206e-04 -4.7948e-04
-Branch(Tip) 10.0 : -110.220483 2.7300e-09 -6.1364e-09
-Branch(Tip) 50.0 : -110.220483 4.5345e-15 -1.9223e-32
-Branch(Tip) 90.0 : -110.220483 4.5345e-15 -1.9223e-32
+Branch(Tip) 0.1 : -102.669187 2.2056e+00 1.9154e+01
+Branch(Tip) 0.2 : -103.565615 4.3216e+00 2.5684e+00
+Branch(Tip) 0.5 : -106.644437 3.3568e+00 -2.4941e+00
+Branch(Tip) 0.9 : -108.893328 1.3459e+00 -1.3609e+00
+Branch(Tip) 1.5 : -109.923941 2.8967e-01 -2.9214e-01
+Branch(Tip) 5.0 : -110.220389 8.4824e-05 -7.6716e-05
+Branch(Tip) 10.0 : -110.220483 1.0920e-09 -9.8183e-10
+Branch(Tip) 50.0 : -110.220483 1.8138e-15 -3.0757e-33
+Branch(Tip) 90.0 : -110.220483 1.8138e-15 -3.0757e-33
Test -103.565615 = -103.565615
TEST alpha(ncats) = 0.75( 1) ; pinv = 0.90
1.000000
-Branch 0.1 : -135.403784 1.3449e+00 -1.2487e+01
-Branch 0.2 : -135.491444 5.3257e-01 -4.9217e+00
-Branch 0.5 : -135.545622 3.3897e-02 -3.0954e-01
-Branch 0.9 : -135.549245 8.9286e-04 -8.0898e-03
-Branch 1.5 : -135.549343 3.9519e-06 -3.5623e-05
-Branch 5.0 : -135.549344 1.7868e-14 -7.7070e-19
-Branch 10.0 : -135.549344 1.7868e-14 -2.0525e-32
-Branch 50.0 : -135.549344 1.7868e-14 -2.0525e-32
-Branch 90.0 : -135.549344 1.7868e-14 -2.0525e-32
+Branch 0.1 : -135.403784 1.3449e-01 -1.2487e-01
+Branch 0.2 : -135.491444 5.3257e-02 -4.9217e-02
+Branch 0.5 : -135.545622 3.3897e-03 -3.0954e-03
+Branch 0.9 : -135.549245 8.9286e-05 -8.0898e-05
+Branch 1.5 : -135.549343 3.9519e-07 -3.5623e-07
+Branch 5.0 : -135.549344 1.7868e-15 -7.7070e-21
+Branch 10.0 : -135.549344 1.7868e-15 -2.0525e-34
+Branch 50.0 : -135.549344 1.7868e-15 -2.0525e-34
+Branch 90.0 : -135.549344 1.7868e-15 -2.0525e-34
Test -135.403784 = -135.403784
-Branch(Tip) 0.1 : -133.446326 2.1381e+01 -1.9967e+02
-Branch(Tip) 0.2 : -134.810864 7.9184e+00 -8.0598e+01
-Branch(Tip) 0.5 : -135.561972 4.1872e-01 -3.9416e+00
-Branch(Tip) 0.9 : -135.605905 1.0538e-02 -9.5817e-02
-Branch(Tip) 1.5 : -135.607062 4.6350e-05 -4.1792e-04
-Branch(Tip) 5.0 : -135.607067 1.7869e-14 -9.0274e-18
-Branch(Tip) 10.0 : -135.607067 1.7868e-14 -2.0531e-32
-Branch(Tip) 50.0 : -135.607067 1.7868e-14 -2.0531e-32
-Branch(Tip) 90.0 : -135.607067 1.7868e-14 -2.0531e-32
+Branch(Tip) 0.1 : -133.446326 2.1381e+00 -1.9967e+00
+Branch(Tip) 0.2 : -134.810864 7.9184e-01 -8.0598e-01
+Branch(Tip) 0.5 : -135.561972 4.1872e-02 -3.9416e-02
+Branch(Tip) 0.9 : -135.605905 1.0538e-03 -9.5817e-04
+Branch(Tip) 1.5 : -135.607062 4.6350e-06 -4.1792e-06
+Branch(Tip) 5.0 : -135.607067 1.7869e-15 -9.0274e-20
+Branch(Tip) 10.0 : -135.607067 1.7868e-15 -2.0531e-34
+Branch(Tip) 50.0 : -135.607067 1.7868e-15 -2.0531e-34
+Branch(Tip) 90.0 : -135.607067 1.7868e-15 -2.0531e-34
Test -134.810864 = -134.810864
@@ -229,75 +229,75 @@ Test -93.655614 = -93.655614
TEST alpha(ncats) = 1.50( 1) ; pinv = 0.30
1.000000
-Branch 0.1 : -96.794137 2.8357e+00 3.9279e+01
-Branch 0.2 : -97.202283 4.8421e+00 8.5988e+00
-Branch 0.5 : -98.720974 4.7313e+00 -4.0098e+00
-Branch 0.9 : -100.264298 2.9979e+00 -3.9846e+00
-Branch 1.5 : -101.478774 1.2639e+00 -1.8916e+00
-Branch 5.0 : -102.332278 9.2874e-03 -1.2299e-02
-Branch 10.0 : -102.339336 1.3871e-05 -1.7909e-05
-Branch 50.0 : -102.339347 2.7270e-15 -8.7487e-28
-Branch 90.0 : -102.339347 2.7270e-15 -1.8285e-32
+Branch 0.1 : -96.794137 1.9850e+00 1.9247e+01
+Branch 0.2 : -97.202283 3.3895e+00 4.2134e+00
+Branch 0.5 : -98.720974 3.3119e+00 -1.9648e+00
+Branch 0.9 : -100.264298 2.0985e+00 -1.9525e+00
+Branch 1.5 : -101.478774 8.8475e-01 -9.2688e-01
+Branch 5.0 : -102.332278 6.5012e-03 -6.0266e-03
+Branch 10.0 : -102.339336 9.7096e-06 -8.7755e-06
+Branch 50.0 : -102.339347 1.9089e-15 -4.2869e-28
+Branch 90.0 : -102.339347 1.9089e-15 -8.9598e-33
Test -96.794137 = -96.794137
-Branch(Tip) 0.1 : -95.654016 -3.5089e+00 1.5404e+02
-Branch(Tip) 0.2 : -95.783099 4.2894e+00 3.7207e+01
-Branch(Tip) 0.5 : -97.748757 7.1172e+00 -2.0770e+00
-Branch(Tip) 0.9 : -100.251762 5.1803e+00 -5.7371e+00
-Branch(Tip) 1.5 : -102.436243 2.3477e+00 -3.4138e+00
-Branch(Tip) 5.0 : -104.017665 1.6578e-02 -2.1989e-02
-Branch(Tip) 10.0 : -104.030262 2.4924e-05 -3.2141e-05
-Branch(Tip) 50.0 : -104.030281 2.7346e-15 -1.5841e-27
-Branch(Tip) 90.0 : -104.030281 2.7346e-15 -1.9386e-32
+Branch(Tip) 0.1 : -95.654016 -2.4563e+00 7.5478e+01
+Branch(Tip) 0.2 : -95.783099 3.0026e+00 1.8232e+01
+Branch(Tip) 0.5 : -97.748757 4.9821e+00 -1.0177e+00
+Branch(Tip) 0.9 : -100.251762 3.6262e+00 -2.8112e+00
+Branch(Tip) 1.5 : -102.436243 1.6434e+00 -1.6728e+00
+Branch(Tip) 5.0 : -104.017665 1.1604e-02 -1.0775e-02
+Branch(Tip) 10.0 : -104.030262 1.7447e-05 -1.5749e-05
+Branch(Tip) 50.0 : -104.030281 1.9142e-15 -7.7622e-28
+Branch(Tip) 90.0 : -104.030281 1.9142e-15 -9.4990e-33
Test -95.783099 = -95.783099
TEST alpha(ncats) = 1.50( 1) ; pinv = 0.60
1.000000
-Branch 0.1 : -105.234564 7.4230e+00 7.3740e+00
-Branch 0.2 : -105.979235 7.2309e+00 -7.5912e+00
-Branch 0.5 : -107.694200 4.1603e+00 -9.4659e+00
-Branch 0.9 : -108.763225 1.5595e+00 -3.9497e+00
-Branch 1.5 : -109.245342 3.4684e-01 -8.5204e-01
-Branch 5.0 : -109.389867 1.0493e-04 -2.3772e-04
-Branch 10.0 : -109.389914 1.3360e-09 -3.0041e-09
-Branch 50.0 : -109.389914 4.5326e-15 -1.8679e-32
-Branch 90.0 : -109.389914 4.5326e-15 -1.8679e-32
+Branch 0.1 : -105.234564 2.9692e+00 1.1798e+00
+Branch 0.2 : -105.979235 2.8923e+00 -1.2146e+00
+Branch 0.5 : -107.694200 1.6641e+00 -1.5145e+00
+Branch 0.9 : -108.763225 6.2380e-01 -6.3195e-01
+Branch 1.5 : -109.245342 1.3874e-01 -1.3633e-01
+Branch 5.0 : -109.389867 4.1972e-05 -3.8035e-05
+Branch 10.0 : -109.389914 5.3442e-10 -4.8066e-10
+Branch 50.0 : -109.389914 1.8130e-15 -2.9886e-33
+Branch 90.0 : -109.389914 1.8130e-15 -2.9886e-33
Test -105.234564 = -105.234564
-Branch(Tip) 0.1 : -102.669187 5.5139e+00 1.1971e+02
-Branch(Tip) 0.2 : -103.565615 1.0804e+01 1.6052e+01
-Branch(Tip) 0.5 : -106.644437 8.3920e+00 -1.5588e+01
-Branch(Tip) 0.9 : -108.893328 3.3646e+00 -8.5057e+00
-Branch(Tip) 1.5 : -109.923941 7.2417e-01 -1.8259e+00
-Branch(Tip) 5.0 : -110.220389 2.1206e-04 -4.7948e-04
-Branch(Tip) 10.0 : -110.220483 2.7300e-09 -6.1364e-09
-Branch(Tip) 50.0 : -110.220483 4.5345e-15 -1.9223e-32
-Branch(Tip) 90.0 : -110.220483 4.5345e-15 -1.9223e-32
+Branch(Tip) 0.1 : -102.669187 2.2056e+00 1.9154e+01
+Branch(Tip) 0.2 : -103.565615 4.3216e+00 2.5684e+00
+Branch(Tip) 0.5 : -106.644437 3.3568e+00 -2.4941e+00
+Branch(Tip) 0.9 : -108.893328 1.3459e+00 -1.3609e+00
+Branch(Tip) 1.5 : -109.923941 2.8967e-01 -2.9214e-01
+Branch(Tip) 5.0 : -110.220389 8.4824e-05 -7.6716e-05
+Branch(Tip) 10.0 : -110.220483 1.0920e-09 -9.8183e-10
+Branch(Tip) 50.0 : -110.220483 1.8138e-15 -3.0757e-33
+Branch(Tip) 90.0 : -110.220483 1.8138e-15 -3.0757e-33
Test -103.565615 = -103.565615
TEST alpha(ncats) = 1.50( 1) ; pinv = 0.90
1.000000
-Branch 0.1 : -135.403784 1.3449e+00 -1.2487e+01
-Branch 0.2 : -135.491444 5.3257e-01 -4.9217e+00
-Branch 0.5 : -135.545622 3.3897e-02 -3.0954e-01
-Branch 0.9 : -135.549245 8.9286e-04 -8.0898e-03
-Branch 1.5 : -135.549343 3.9519e-06 -3.5623e-05
-Branch 5.0 : -135.549344 1.7868e-14 -7.7070e-19
-Branch 10.0 : -135.549344 1.7868e-14 -2.0525e-32
-Branch 50.0 : -135.549344 1.7868e-14 -2.0525e-32
-Branch 90.0 : -135.549344 1.7868e-14 -2.0525e-32
+Branch 0.1 : -135.403784 1.3449e-01 -1.2487e-01
+Branch 0.2 : -135.491444 5.3257e-02 -4.9217e-02
+Branch 0.5 : -135.545622 3.3897e-03 -3.0954e-03
+Branch 0.9 : -135.549245 8.9286e-05 -8.0898e-05
+Branch 1.5 : -135.549343 3.9519e-07 -3.5623e-07
+Branch 5.0 : -135.549344 1.7868e-15 -7.7070e-21
+Branch 10.0 : -135.549344 1.7868e-15 -2.0525e-34
+Branch 50.0 : -135.549344 1.7868e-15 -2.0525e-34
+Branch 90.0 : -135.549344 1.7868e-15 -2.0525e-34
Test -135.403784 = -135.403784
-Branch(Tip) 0.1 : -133.446326 2.1381e+01 -1.9967e+02
-Branch(Tip) 0.2 : -134.810864 7.9184e+00 -8.0598e+01
-Branch(Tip) 0.5 : -135.561972 4.1872e-01 -3.9416e+00
-Branch(Tip) 0.9 : -135.605905 1.0538e-02 -9.5817e-02
-Branch(Tip) 1.5 : -135.607062 4.6350e-05 -4.1792e-04
-Branch(Tip) 5.0 : -135.607067 1.7869e-14 -9.0274e-18
-Branch(Tip) 10.0 : -135.607067 1.7868e-14 -2.0531e-32
-Branch(Tip) 50.0 : -135.607067 1.7868e-14 -2.0531e-32
-Branch(Tip) 90.0 : -135.607067 1.7868e-14 -2.0531e-32
+Branch(Tip) 0.1 : -133.446326 2.1381e+00 -1.9967e+00
+Branch(Tip) 0.2 : -134.810864 7.9184e-01 -8.0598e-01
+Branch(Tip) 0.5 : -135.561972 4.1872e-02 -3.9416e-02
+Branch(Tip) 0.9 : -135.605905 1.0538e-03 -9.5817e-04
+Branch(Tip) 1.5 : -135.607062 4.6350e-06 -4.1792e-06
+Branch(Tip) 5.0 : -135.607067 1.7869e-15 -9.0274e-20
+Branch(Tip) 10.0 : -135.607067 1.7868e-15 -2.0531e-34
+Branch(Tip) 50.0 : -135.607067 1.7868e-15 -2.0531e-34
+Branch(Tip) 90.0 : -135.607067 1.7868e-15 -2.0531e-34
Test -134.810864 = -134.810864
FREE CREATE
@@ -330,75 +330,75 @@ Test -96.546275 = -96.546275
TEST alpha(ncats) = 0.10( 2) ; pinv = 0.30
0.000539 1.999461
-Branch 0.1 : -104.028021 6.6607e+00 1.7185e-01
-Branch 0.2 : -104.669621 6.0011e+00 -1.0483e+01
-Branch 0.5 : -105.969457 2.8206e+00 -8.2753e+00
-Branch 0.9 : -106.623417 8.3034e-01 -2.5586e+00
-Branch 1.5 : -106.851604 1.3285e-01 -4.1152e-01
-Branch 5.0 : -106.858064 -1.3072e-02 2.2178e-04
-Branch 10.0 : -106.795734 -1.1879e-02 2.2333e-04
-Branch 50.0 : -106.449212 -6.3222e-03 8.6172e-05
-Branch 90.0 : -106.251496 -3.8341e-03 4.4771e-05
+Branch 0.1 : -104.028021 4.6625e+00 8.4205e-02
+Branch 0.2 : -104.669621 4.2008e+00 -5.1365e+00
+Branch 0.5 : -105.969457 1.9744e+00 -4.0549e+00
+Branch 0.9 : -106.623417 5.8124e-01 -1.2537e+00
+Branch 1.5 : -106.851604 9.2994e-02 -2.0165e-01
+Branch 5.0 : -106.858064 -9.1501e-03 1.0867e-04
+Branch 10.0 : -106.795734 -8.3153e-03 1.0943e-04
+Branch 50.0 : -106.449212 -4.4255e-03 4.2224e-05
+Branch 90.0 : -106.251496 -2.6839e-03 2.1938e-05
Test -104.028021 = -104.028021
-Branch(Tip) 0.1 : -101.414509 6.6266e+00 1.0706e+02
-Branch(Tip) 0.2 : -102.372106 1.0992e+01 8.5464e+00
-Branch(Tip) 0.5 : -105.254140 7.1719e+00 -1.7513e+01
-Branch(Tip) 0.9 : -106.998735 2.2876e+00 -7.0136e+00
-Branch(Tip) 1.5 : -107.622175 3.5127e-01 -1.1327e+00
-Branch(Tip) 5.0 : -107.615865 -3.9455e-02 1.7218e-03
-Branch(Tip) 10.0 : -107.438408 -3.1980e-02 1.2381e-03
-Branch(Tip) 50.0 : -106.687318 -1.1457e-02 2.1203e-04
-Branch(Tip) 90.0 : -106.352023 -6.1301e-03 8.3405e-05
+Branch(Tip) 0.1 : -101.414509 4.6386e+00 5.2460e+01
+Branch(Tip) 0.2 : -102.372106 7.6941e+00 4.1877e+00
+Branch(Tip) 0.5 : -105.254140 5.0203e+00 -8.5815e+00
+Branch(Tip) 0.9 : -106.998735 1.6014e+00 -3.4367e+00
+Branch(Tip) 1.5 : -107.622175 2.4589e-01 -5.5503e-01
+Branch(Tip) 5.0 : -107.615865 -2.7618e-02 8.4367e-04
+Branch(Tip) 10.0 : -107.438408 -2.2386e-02 6.0668e-04
+Branch(Tip) 50.0 : -106.687318 -8.0197e-03 1.0390e-04
+Branch(Tip) 90.0 : -106.352023 -4.2911e-03 4.0868e-05
Test -102.372106 = -102.372106
TEST alpha(ncats) = 0.10( 2) ; pinv = 0.60
0.000539 1.999461
-Branch 0.1 : -116.056752 5.5658e+00 -2.6259e+01
-Branch 0.2 : -116.496758 3.3827e+00 -1.7461e+01
-Branch 0.5 : -117.006458 6.8532e-01 -3.7320e+00
-Branch 0.9 : -117.112701 4.6160e-02 -5.0837e-01
-Branch 1.5 : -117.097650 -5.3814e-02 -2.7404e-02
-Branch 5.0 : -116.908900 -4.8778e-02 2.7931e-03
-Branch 10.0 : -116.694771 -3.7738e-02 1.7453e-03
-Branch 50.0 : -115.871630 -1.1732e-02 2.4053e-04
-Branch 90.0 : -115.538765 -5.8782e-03 8.8466e-05
+Branch 0.1 : -116.056752 2.2263e+00 -4.2014e+00
+Branch 0.2 : -116.496758 1.3531e+00 -2.7937e+00
+Branch 0.5 : -117.006458 2.7413e-01 -5.9712e-01
+Branch 0.9 : -117.112701 1.8464e-02 -8.1339e-02
+Branch 1.5 : -117.097650 -2.1525e-02 -4.3846e-03
+Branch 5.0 : -116.908900 -1.9511e-02 4.4690e-04
+Branch 10.0 : -116.694771 -1.5095e-02 2.7924e-04
+Branch 50.0 : -115.871630 -4.6929e-03 3.8484e-05
+Branch 90.0 : -115.538765 -2.3513e-03 1.4155e-05
Test -116.056752 = -116.056752
-Branch(Tip) 0.1 : -112.753719 1.8118e+01 -3.9730e+00
-Branch(Tip) 0.2 : -114.413757 1.4334e+01 -5.2523e+01
-Branch(Tip) 0.5 : -116.743003 3.1622e+00 -1.8280e+01
-Branch(Tip) 0.9 : -117.201888 1.3564e-01 -2.1762e+00
-Branch(Tip) 1.5 : -117.112107 -2.4976e-01 -4.9737e-02
-Branch(Tip) 5.0 : -116.446013 -1.3780e-01 2.0146e-02
-Branch(Tip) 10.0 : -115.930355 -7.8896e-02 6.8889e-03
-Branch(Tip) 50.0 : -114.628732 -1.5248e-02 3.6523e-04
-Branch(Tip) 90.0 : -114.214077 -7.0537e-03 1.1421e-04
+Branch(Tip) 0.1 : -112.753719 7.2471e+00 -6.3568e-01
+Branch(Tip) 0.2 : -114.413757 5.7337e+00 -8.4037e+00
+Branch(Tip) 0.5 : -116.743003 1.2649e+00 -2.9248e+00
+Branch(Tip) 0.9 : -117.201888 5.4257e-02 -3.4819e-01
+Branch(Tip) 1.5 : -117.112107 -9.9905e-02 -7.9579e-03
+Branch(Tip) 5.0 : -116.446013 -5.5121e-02 3.2233e-03
+Branch(Tip) 10.0 : -115.930355 -3.1559e-02 1.1022e-03
+Branch(Tip) 50.0 : -114.628732 -6.0992e-03 5.8436e-05
+Branch(Tip) 90.0 : -114.214077 -2.8215e-03 1.8274e-05
Test -114.413757 = -114.413757
TEST alpha(ncats) = 0.10( 2) ; pinv = 0.90
0.000539 1.999461
-Branch 0.1 : -138.922967 -4.2185e-01 -3.0043e-02
-Branch 0.2 : -138.881073 -4.1324e-01 1.4719e-01
-Branch 0.5 : -138.764274 -3.6606e-01 1.4536e-01
-Branch 0.9 : -138.628426 -3.1557e-01 1.0953e-01
-Branch 1.5 : -138.456525 -2.6075e-01 7.6217e-02
-Branch 5.0 : -137.833853 -1.2521e-01 1.9661e-02
-Branch 10.0 : -137.377308 -6.7582e-02 6.7467e-03
-Branch 50.0 : -136.469697 -6.5004e-03 3.1631e-04
-Branch 90.0 : -136.368214 -8.8157e-05 7.3585e-05
+Branch 0.1 : -138.922967 -4.2185e-02 -3.0043e-04
+Branch 0.2 : -138.881073 -4.1324e-02 1.4719e-03
+Branch 0.5 : -138.764274 -3.6606e-02 1.4536e-03
+Branch 0.9 : -138.628426 -3.1557e-02 1.0953e-03
+Branch 1.5 : -138.456525 -2.6075e-02 7.6217e-04
+Branch 5.0 : -137.833853 -1.2521e-02 1.9661e-04
+Branch 10.0 : -137.377308 -6.7582e-03 6.7467e-05
+Branch 50.0 : -136.469697 -6.5004e-04 3.1631e-06
+Branch 90.0 : -136.368214 -8.8157e-06 7.3585e-07
Test -138.922967 = -138.922967
-Branch(Tip) 0.1 : -138.945270 1.7078e+00 -8.5463e+01
-Branch(Tip) 0.2 : -138.889758 -1.6108e+00 -7.3287e+00
-Branch(Tip) 0.5 : -138.406505 -1.3412e+00 1.7936e+00
-Branch(Tip) 0.9 : -137.978373 -8.6615e-01 7.7402e-01
-Branch(Tip) 1.5 : -137.562681 -5.6219e-01 3.3155e-01
-Branch(Tip) 5.0 : -136.506438 -1.7747e-01 3.6421e-02
-Branch(Tip) 10.0 : -135.903023 -8.4426e-02 9.4976e-03
-Branch(Tip) 50.0 : -134.808019 -8.3400e-03 3.5670e-04
-Branch(Tip) 90.0 : -134.654702 -9.9624e-04 8.8210e-05
+Branch(Tip) 0.1 : -138.945270 1.7078e-01 -8.5463e-01
+Branch(Tip) 0.2 : -138.889758 -1.6108e-01 -7.3287e-02
+Branch(Tip) 0.5 : -138.406505 -1.3412e-01 1.7936e-02
+Branch(Tip) 0.9 : -137.978373 -8.6615e-02 7.7402e-03
+Branch(Tip) 1.5 : -137.562681 -5.6219e-02 3.3155e-03
+Branch(Tip) 5.0 : -136.506438 -1.7747e-02 3.6421e-04
+Branch(Tip) 10.0 : -135.903023 -8.4426e-03 9.4976e-05
+Branch(Tip) 50.0 : -134.808019 -8.3400e-04 3.5670e-06
+Branch(Tip) 90.0 : -134.654702 -9.9624e-05 8.8210e-07
Test -138.889758 = -138.889758
@@ -430,75 +430,75 @@ Test -94.102420 = -94.102420
TEST alpha(ncats) = 0.75( 2) ; pinv = 0.30
0.235541 1.764459
-Branch 0.1 : -98.486511 4.8245e-01 3.4746e+01
-Branch 0.2 : -98.640616 2.1537e+00 6.4052e+00
-Branch 0.5 : -99.337167 2.1576e+00 -1.8154e+00
-Branch 0.9 : -100.070291 1.5624e+00 -1.0777e+00
-Branch 1.5 : -100.862467 1.1369e+00 -4.7410e-01
-Branch 5.0 : -103.116309 3.1288e-01 -1.2366e-01
-Branch 10.0 : -103.793412 4.3152e-02 -1.6509e-02
-Branch 50.0 : -103.912378 1.1868e-07 -3.6188e-08
-Branch 90.0 : -103.912378 6.3981e-13 -1.9268e-13
+Branch 0.1 : -98.486511 3.3771e-01 1.7026e+01
+Branch 0.2 : -98.640616 1.5076e+00 3.1386e+00
+Branch 0.5 : -99.337167 1.5103e+00 -8.8956e-01
+Branch 0.9 : -100.070291 1.0937e+00 -5.2807e-01
+Branch 1.5 : -100.862467 7.9584e-01 -2.3231e-01
+Branch 5.0 : -103.116309 2.1901e-01 -6.0592e-02
+Branch 10.0 : -103.793412 3.0206e-02 -8.0893e-03
+Branch 50.0 : -103.912378 8.3078e-08 -1.7732e-08
+Branch 90.0 : -103.912378 4.4787e-13 -9.4411e-14
Test -98.486511 = -98.486511
-Branch(Tip) 0.1 : -97.255797 -1.8060e+00 1.3412e+02
-Branch(Tip) 0.2 : -97.473190 4.4631e+00 2.4541e+01
-Branch(Tip) 0.5 : -99.056197 4.8085e+00 -6.3669e+00
-Branch(Tip) 0.9 : -100.506147 2.6438e+00 -3.7306e+00
-Branch(Tip) 1.5 : -101.645762 1.4201e+00 -1.0057e+00
-Branch(Tip) 5.0 : -104.177195 3.4861e-01 -1.3142e-01
-Branch(Tip) 10.0 : -104.961981 5.4128e-02 -1.9468e-02
-Branch(Tip) 50.0 : -105.119351 1.9432e-07 -5.8945e-08
-Branch(Tip) 90.0 : -105.119352 1.0745e-12 -3.2395e-13
+Branch(Tip) 0.1 : -97.255797 -1.2642e+00 6.5717e+01
+Branch(Tip) 0.2 : -97.473190 3.1241e+00 1.2025e+01
+Branch(Tip) 0.5 : -99.056197 3.3659e+00 -3.1198e+00
+Branch(Tip) 0.9 : -100.506147 1.8507e+00 -1.8280e+00
+Branch(Tip) 1.5 : -101.645762 9.9407e-01 -4.9280e-01
+Branch(Tip) 5.0 : -104.177195 2.4402e-01 -6.4395e-02
+Branch(Tip) 10.0 : -104.961981 3.7890e-02 -9.5395e-03
+Branch(Tip) 50.0 : -105.119351 1.3603e-07 -2.8883e-08
+Branch(Tip) 90.0 : -105.119352 7.5213e-13 -1.5874e-13
Test -97.473190 = -97.473190
TEST alpha(ncats) = 0.75( 2) ; pinv = 0.60
0.235541 1.764459
-Branch 0.1 : -105.546124 -6.4556e-02 2.9400e+01
-Branch 0.2 : -105.632352 1.4327e+00 6.7475e+00
-Branch 0.5 : -106.172912 1.8796e+00 -3.0304e-01
-Branch 0.9 : -106.884937 1.6628e+00 -6.2449e-01
-Branch 1.5 : -107.768071 1.2805e+00 -6.3045e-01
-Branch 5.0 : -109.658848 1.4091e-01 -9.2852e-02
-Branch 10.0 : -109.870983 6.5645e-03 -3.7782e-03
-Branch 50.0 : -109.882647 3.1701e-12 -1.6762e-12
-Branch 90.0 : -109.882647 4.5832e-15 -1.0767e-21
+Branch 0.1 : -105.546124 -2.5822e-02 4.7039e+00
+Branch 0.2 : -105.632352 5.7309e-01 1.0796e+00
+Branch 0.5 : -106.172912 7.5185e-01 -4.8487e-02
+Branch 0.9 : -106.884937 6.6512e-01 -9.9919e-02
+Branch 1.5 : -107.768071 5.1218e-01 -1.0087e-01
+Branch 5.0 : -109.658848 5.6365e-02 -1.4856e-02
+Branch 10.0 : -109.870983 2.6258e-03 -6.0452e-04
+Branch 50.0 : -109.882647 1.2680e-12 -2.6819e-13
+Branch 90.0 : -109.882647 1.8333e-15 -1.7228e-22
Test -105.546124 = -105.546124
-Branch(Tip) 0.1 : -104.049259 2.1451e+00 9.3439e+01
-Branch(Tip) 0.2 : -104.498289 5.4530e+00 3.0930e+00
-Branch(Tip) 0.5 : -105.860021 3.4158e+00 -6.0153e+00
-Branch(Tip) 0.9 : -106.910923 2.1223e+00 -1.6248e+00
-Branch(Tip) 1.5 : -107.972545 1.4906e+00 -7.9327e-01
-Branch(Tip) 5.0 : -110.193971 1.7794e-01 -1.1061e-01
-Branch(Tip) 10.0 : -110.473947 9.4199e-03 -5.2756e-03
-Branch(Tip) 50.0 : -110.491054 5.1759e-12 -2.7366e-12
-Branch(Tip) 90.0 : -110.491054 4.8514e-15 -1.7647e-21
+Branch(Tip) 0.1 : -104.049259 8.5805e-01 1.4950e+01
+Branch(Tip) 0.2 : -104.498289 2.1812e+00 4.9487e-01
+Branch(Tip) 0.5 : -105.860021 1.3663e+00 -9.6245e-01
+Branch(Tip) 0.9 : -106.910923 8.4893e-01 -2.5996e-01
+Branch(Tip) 1.5 : -107.972545 5.9625e-01 -1.2692e-01
+Branch(Tip) 5.0 : -110.193971 7.1176e-02 -1.7697e-02
+Branch(Tip) 10.0 : -110.473947 3.7680e-03 -8.4410e-04
+Branch(Tip) 50.0 : -110.491054 2.0703e-12 -4.3785e-13
+Branch(Tip) 90.0 : -110.491054 1.9405e-15 -2.8235e-22
Test -104.498289 = -104.498289
TEST alpha(ncats) = 0.75( 2) ; pinv = 0.90
0.235541 1.764459
-Branch 0.1 : -127.711862 5.8250e+00 1.5526e+00
-Branch 0.2 : -128.284014 5.4887e+00 -6.4615e+00
-Branch 0.5 : -129.580571 3.1572e+00 -7.0200e+00
-Branch 0.9 : -130.400475 1.2155e+00 -2.9903e+00
-Branch 1.5 : -130.782605 2.8277e-01 -6.7221e-01
-Branch 5.0 : -130.905044 1.2494e-04 -2.6776e-04
-Branch 10.0 : -130.905103 2.9893e-09 -6.3378e-09
-Branch 50.0 : -130.905103 1.4717e-14 -1.0960e-29
-Branch 90.0 : -130.905103 1.4717e-14 -1.0960e-29
+Branch 0.1 : -127.711862 5.8250e-01 1.5526e-02
+Branch 0.2 : -128.284014 5.4887e-01 -6.4615e-02
+Branch 0.5 : -129.580571 3.1572e-01 -7.0200e-02
+Branch 0.9 : -130.400475 1.2155e-01 -2.9903e-02
+Branch 1.5 : -130.782605 2.8277e-02 -6.7221e-03
+Branch 5.0 : -130.905044 1.2494e-05 -2.6776e-06
+Branch 10.0 : -130.905103 2.9893e-10 -6.3378e-11
+Branch 50.0 : -130.905103 1.4717e-15 -1.0960e-31
+Branch 90.0 : -130.905103 1.4717e-15 -1.0960e-31
Test -127.711862 = -127.711862
-Branch(Tip) 0.1 : -125.625053 7.1383e+00 3.3377e+01
-Branch(Tip) 0.2 : -126.418512 8.1985e+00 -1.4585e+00
-Branch(Tip) 0.5 : -128.519703 5.4130e+00 -1.0973e+01
-Branch(Tip) 0.9 : -129.954960 2.1623e+00 -5.2454e+00
-Branch(Tip) 1.5 : -130.637596 5.0648e-01 -1.2030e+00
-Branch(Tip) 5.0 : -130.857400 2.3257e-04 -4.9594e-04
-Branch(Tip) 10.0 : -130.857509 5.7147e-09 -1.2105e-08
-Branch(Tip) 50.0 : -130.857509 1.5508e-14 -1.0707e-29
-Branch(Tip) 90.0 : -130.857509 1.5508e-14 -1.0707e-29
+Branch(Tip) 0.1 : -125.625053 7.1383e-01 3.3377e-01
+Branch(Tip) 0.2 : -126.418512 8.1985e-01 -1.4585e-02
+Branch(Tip) 0.5 : -128.519703 5.4130e-01 -1.0973e-01
+Branch(Tip) 0.9 : -129.954960 2.1623e-01 -5.2454e-02
+Branch(Tip) 1.5 : -130.637596 5.0648e-02 -1.2030e-02
+Branch(Tip) 5.0 : -130.857400 2.3257e-05 -4.9594e-06
+Branch(Tip) 10.0 : -130.857509 5.7147e-10 -1.2105e-10
+Branch(Tip) 50.0 : -130.857509 1.5508e-15 -1.0707e-31
+Branch(Tip) 90.0 : -130.857509 1.5508e-15 -1.0707e-31
Test -126.418512 = -126.418512
@@ -530,75 +530,75 @@ Test -93.657034 = -93.657034
TEST alpha(ncats) = 1.50( 2) ; pinv = 0.30
0.406939 1.593061
-Branch 0.1 : -97.458253 1.0094e+00 3.9392e+01
-Branch 0.2 : -97.682421 2.9865e+00 8.4257e+00
-Branch 0.5 : -98.673831 3.1820e+00 -2.0474e+00
-Branch 0.9 : -99.774905 2.3443e+00 -1.8465e+00
-Branch 1.5 : -100.902894 1.4925e+00 -1.0771e+00
-Branch 5.0 : -102.853358 1.3384e-01 -8.8753e-02
-Branch 10.0 : -103.054876 6.3138e-03 -3.6003e-03
-Branch 50.0 : -103.066215 3.9715e-12 -2.0748e-12
-Branch 90.0 : -103.066215 2.8660e-15 -1.7451e-21
+Branch 0.1 : -97.458253 7.0661e-01 1.9302e+01
+Branch 0.2 : -97.682421 2.0905e+00 4.1286e+00
+Branch 0.5 : -98.673831 2.2274e+00 -1.0032e+00
+Branch 0.9 : -99.774905 1.6410e+00 -9.0480e-01
+Branch 1.5 : -100.902894 1.0448e+00 -5.2778e-01
+Branch 5.0 : -102.853358 9.3689e-02 -4.3489e-02
+Branch 10.0 : -103.054876 4.4197e-03 -1.7641e-03
+Branch 50.0 : -103.066215 2.7800e-12 -1.0166e-12
+Branch 90.0 : -103.066215 2.0062e-15 -8.5509e-22
Test -97.458253 = -97.458253
-Branch(Tip) 0.1 : -96.346892 -2.9642e+00 1.4270e+02
-Branch(Tip) 0.2 : -96.484277 3.9772e+00 3.0230e+01
-Branch(Tip) 0.5 : -98.125627 5.5216e+00 -3.9416e+00
-Branch(Tip) 0.9 : -99.965847 3.7031e+00 -3.9814e+00
-Branch(Tip) 1.5 : -101.629904 2.0635e+00 -1.7892e+00
-Branch(Tip) 5.0 : -104.200538 1.8073e-01 -1.1504e-01
-Branch(Tip) 10.0 : -104.481673 9.3979e-03 -5.2393e-03
-Branch(Tip) 50.0 : -104.498869 6.6523e-12 -3.4742e-12
-Branch(Tip) 90.0 : -104.498869 2.9404e-15 -2.9335e-21
+Branch(Tip) 0.1 : -96.346892 -2.0750e+00 6.9924e+01
+Branch(Tip) 0.2 : -96.484277 2.7841e+00 1.4813e+01
+Branch(Tip) 0.5 : -98.125627 3.8651e+00 -1.9314e+00
+Branch(Tip) 0.9 : -99.965847 2.5922e+00 -1.9509e+00
+Branch(Tip) 1.5 : -101.629904 1.4445e+00 -8.7672e-01
+Branch(Tip) 5.0 : -104.200538 1.2651e-01 -5.6371e-02
+Branch(Tip) 10.0 : -104.481673 6.5785e-03 -2.5673e-03
+Branch(Tip) 50.0 : -104.498869 4.6566e-12 -1.7023e-12
+Branch(Tip) 90.0 : -104.498869 2.0583e-15 -1.4374e-21
Test -96.484277 = -96.484277
TEST alpha(ncats) = 1.50( 2) ; pinv = 0.60
0.406939 1.593061
-Branch 0.1 : -104.666269 2.3820e+00 2.4449e+01
-Branch 0.2 : -104.978193 3.5318e+00 3.9235e+00
-Branch 0.5 : -106.031272 3.2192e+00 -2.6178e+00
-Branch 0.9 : -107.112584 2.2182e+00 -2.2182e+00
-Branch 1.5 : -108.103381 1.1773e+00 -1.2947e+00
-Branch 5.0 : -109.136939 2.6548e-02 -2.6740e-02
-Branch 10.0 : -109.163764 2.2147e-04 -2.0658e-04
-Branch 50.0 : -109.164003 4.3398e-15 -2.4200e-20
-Branch 90.0 : -109.164003 4.3398e-15 -4.1262e-31
+Branch 0.1 : -104.666269 9.5280e-01 3.9119e+00
+Branch 0.2 : -104.978193 1.4127e+00 6.2776e-01
+Branch 0.5 : -106.031272 1.2877e+00 -4.1885e-01
+Branch 0.9 : -107.112584 8.8727e-01 -3.5491e-01
+Branch 1.5 : -108.103381 4.7091e-01 -2.0716e-01
+Branch 5.0 : -109.136939 1.0619e-02 -4.2784e-03
+Branch 10.0 : -109.163764 8.8586e-05 -3.3052e-05
+Branch 50.0 : -109.164003 1.7359e-15 -3.8721e-21
+Branch 90.0 : -109.164003 1.7359e-15 -6.6020e-32
Test -104.666269 = -104.666269
-Branch(Tip) 0.1 : -102.933684 2.2870e+00 1.0767e+02
-Branch(Tip) 0.2 : -103.457404 6.7047e+00 1.1304e+01
-Branch(Tip) 0.5 : -105.372444 5.3799e+00 -7.3177e+00
-Branch(Tip) 0.9 : -107.044353 3.2172e+00 -3.8377e+00
-Branch(Tip) 1.5 : -108.438083 1.6251e+00 -1.8132e+00
-Branch(Tip) 5.0 : -109.887296 3.9985e-02 -3.9494e-02
-Branch(Tip) 10.0 : -109.928350 3.5434e-04 -3.2781e-04
-Branch(Tip) 50.0 : -109.928734 4.5315e-15 -4.0723e-20
-Branch(Tip) 90.0 : -109.928734 4.5315e-15 -4.0693e-31
+Branch(Tip) 0.1 : -102.933684 9.1479e-01 1.7227e+01
+Branch(Tip) 0.2 : -103.457404 2.6819e+00 1.8086e+00
+Branch(Tip) 0.5 : -105.372444 2.1520e+00 -1.1708e+00
+Branch(Tip) 0.9 : -107.044353 1.2869e+00 -6.1404e-01
+Branch(Tip) 1.5 : -108.438083 6.5003e-01 -2.9012e-01
+Branch(Tip) 5.0 : -109.887296 1.5994e-02 -6.3191e-03
+Branch(Tip) 10.0 : -109.928350 1.4173e-04 -5.2449e-05
+Branch(Tip) 50.0 : -109.928734 1.8126e-15 -6.5157e-21
+Branch(Tip) 90.0 : -109.928734 1.8126e-15 -6.5109e-32
Test -103.457404 = -103.457404
TEST alpha(ncats) = 1.50( 2) ; pinv = 0.90
0.406939 1.593061
-Branch 0.1 : -131.758422 6.4067e+00 -2.2745e+01
-Branch 0.2 : -132.293924 4.3956e+00 -1.7280e+01
-Branch 0.5 : -133.057245 1.2912e+00 -5.3050e+00
-Branch 0.9 : -133.312463 2.5801e-01 -1.0167e+00
-Branch 1.5 : -133.372365 2.5573e-02 -9.6867e-02
-Branch 5.0 : -133.379168 6.1187e-08 -2.2432e-07
-Branch 10.0 : -133.379168 1.7019e-14 -2.5386e-15
-Branch 50.0 : -133.379168 1.6325e-14 -7.2149e-30
-Branch 90.0 : -133.379168 1.6325e-14 -7.2149e-30
+Branch 0.1 : -131.758422 6.4067e-01 -2.2745e-01
+Branch 0.2 : -132.293924 4.3956e-01 -1.7280e-01
+Branch 0.5 : -133.057245 1.2912e-01 -5.3050e-02
+Branch 0.9 : -133.312463 2.5801e-02 -1.0167e-02
+Branch 1.5 : -133.372365 2.5573e-03 -9.6867e-04
+Branch 5.0 : -133.379168 6.1187e-09 -2.2432e-09
+Branch 10.0 : -133.379168 1.7019e-15 -2.5386e-17
+Branch 50.0 : -133.379168 1.6325e-15 -7.2149e-32
+Branch 90.0 : -133.379168 1.6325e-15 -7.2149e-32
Test -131.758422 = -131.758422
-Branch(Tip) 0.1 : -128.963227 1.6159e+01 -4.3447e+01
-Branch(Tip) 0.2 : -130.354719 1.1717e+01 -4.1724e+01
-Branch(Tip) 0.5 : -132.433049 3.5230e+00 -1.4836e+01
-Branch(Tip) 0.9 : -133.116430 6.6890e-01 -2.7085e+00
-Branch(Tip) 1.5 : -133.269371 6.4084e-02 -2.4383e-01
-Branch(Tip) 5.0 : -133.286405 1.5741e-07 -5.7648e-07
-Branch(Tip) 10.0 : -133.286405 1.8257e-14 -6.5714e-15
-Branch(Tip) 50.0 : -133.286405 1.6460e-14 -7.0651e-30
-Branch(Tip) 90.0 : -133.286405 1.6460e-14 -7.0651e-30
+Branch(Tip) 0.1 : -128.963227 1.6159e+00 -4.3447e-01
+Branch(Tip) 0.2 : -130.354719 1.1717e+00 -4.1724e-01
+Branch(Tip) 0.5 : -132.433049 3.5230e-01 -1.4836e-01
+Branch(Tip) 0.9 : -133.116430 6.6890e-02 -2.7085e-02
+Branch(Tip) 1.5 : -133.269371 6.4084e-03 -2.4383e-03
+Branch(Tip) 5.0 : -133.286405 1.5741e-08 -5.7648e-09
+Branch(Tip) 10.0 : -133.286405 1.8257e-15 -6.5714e-17
+Branch(Tip) 50.0 : -133.286405 1.6460e-15 -7.0651e-32
+Branch(Tip) 90.0 : -133.286405 1.6460e-15 -7.0651e-32
Test -130.354719 = -130.354719
FREE CREATE
@@ -631,75 +631,75 @@ Test -103.284213 = -103.284213
TEST alpha(ncats) = 0.10( 4) ; pinv = 0.30
0.000001 0.001078 0.093753 3.905168
-Branch 0.1 : -109.836944 -1.4294e+00 1.1844e+01
-Branch 0.2 : -109.730508 -8.4554e-01 2.5400e+00
-Branch 0.5 : -109.532033 -5.4177e-01 7.1680e-01
-Branch 0.9 : -109.372263 -2.6477e-01 6.0842e-01
-Branch 1.5 : -109.301326 -4.3040e-03 2.8665e-01
-Branch 5.0 : -109.880356 1.9938e-01 -1.1098e-02
-Branch 10.0 : -110.662524 1.1091e-01 -1.6630e-02
-Branch 50.0 : -111.330836 2.3223e-04 -2.0200e-05
-Branch 90.0 : -111.338296 2.4770e-04 3.9842e-06
+Branch 0.1 : -109.836944 -1.0006e+00 5.8036e+00
+Branch 0.2 : -109.730508 -5.9188e-01 1.2446e+00
+Branch 0.5 : -109.532033 -3.7924e-01 3.5123e-01
+Branch 0.9 : -109.372263 -1.8534e-01 2.9812e-01
+Branch 1.5 : -109.301326 -3.0128e-03 1.4046e-01
+Branch 5.0 : -109.880356 1.3957e-01 -5.4382e-03
+Branch 10.0 : -110.662524 7.7637e-02 -8.1489e-03
+Branch 50.0 : -111.330836 1.6256e-04 -9.8979e-06
+Branch 90.0 : -111.338296 1.7339e-04 1.9522e-06
Test -109.836944 = -109.836944
-Branch(Tip) 0.1 : -108.155673 7.0938e+00 3.4567e+01
-Branch(Tip) 0.2 : -108.859844 6.0485e+00 -2.8432e+01
-Branch(Tip) 0.5 : -109.653060 5.2223e-01 -6.8569e+00
-Branch(Tip) 0.9 : -109.617433 -2.8538e-01 4.5548e-02
-Branch(Tip) 1.5 : -109.499575 -9.0994e-02 3.1791e-01
-Branch(Tip) 5.0 : -109.889394 1.6073e-01 -5.8617e-03
-Branch(Tip) 10.0 : -110.535690 9.3978e-02 -1.3080e-02
-Branch(Tip) 50.0 : -111.141086 -5.1909e-04 -3.0269e-05
-Branch(Tip) 90.0 : -111.119380 -3.8356e-04 9.4928e-06
+Branch(Tip) 0.1 : -108.155673 4.9656e+00 1.6938e+01
+Branch(Tip) 0.2 : -108.859844 4.2340e+00 -1.3932e+01
+Branch(Tip) 0.5 : -109.653060 3.6556e-01 -3.3599e+00
+Branch(Tip) 0.9 : -109.617433 -1.9976e-01 2.2318e-02
+Branch(Tip) 1.5 : -109.499575 -6.3696e-02 1.5578e-01
+Branch(Tip) 5.0 : -109.889394 1.1251e-01 -2.8722e-03
+Branch(Tip) 10.0 : -110.535690 6.5785e-02 -6.4091e-03
+Branch(Tip) 50.0 : -111.141086 -3.6336e-04 -1.4832e-05
+Branch(Tip) 90.0 : -111.119380 -2.6849e-04 4.6515e-06
Test -108.859844 = -108.859844
TEST alpha(ncats) = 0.10( 4) ; pinv = 0.60
0.000001 0.001078 0.093753 3.905168
-Branch 0.1 : -116.825451 -4.0086e+00 2.9826e+01
-Branch 0.2 : -116.530823 -2.1779e+00 1.1315e+01
-Branch 0.5 : -116.180514 -5.4286e-01 2.6613e+00
-Branch 0.9 : -116.109012 6.9580e-02 8.4062e-01
-Branch 1.5 : -116.250021 3.4038e-01 2.1222e-01
-Branch 5.0 : -117.516001 2.7152e-01 -6.3550e-02
-Branch 10.0 : -118.269287 6.7673e-02 -2.0346e-02
-Branch 50.0 : -118.450766 -1.1179e-03 1.9649e-05
-Branch 90.0 : -118.419518 -5.0230e-04 1.1375e-05
+Branch 0.1 : -116.825451 -1.6034e+00 4.7721e+00
+Branch 0.2 : -116.530823 -8.7116e-01 1.8104e+00
+Branch 0.5 : -116.180514 -2.1714e-01 4.2580e-01
+Branch 0.9 : -116.109012 2.7832e-02 1.3450e-01
+Branch 1.5 : -116.250021 1.3615e-01 3.3955e-02
+Branch 5.0 : -117.516001 1.0861e-01 -1.0168e-02
+Branch 10.0 : -118.269287 2.7069e-02 -3.2553e-03
+Branch 50.0 : -118.450766 -4.4717e-04 3.1439e-06
+Branch 90.0 : -118.419518 -2.0092e-04 1.8199e-06
Test -116.825451 = -116.825451
-Branch(Tip) 0.1 : -116.267325 2.6937e+00 -1.6753e+01
-Branch(Tip) 0.2 : -116.413214 3.1371e-01 -1.7214e+01
-Branch(Tip) 0.5 : -116.243045 -6.2711e-01 1.6553e+00
-Branch(Tip) 0.9 : -116.118486 -5.3002e-02 9.6706e-01
-Branch(Tip) 1.5 : -116.203451 2.6782e-01 2.6015e-01
-Branch(Tip) 5.0 : -117.335333 2.5205e-01 -5.5578e-02
-Branch(Tip) 10.0 : -118.061152 7.0169e-02 -1.9201e-02
-Branch(Tip) 50.0 : -118.223795 -2.3660e-03 3.9273e-05
-Branch(Tip) 90.0 : -118.155549 -1.1676e-03 2.1718e-05
+Branch(Tip) 0.1 : -116.267325 1.0775e+00 -2.6805e+00
+Branch(Tip) 0.2 : -116.413214 1.2548e-01 -2.7542e+00
+Branch(Tip) 0.5 : -116.243045 -2.5084e-01 2.6485e-01
+Branch(Tip) 0.9 : -116.118486 -2.1201e-02 1.5473e-01
+Branch(Tip) 1.5 : -116.203451 1.0713e-01 4.1625e-02
+Branch(Tip) 5.0 : -117.335333 1.0082e-01 -8.8925e-03
+Branch(Tip) 10.0 : -118.061152 2.8068e-02 -3.0721e-03
+Branch(Tip) 50.0 : -118.223795 -9.4638e-04 6.2837e-06
+Branch(Tip) 90.0 : -118.155549 -4.6706e-04 3.4748e-06
Test -116.413214 = -116.413214
TEST alpha(ncats) = 0.10( 4) ; pinv = 0.90
0.000001 0.001078 0.093753 3.905168
-Branch 0.1 : -132.412181 -1.4365e+00 3.5099e+01
-Branch 0.2 : -132.390100 6.2086e-01 1.1602e+01
-Branch 0.5 : -132.827982 1.8032e+00 4.6393e-01
-Branch 0.9 : -133.520882 1.5660e+00 -1.0852e+00
-Branch 1.5 : -134.260592 9.1781e-01 -9.3968e-01
-Branch 5.0 : -135.036135 -4.6483e-04 -2.2116e-02
-Branch 10.0 : -134.954944 -1.8034e-02 8.7475e-04
-Branch 50.0 : -134.657532 -2.2810e-03 1.1611e-04
-Branch 90.0 : -134.621972 -1.0218e-04 1.9989e-05
+Branch 0.1 : -132.412181 -1.4365e-01 3.5099e-01
+Branch 0.2 : -132.390100 6.2086e-02 1.1602e-01
+Branch 0.5 : -132.827982 1.8032e-01 4.6393e-03
+Branch 0.9 : -133.520882 1.5660e-01 -1.0852e-02
+Branch 1.5 : -134.260592 9.1781e-02 -9.3968e-03
+Branch 5.0 : -135.036135 -4.6483e-05 -2.2116e-04
+Branch 10.0 : -134.954944 -1.8034e-03 8.7475e-06
+Branch 50.0 : -134.657532 -2.2810e-04 1.1611e-06
+Branch 90.0 : -134.621972 -1.0218e-05 1.9989e-07
Test -132.412181 = -132.412181
-Branch(Tip) 0.1 : -132.063958 -4.3410e+00 8.4386e+01
-Branch(Tip) 0.2 : -131.895555 1.1882e-02 2.1866e+01
-Branch(Tip) 0.5 : -132.363694 2.2237e+00 1.3304e+00
-Branch(Tip) 0.9 : -133.251988 2.0582e+00 -1.2569e+00
-Branch(Tip) 1.5 : -134.241988 1.2517e+00 -1.2127e+00
-Branch(Tip) 5.0 : -135.340969 -2.7712e-03 -3.5153e-02
-Branch(Tip) 10.0 : -135.202849 -2.9713e-02 1.7521e-03
-Branch(Tip) 50.0 : -134.754795 -2.9406e-03 1.7599e-04
-Branch(Tip) 90.0 : -134.721602 3.6825e-04 3.0592e-05
+Branch(Tip) 0.1 : -132.063958 -4.3410e-01 8.4386e-01
+Branch(Tip) 0.2 : -131.895555 1.1882e-03 2.1866e-01
+Branch(Tip) 0.5 : -132.363694 2.2237e-01 1.3304e-02
+Branch(Tip) 0.9 : -133.251988 2.0582e-01 -1.2569e-02
+Branch(Tip) 1.5 : -134.241988 1.2517e-01 -1.2127e-02
+Branch(Tip) 5.0 : -135.340969 -2.7712e-04 -3.5153e-04
+Branch(Tip) 10.0 : -135.202849 -2.9713e-03 1.7521e-05
+Branch(Tip) 50.0 : -134.754795 -2.9406e-04 1.7599e-06
+Branch(Tip) 90.0 : -134.721602 3.6825e-05 3.0592e-07
Test -131.895555 = -131.895555
@@ -731,75 +731,75 @@ Test -94.544268 = -94.544268
TEST alpha(ncats) = 0.75( 4) ; pinv = 0.30
0.084885 0.386197 0.942076 2.586843
-Branch 0.1 : -98.893618 -8.1748e-02 3.9505e+01
-Branch 0.2 : -99.009847 1.9266e+00 8.9704e+00
-Branch 0.5 : -99.717622 2.3614e+00 -1.2452e+00
-Branch 0.9 : -100.544656 1.7717e+00 -1.3811e+00
-Branch 1.5 : -101.398581 1.1352e+00 -7.8347e-01
-Branch 5.0 : -103.176646 2.3221e-01 -6.6154e-02
-Branch 10.0 : -103.872246 8.3733e-02 -1.4055e-02
-Branch 50.0 : -104.410096 3.1120e-04 -3.8004e-05
-Branch 90.0 : -104.412684 2.9863e-06 -3.3710e-07
+Branch 0.1 : -98.893618 -5.7224e-02 1.9358e+01
+Branch 0.2 : -99.009847 1.3486e+00 4.3955e+00
+Branch 0.5 : -99.717622 1.6530e+00 -6.1015e-01
+Branch 0.9 : -100.544656 1.2402e+00 -6.7673e-01
+Branch 1.5 : -101.398581 7.9464e-01 -3.8390e-01
+Branch 5.0 : -103.176646 1.6255e-01 -3.2415e-02
+Branch 10.0 : -103.872246 5.8613e-02 -6.8868e-03
+Branch 50.0 : -104.410096 2.1784e-04 -1.8622e-05
+Branch 90.0 : -104.412684 2.0904e-06 -1.6518e-07
Test -98.893618 = -98.893618
-Branch(Tip) 0.1 : -97.788450 -2.0374e+00 1.2697e+02
-Branch(Tip) 0.2 : -97.956667 3.7901e+00 2.2246e+01
-Branch(Tip) 0.5 : -99.340389 4.3721e+00 -4.1237e+00
-Branch(Tip) 0.9 : -100.770374 2.8682e+00 -2.9908e+00
-Branch(Tip) 1.5 : -102.070051 1.6217e+00 -1.3961e+00
-Branch(Tip) 5.0 : -104.280534 2.4797e-01 -7.9667e-02
-Branch(Tip) 10.0 : -104.996915 8.5422e-02 -1.3786e-02
-Branch(Tip) 50.0 : -105.587833 4.4970e-04 -5.2703e-05
-Branch(Tip) 90.0 : -105.591708 4.9684e-06 -5.4838e-07
+Branch(Tip) 0.1 : -97.788450 -1.4262e+00 6.2216e+01
+Branch(Tip) 0.2 : -97.956667 2.6530e+00 1.0901e+01
+Branch(Tip) 0.5 : -99.340389 3.0605e+00 -2.0206e+00
+Branch(Tip) 0.9 : -100.770374 2.0077e+00 -1.4655e+00
+Branch(Tip) 1.5 : -102.070051 1.1352e+00 -6.8407e-01
+Branch(Tip) 5.0 : -104.280534 1.7358e-01 -3.9037e-02
+Branch(Tip) 10.0 : -104.996915 5.9796e-02 -6.7549e-03
+Branch(Tip) 50.0 : -105.587833 3.1479e-04 -2.5824e-05
+Branch(Tip) 90.0 : -105.591708 3.4779e-06 -2.6870e-07
Test -97.956667 = -97.956667
TEST alpha(ncats) = 0.75( 4) ; pinv = 0.60
0.084885 0.386197 0.942076 2.586843
-Branch 0.1 : -105.843834 5.6997e-01 2.9071e+01
-Branch 0.2 : -105.991287 2.0134e+00 5.9106e+00
-Branch 0.5 : -106.652840 2.0835e+00 -1.6355e+00
-Branch 0.9 : -107.354409 1.4485e+00 -1.3491e+00
-Branch 1.5 : -108.027454 8.6226e-01 -6.7602e-01
-Branch 5.0 : -109.359578 1.8322e-01 -5.1864e-02
-Branch 10.0 : -109.865747 4.9588e-02 -1.2570e-02
-Branch 50.0 : -110.069856 9.0704e-06 -1.7879e-06
-Branch 90.0 : -110.069902 3.8493e-09 -7.4037e-10
+Branch 0.1 : -105.843834 2.2799e-01 4.6514e+00
+Branch 0.2 : -105.991287 8.0535e-01 9.4569e-01
+Branch 0.5 : -106.652840 8.3339e-01 -2.6167e-01
+Branch 0.9 : -107.354409 5.7942e-01 -2.1585e-01
+Branch 1.5 : -108.027454 3.4490e-01 -1.0816e-01
+Branch 5.0 : -109.359578 7.3289e-02 -8.2982e-03
+Branch 10.0 : -109.865747 1.9835e-02 -2.0113e-03
+Branch 50.0 : -110.069856 3.6281e-06 -2.8606e-07
+Branch 90.0 : -110.069902 1.5397e-09 -1.1846e-10
Test -105.843834 = -105.843834
-Branch(Tip) 0.1 : -104.453153 1.3370e+00 9.2805e+01
-Branch(Tip) 0.2 : -104.832903 4.9730e+00 8.5157e+00
-Branch(Tip) 0.5 : -106.254487 4.0071e+00 -5.4134e+00
-Branch(Tip) 0.9 : -107.490249 2.3373e+00 -3.0061e+00
-Branch(Tip) 1.5 : -108.489672 1.1720e+00 -1.1931e+00
-Branch(Tip) 5.0 : -109.999958 1.7967e-01 -5.1543e-02
-Branch(Tip) 10.0 : -110.510600 5.3640e-02 -1.2220e-02
-Branch(Tip) 50.0 : -110.752430 1.4793e-05 -2.8543e-06
-Branch(Tip) 90.0 : -110.752507 6.9260e-09 -1.3233e-09
+Branch(Tip) 0.1 : -104.453153 5.3480e-01 1.4849e+01
+Branch(Tip) 0.2 : -104.832903 1.9892e+00 1.3625e+00
+Branch(Tip) 0.5 : -106.254487 1.6028e+00 -8.6614e-01
+Branch(Tip) 0.9 : -107.490249 9.3493e-01 -4.8098e-01
+Branch(Tip) 1.5 : -108.489672 4.6882e-01 -1.9089e-01
+Branch(Tip) 5.0 : -109.999958 7.1867e-02 -8.2468e-03
+Branch(Tip) 10.0 : -110.510600 2.1456e-02 -1.9551e-03
+Branch(Tip) 50.0 : -110.752430 5.9171e-06 -4.5668e-07
+Branch(Tip) 90.0 : -110.752507 2.7704e-09 -2.1173e-10
Test -104.832903 = -104.832903
TEST alpha(ncats) = 0.75( 4) ; pinv = 0.90
0.084885 0.386197 0.942076 2.586843
-Branch 0.1 : -127.157390 1.5890e+00 1.0867e+01
-Branch 0.2 : -127.349980 2.1200e+00 1.9257e+00
-Branch 0.5 : -127.986883 1.9969e+00 -1.1867e+00
-Branch 0.9 : -128.687941 1.5125e+00 -1.1501e+00
-Branch 1.5 : -129.408015 9.2191e-01 -8.1160e-01
-Branch 5.0 : -130.358613 3.5314e-02 -3.1359e-02
-Branch 10.0 : -130.399188 5.6049e-04 -4.4512e-04
-Branch 50.0 : -130.399900 1.4994e-14 -1.9860e-17
-Branch 90.0 : -130.399900 1.4968e-14 -1.7534e-29
+Branch 0.1 : -127.157390 1.5890e-01 1.0867e-01
+Branch 0.2 : -127.349980 2.1200e-01 1.9257e-02
+Branch 0.5 : -127.986883 1.9969e-01 -1.1867e-02
+Branch 0.9 : -128.687941 1.5125e-01 -1.1501e-02
+Branch 1.5 : -129.408015 9.2191e-02 -8.1160e-03
+Branch 5.0 : -130.358613 3.5314e-03 -3.1359e-04
+Branch 10.0 : -130.399188 5.6049e-05 -4.4512e-06
+Branch 50.0 : -130.399900 1.4994e-15 -1.9860e-19
+Branch 90.0 : -130.399900 1.4968e-15 -1.7534e-31
Test -127.157390 = -127.157390
-Branch(Tip) 0.1 : -125.678952 5.0339e+00 2.6169e+01
-Branch(Tip) 0.2 : -126.213182 5.1377e+00 -8.8542e+00
-Branch(Tip) 0.5 : -127.369584 2.8519e+00 -4.7336e+00
-Branch(Tip) 0.9 : -128.245535 1.7175e+00 -1.7448e+00
-Branch(Tip) 1.5 : -129.033413 9.9153e-01 -8.6984e-01
-Branch(Tip) 5.0 : -130.108188 4.6675e-02 -3.9354e-02
-Branch(Tip) 10.0 : -130.163972 8.4249e-04 -6.5631e-04
-Branch(Tip) 50.0 : -130.165060 1.5999e-14 -3.3516e-17
-Branch(Tip) 90.0 : -130.165060 1.5956e-14 -1.8548e-29
+Branch(Tip) 0.1 : -125.678952 5.0339e-01 2.6169e-01
+Branch(Tip) 0.2 : -126.213182 5.1377e-01 -8.8542e-02
+Branch(Tip) 0.5 : -127.369584 2.8519e-01 -4.7336e-02
+Branch(Tip) 0.9 : -128.245535 1.7175e-01 -1.7448e-02
+Branch(Tip) 1.5 : -129.033413 9.9153e-02 -8.6984e-03
+Branch(Tip) 5.0 : -130.108188 4.6675e-03 -3.9354e-04
+Branch(Tip) 10.0 : -130.163972 8.4249e-05 -6.5631e-06
+Branch(Tip) 50.0 : -130.165060 1.5999e-15 -3.3516e-19
+Branch(Tip) 90.0 : -130.165060 1.5956e-15 -1.8548e-31
Test -126.213182 = -126.213182
@@ -831,75 +831,75 @@ Test -93.805671 = -93.805671
TEST alpha(ncats) = 1.50( 4) ; pinv = 0.30
0.225323 0.588556 1.050422 2.135699
-Branch 0.1 : -97.702985 6.9136e-01 4.0457e+01
-Branch 0.2 : -97.899517 2.7451e+00 9.0449e+00
-Branch 0.5 : -98.839836 3.0616e+00 -1.8488e+00
-Branch 0.9 : -99.899205 2.2405e+00 -1.8877e+00
-Branch 1.5 : -100.958896 1.3760e+00 -1.0544e+00
-Branch 5.0 : -102.877842 1.8728e-01 -8.6570e-02
-Branch 10.0 : -103.260758 2.3644e-02 -8.9586e-03
-Branch 50.0 : -103.327405 1.0143e-07 -2.9662e-08
-Branch 90.0 : -103.327405 9.1087e-13 -2.6296e-13
+Branch 0.1 : -97.702985 4.8395e-01 1.9824e+01
+Branch 0.2 : -97.899517 1.9216e+00 4.4320e+00
+Branch 0.5 : -98.839836 2.1431e+00 -9.0591e-01
+Branch 0.9 : -99.899205 1.5684e+00 -9.2500e-01
+Branch 1.5 : -100.958896 9.6320e-01 -5.1666e-01
+Branch 5.0 : -102.877842 1.3110e-01 -4.2419e-02
+Branch 10.0 : -103.260758 1.6551e-02 -4.3897e-03
+Branch 50.0 : -103.327405 7.1004e-08 -1.4534e-08
+Branch 90.0 : -103.327405 6.3761e-13 -1.2885e-13
Test -97.702985 = -97.702985
-Branch(Tip) 0.1 : -96.626054 -2.9213e+00 1.3898e+02
-Branch(Tip) 0.2 : -96.753650 3.7725e+00 2.8637e+01
-Branch(Tip) 0.5 : -98.305661 5.2301e+00 -3.4922e+00
-Branch(Tip) 0.9 : -100.069558 3.5977e+00 -3.6969e+00
-Branch(Tip) 1.5 : -101.689643 1.9899e+00 -1.8376e+00
-Branch(Tip) 5.0 : -104.168707 2.2012e-01 -1.0180e-01
-Branch(Tip) 10.0 : -104.627822 3.0124e-02 -1.0811e-02
-Branch(Tip) 50.0 : -104.717099 1.7163e-07 -4.9823e-08
-Branch(Tip) 90.0 : -104.717100 1.5992e-12 -4.6179e-13
+Branch(Tip) 0.1 : -96.626054 -2.0449e+00 6.8100e+01
+Branch(Tip) 0.2 : -96.753650 2.6408e+00 1.4032e+01
+Branch(Tip) 0.5 : -98.305661 3.6611e+00 -1.7112e+00
+Branch(Tip) 0.9 : -100.069558 2.5184e+00 -1.8115e+00
+Branch(Tip) 1.5 : -101.689643 1.3930e+00 -9.0041e-01
+Branch(Tip) 5.0 : -104.168707 1.5409e-01 -4.9882e-02
+Branch(Tip) 10.0 : -104.627822 2.1087e-02 -5.2972e-03
+Branch(Tip) 50.0 : -104.717099 1.2014e-07 -2.4413e-08
+Branch(Tip) 90.0 : -104.717100 1.1194e-12 -2.2628e-13
Test -96.753650 = -96.753650
TEST alpha(ncats) = 1.50( 4) ; pinv = 0.60
0.225323 0.588556 1.050422 2.135699
-Branch 0.1 : -104.817882 2.0709e+00 2.5024e+01
-Branch 0.2 : -105.099937 3.2341e+00 3.7820e+00
-Branch 0.5 : -106.052113 2.8469e+00 -2.7621e+00
-Branch 0.9 : -106.986867 1.8880e+00 -1.9168e+00
-Branch 1.5 : -107.845243 1.0695e+00 -9.4468e-01
-Branch 5.0 : -109.114197 8.0743e-02 -5.3551e-02
-Branch 10.0 : -109.236642 3.9571e-03 -2.2168e-03
-Branch 50.0 : -109.243891 4.4238e-12 -2.2400e-12
-Branch 90.0 : -109.243891 4.3614e-15 -3.5892e-21
+Branch 0.1 : -104.817882 8.2835e-01 4.0039e+00
+Branch 0.2 : -105.099937 1.2936e+00 6.0512e-01
+Branch 0.5 : -106.052113 1.1387e+00 -4.4194e-01
+Branch 0.9 : -106.986867 7.5521e-01 -3.0668e-01
+Branch 1.5 : -107.845243 4.2782e-01 -1.5115e-01
+Branch 5.0 : -109.114197 3.2297e-02 -8.5681e-03
+Branch 10.0 : -109.236642 1.5828e-03 -3.5469e-04
+Branch 50.0 : -109.243891 1.7695e-12 -3.5840e-13
+Branch 90.0 : -109.243891 1.7446e-15 -5.7427e-22
Test -104.817882 = -104.817882
-Branch(Tip) 0.1 : -103.179276 1.8748e+00 1.0563e+02
-Branch(Tip) 0.2 : -103.657607 6.2534e+00 1.1978e+01
-Branch(Tip) 0.5 : -105.477785 5.1570e+00 -7.1466e+00
-Branch(Tip) 0.9 : -107.051034 2.9306e+00 -3.9762e+00
-Branch(Tip) 1.5 : -108.283190 1.4172e+00 -1.5216e+00
-Branch(Tip) 5.0 : -109.839851 1.0029e-01 -6.2940e-02
-Branch(Tip) 10.0 : -109.999056 5.6412e-03 -3.0555e-03
-Branch(Tip) 50.0 : -110.009686 7.5957e-12 -3.8434e-12
-Branch(Tip) 90.0 : -110.009686 4.5977e-15 -6.2026e-21
+Branch(Tip) 0.1 : -103.179276 7.4991e-01 1.6901e+01
+Branch(Tip) 0.2 : -103.657607 2.5013e+00 1.9164e+00
+Branch(Tip) 0.5 : -105.477785 2.0628e+00 -1.1435e+00
+Branch(Tip) 0.9 : -107.051034 1.1722e+00 -6.3619e-01
+Branch(Tip) 1.5 : -108.283190 5.6686e-01 -2.4346e-01
+Branch(Tip) 5.0 : -109.839851 4.0115e-02 -1.0070e-02
+Branch(Tip) 10.0 : -109.999056 2.2565e-03 -4.8888e-04
+Branch(Tip) 50.0 : -110.009686 3.0383e-12 -6.1494e-13
+Branch(Tip) 90.0 : -110.009686 1.8391e-15 -9.9242e-22
Test -103.657607 = -103.657607
TEST alpha(ncats) = 1.50( 4) ; pinv = 0.90
0.225323 0.588556 1.050422 2.135699
-Branch 0.1 : -129.851473 5.4798e+00 -7.9916e+00
-Branch 0.2 : -130.355877 4.5908e+00 -9.1416e+00
-Branch 0.5 : -131.365623 2.3255e+00 -5.6495e+00
-Branch 0.9 : -131.956254 8.6060e-01 -2.1443e+00
-Branch 1.5 : -132.226449 2.0106e-01 -4.7164e-01
-Branch 5.0 : -132.315373 1.1315e-04 -2.3301e-04
-Branch 10.0 : -132.315428 4.1995e-09 -8.5254e-09
-Branch 50.0 : -132.315428 1.5537e-14 -1.0169e-29
-Branch 90.0 : -132.315428 1.5537e-14 -1.0169e-29
+Branch 0.1 : -129.851473 5.4798e-01 -7.9916e-02
+Branch 0.2 : -130.355877 4.5908e-01 -9.1416e-02
+Branch 0.5 : -131.365623 2.3255e-01 -5.6495e-02
+Branch 0.9 : -131.956254 8.6060e-02 -2.1443e-02
+Branch 1.5 : -132.226449 2.0106e-02 -4.7164e-03
+Branch 5.0 : -132.315373 1.1315e-05 -2.3301e-06
+Branch 10.0 : -132.315428 4.1995e-10 -8.5254e-11
+Branch 50.0 : -132.315428 1.5537e-15 -1.0169e-31
+Branch 90.0 : -132.315428 1.5537e-15 -1.0169e-31
Test -129.851473 = -129.851473
-Branch(Tip) 0.1 : -127.540702 1.1643e+01 -1.6207e+01
-Branch(Tip) 0.2 : -128.584360 9.1065e+00 -2.6171e+01
-Branch(Tip) 0.5 : -130.419200 3.9248e+00 -1.0472e+01
-Branch(Tip) 0.9 : -131.395427 1.4080e+00 -3.4962e+00
-Branch(Tip) 1.5 : -131.840125 3.3506e-01 -7.7436e-01
-Branch(Tip) 5.0 : -131.990369 2.0515e-04 -4.1904e-04
-Branch(Tip) 10.0 : -131.990470 7.9465e-09 -1.6106e-08
-Branch(Tip) 50.0 : -131.990470 1.5869e-14 -9.8854e-30
-Branch(Tip) 90.0 : -131.990470 1.5869e-14 -9.8854e-30
+Branch(Tip) 0.1 : -127.540702 1.1643e+00 -1.6207e-01
+Branch(Tip) 0.2 : -128.584360 9.1065e-01 -2.6171e-01
+Branch(Tip) 0.5 : -130.419200 3.9248e-01 -1.0472e-01
+Branch(Tip) 0.9 : -131.395427 1.4080e-01 -3.4962e-02
+Branch(Tip) 1.5 : -131.840125 3.3506e-02 -7.7436e-03
+Branch(Tip) 5.0 : -131.990369 2.0515e-05 -4.1904e-06
+Branch(Tip) 10.0 : -131.990470 7.9465e-10 -1.6106e-10
+Branch(Tip) 50.0 : -131.990470 1.5869e-15 -9.8854e-32
+Branch(Tip) 90.0 : -131.990470 1.5869e-15 -9.8854e-32
Test -128.584360 = -128.584360
ti/tv:alpha(ncats) = 0.10( 1) logL: -134.810864
diff --git a/test/out/derivatives.out b/test/out/derivatives.out
index 56d5d93..3a9cd58 100644
--- a/test/out/derivatives.out
+++ b/test/out/derivatives.out
@@ -29,75 +29,75 @@ Test -90.363715 = -90.363715
TEST alpha(ncats) = 0.10( 1) ; pinv = 0.30
1.000000
-Branch 0.1 : -91.991139 -3.1754e+00 7.2285e+01
-Branch 0.2 : -91.904873 6.2551e-01 1.9136e+01
-Branch 0.5 : -92.470985 2.3105e+00 -1.0281e-01
-Branch 0.9 : -93.298269 1.7182e+00 -1.9287e+00
-Branch 1.5 : -94.021985 7.8156e-01 -1.1099e+00
-Branch 5.0 : -94.557860 5.1732e-03 -7.2440e-03
-Branch 10.0 : -94.561564 4.9557e-06 -6.8744e-06
-Branch 50.0 : -94.561568 -7.3058e-15 -5.7432e-30
-Branch 90.0 : -94.561568 -7.3058e-15 -2.0891e-31
+Branch 0.1 : -91.991139 -2.2228e+00 3.5420e+01
+Branch 0.2 : -91.904873 4.3786e-01 9.3766e+00
+Branch 0.5 : -92.470985 1.6173e+00 -5.0374e-02
+Branch 0.9 : -93.298269 1.2028e+00 -9.4509e-01
+Branch 1.5 : -94.021985 5.4709e-01 -5.4388e-01
+Branch 5.0 : -94.557860 3.6212e-03 -3.5496e-03
+Branch 10.0 : -94.561564 3.4690e-06 -3.3685e-06
+Branch 50.0 : -94.561568 -5.1141e-15 -2.8141e-30
+Branch 90.0 : -94.561568 -5.1141e-15 -1.0236e-31
Test -91.991139 = -91.991139
-Branch(Tip) 0.1 : -91.023442 -1.6107e+00 1.1557e+02
-Branch(Tip) 0.2 : -91.236562 4.5468e+00 3.0796e+01
-Branch(Tip) 0.5 : -93.163026 6.8489e+00 -2.2728e+00
-Branch(Tip) 0.9 : -95.560471 4.9436e+00 -5.5454e+00
-Branch(Tip) 1.5 : -97.637397 2.2189e+00 -3.2810e+00
-Branch(Tip) 5.0 : -99.077667 1.1724e-02 -1.6649e-02
-Branch(Tip) 10.0 : -99.085987 1.0966e-05 -1.5215e-05
-Branch(Tip) 50.0 : -99.085995 -7.3467e-15 -1.2463e-29
-Branch(Tip) 90.0 : -99.085995 -7.3467e-15 -2.2150e-31
+Branch(Tip) 0.1 : -91.023442 -1.1275e+00 5.6630e+01
+Branch(Tip) 0.2 : -91.236562 3.1827e+00 1.5090e+01
+Branch(Tip) 0.5 : -93.163026 4.7942e+00 -1.1137e+00
+Branch(Tip) 0.9 : -95.560471 3.4605e+00 -2.7172e+00
+Branch(Tip) 1.5 : -97.637397 1.5532e+00 -1.6077e+00
+Branch(Tip) 5.0 : -99.077667 8.2069e-03 -8.1580e-03
+Branch(Tip) 10.0 : -99.085987 7.6761e-06 -7.4554e-06
+Branch(Tip) 50.0 : -99.085995 -5.1427e-15 -6.1068e-30
+Branch(Tip) 90.0 : -99.085995 -5.1427e-15 -1.0853e-31
Test -91.236562 = -91.236562
TEST alpha(ncats) = 0.10( 1) ; pinv = 0.60
1.000000
-Branch 0.1 : -97.395496 4.1869e-01 4.1576e+01
-Branch 0.2 : -97.566231 2.4650e+00 7.9705e+00
-Branch 0.5 : -98.337703 2.1781e+00 -3.8532e+00
-Branch 0.9 : -98.930700 9.0932e-01 -2.1922e+00
-Branch 1.5 : -99.215328 2.0430e-01 -5.1302e-01
-Branch 5.0 : -99.297308 3.8535e-05 -9.3567e-05
-Branch 10.0 : -99.297324 2.0653e-10 -5.0132e-10
-Branch 50.0 : -99.297324 -1.1880e-14 -1.7296e-31
-Branch 90.0 : -99.297324 -1.1880e-14 -1.7296e-31
+Branch 0.1 : -97.395496 1.6748e-01 6.6521e+00
+Branch 0.2 : -97.566231 9.8602e-01 1.2753e+00
+Branch 0.5 : -98.337703 8.7125e-01 -6.1652e-01
+Branch 0.9 : -98.930700 3.6373e-01 -3.5075e-01
+Branch 1.5 : -99.215328 8.1721e-02 -8.2083e-02
+Branch 5.0 : -99.297308 1.5414e-05 -1.4971e-05
+Branch 10.0 : -99.297324 8.2613e-11 -8.0212e-11
+Branch 50.0 : -99.297324 -4.7521e-15 -2.7673e-32
+Branch 90.0 : -99.297324 -4.7521e-15 -2.7673e-32
Test -97.395496 = -97.395496
-Branch(Tip) 0.1 : -95.225032 7.2632e+00 7.3170e+01
-Branch(Tip) 0.2 : -96.169157 1.0605e+01 9.2719e+00
-Branch(Tip) 0.5 : -99.100065 7.8974e+00 -1.4893e+01
-Branch(Tip) 0.9 : -101.205774 3.1182e+00 -8.1068e+00
-Branch(Tip) 1.5 : -102.137369 6.1893e-01 -1.6698e+00
-Branch(Tip) 5.0 : -102.372957 9.9808e-05 -2.4251e-04
-Branch(Tip) 10.0 : -102.372998 5.3436e-10 -1.2970e-09
-Branch(Tip) 50.0 : -102.372998 -1.1896e-14 -1.8500e-31
-Branch(Tip) 90.0 : -102.372998 -1.1896e-14 -1.8500e-31
+Branch(Tip) 0.1 : -95.225032 2.9053e+00 1.1707e+01
+Branch(Tip) 0.2 : -96.169157 4.2420e+00 1.4835e+00
+Branch(Tip) 0.5 : -99.100065 3.1590e+00 -2.3830e+00
+Branch(Tip) 0.9 : -101.205774 1.2473e+00 -1.2971e+00
+Branch(Tip) 1.5 : -102.137369 2.4757e-01 -2.6717e-01
+Branch(Tip) 5.0 : -102.372957 3.9923e-05 -3.8801e-05
+Branch(Tip) 10.0 : -102.372998 2.1374e-10 -2.0752e-10
+Branch(Tip) 50.0 : -102.372998 -4.7584e-15 -2.9600e-32
+Branch(Tip) 90.0 : -102.372998 -4.7584e-15 -2.9600e-32
Test -96.169157 = -96.169157
TEST alpha(ncats) = 0.10( 1) ; pinv = 0.90
1.000000
-Branch 0.1 : -121.077217 8.8195e-01 -8.6903e+00
-Branch 0.2 : -121.133222 3.2761e-01 -3.2488e+00
-Branch 0.5 : -121.164660 1.7097e-02 -1.6709e-01
-Branch 0.9 : -121.166378 3.4811e-04 -3.3822e-03
-Branch 1.5 : -121.166414 1.0264e-06 -9.9656e-06
-Branch 5.0 : -121.166414 -4.6680e-14 -1.7414e-20
-Branch 10.0 : -121.166414 -4.6680e-14 -1.6772e-31
-Branch 50.0 : -121.166414 -4.6680e-14 -1.6772e-31
-Branch 90.0 : -121.166414 -4.6680e-14 -1.6772e-31
+Branch 0.1 : -121.077217 8.8195e-02 -8.6903e-02
+Branch 0.2 : -121.133222 3.2761e-02 -3.2488e-02
+Branch 0.5 : -121.164660 1.7097e-03 -1.6709e-03
+Branch 0.9 : -121.166378 3.4811e-05 -3.3822e-05
+Branch 1.5 : -121.166414 1.0264e-07 -9.9656e-08
+Branch 5.0 : -121.166414 -4.6680e-15 -1.7414e-22
+Branch 10.0 : -121.166414 -4.6680e-15 -1.6772e-33
+Branch 50.0 : -121.166414 -4.6680e-15 -1.6772e-33
+Branch 90.0 : -121.166414 -4.6680e-15 -1.6772e-33
Test -121.077217 = -121.077217
-Branch(Tip) 0.1 : -119.215967 2.0918e+01 -1.9042e+02
-Branch(Tip) 0.2 : -120.551659 7.6462e+00 -8.1447e+01
-Branch(Tip) 0.5 : -121.236738 3.2182e-01 -3.2758e+00
-Branch(Tip) 0.9 : -121.268238 6.1290e-03 -5.9820e-02
-Branch(Tip) 1.5 : -121.268865 1.7939e-05 -1.7419e-04
-Branch(Tip) 5.0 : -121.268867 -4.6680e-14 -3.0427e-19
-Branch(Tip) 10.0 : -121.268867 -4.6680e-14 -1.6835e-31
-Branch(Tip) 50.0 : -121.268867 -4.6680e-14 -1.6835e-31
-Branch(Tip) 90.0 : -121.268867 -4.6680e-14 -1.6835e-31
+Branch(Tip) 0.1 : -119.215967 2.0918e+00 -1.9042e+00
+Branch(Tip) 0.2 : -120.551659 7.6462e-01 -8.1447e-01
+Branch(Tip) 0.5 : -121.236738 3.2182e-02 -3.2758e-02
+Branch(Tip) 0.9 : -121.268238 6.1290e-04 -5.9820e-04
+Branch(Tip) 1.5 : -121.268865 1.7939e-06 -1.7419e-06
+Branch(Tip) 5.0 : -121.268867 -4.6680e-15 -3.0427e-21
+Branch(Tip) 10.0 : -121.268867 -4.6680e-15 -1.6835e-33
+Branch(Tip) 50.0 : -121.268867 -4.6680e-15 -1.6835e-33
+Branch(Tip) 90.0 : -121.268867 -4.6680e-15 -1.6835e-33
Test -120.551659 = -120.551659
@@ -129,75 +129,75 @@ Test -90.363715 = -90.363715
TEST alpha(ncats) = 0.75( 1) ; pinv = 0.30
1.000000
-Branch 0.1 : -91.991139 -3.1754e+00 7.2285e+01
-Branch 0.2 : -91.904873 6.2551e-01 1.9136e+01
-Branch 0.5 : -92.470985 2.3105e+00 -1.0281e-01
-Branch 0.9 : -93.298269 1.7182e+00 -1.9287e+00
-Branch 1.5 : -94.021985 7.8156e-01 -1.1099e+00
-Branch 5.0 : -94.557860 5.1732e-03 -7.2440e-03
-Branch 10.0 : -94.561564 4.9557e-06 -6.8744e-06
-Branch 50.0 : -94.561568 -7.3058e-15 -5.7432e-30
-Branch 90.0 : -94.561568 -7.3058e-15 -2.0891e-31
+Branch 0.1 : -91.991139 -2.2228e+00 3.5420e+01
+Branch 0.2 : -91.904873 4.3786e-01 9.3766e+00
+Branch 0.5 : -92.470985 1.6173e+00 -5.0374e-02
+Branch 0.9 : -93.298269 1.2028e+00 -9.4509e-01
+Branch 1.5 : -94.021985 5.4709e-01 -5.4388e-01
+Branch 5.0 : -94.557860 3.6212e-03 -3.5496e-03
+Branch 10.0 : -94.561564 3.4690e-06 -3.3685e-06
+Branch 50.0 : -94.561568 -5.1141e-15 -2.8141e-30
+Branch 90.0 : -94.561568 -5.1141e-15 -1.0236e-31
Test -91.991139 = -91.991139
-Branch(Tip) 0.1 : -91.023442 -1.6107e+00 1.1557e+02
-Branch(Tip) 0.2 : -91.236562 4.5468e+00 3.0796e+01
-Branch(Tip) 0.5 : -93.163026 6.8489e+00 -2.2728e+00
-Branch(Tip) 0.9 : -95.560471 4.9436e+00 -5.5454e+00
-Branch(Tip) 1.5 : -97.637397 2.2189e+00 -3.2810e+00
-Branch(Tip) 5.0 : -99.077667 1.1724e-02 -1.6649e-02
-Branch(Tip) 10.0 : -99.085987 1.0966e-05 -1.5215e-05
-Branch(Tip) 50.0 : -99.085995 -7.3467e-15 -1.2463e-29
-Branch(Tip) 90.0 : -99.085995 -7.3467e-15 -2.2150e-31
+Branch(Tip) 0.1 : -91.023442 -1.1275e+00 5.6630e+01
+Branch(Tip) 0.2 : -91.236562 3.1827e+00 1.5090e+01
+Branch(Tip) 0.5 : -93.163026 4.7942e+00 -1.1137e+00
+Branch(Tip) 0.9 : -95.560471 3.4605e+00 -2.7172e+00
+Branch(Tip) 1.5 : -97.637397 1.5532e+00 -1.6077e+00
+Branch(Tip) 5.0 : -99.077667 8.2069e-03 -8.1580e-03
+Branch(Tip) 10.0 : -99.085987 7.6761e-06 -7.4554e-06
+Branch(Tip) 50.0 : -99.085995 -5.1427e-15 -6.1068e-30
+Branch(Tip) 90.0 : -99.085995 -5.1427e-15 -1.0853e-31
Test -91.236562 = -91.236562
TEST alpha(ncats) = 0.75( 1) ; pinv = 0.60
1.000000
-Branch 0.1 : -97.395496 4.1869e-01 4.1576e+01
-Branch 0.2 : -97.566231 2.4650e+00 7.9705e+00
-Branch 0.5 : -98.337703 2.1781e+00 -3.8532e+00
-Branch 0.9 : -98.930700 9.0932e-01 -2.1922e+00
-Branch 1.5 : -99.215328 2.0430e-01 -5.1302e-01
-Branch 5.0 : -99.297308 3.8535e-05 -9.3567e-05
-Branch 10.0 : -99.297324 2.0653e-10 -5.0132e-10
-Branch 50.0 : -99.297324 -1.1880e-14 -1.7296e-31
-Branch 90.0 : -99.297324 -1.1880e-14 -1.7296e-31
+Branch 0.1 : -97.395496 1.6748e-01 6.6521e+00
+Branch 0.2 : -97.566231 9.8602e-01 1.2753e+00
+Branch 0.5 : -98.337703 8.7125e-01 -6.1652e-01
+Branch 0.9 : -98.930700 3.6373e-01 -3.5075e-01
+Branch 1.5 : -99.215328 8.1721e-02 -8.2083e-02
+Branch 5.0 : -99.297308 1.5414e-05 -1.4971e-05
+Branch 10.0 : -99.297324 8.2613e-11 -8.0212e-11
+Branch 50.0 : -99.297324 -4.7521e-15 -2.7673e-32
+Branch 90.0 : -99.297324 -4.7521e-15 -2.7673e-32
Test -97.395496 = -97.395496
-Branch(Tip) 0.1 : -95.225032 7.2632e+00 7.3170e+01
-Branch(Tip) 0.2 : -96.169157 1.0605e+01 9.2719e+00
-Branch(Tip) 0.5 : -99.100065 7.8974e+00 -1.4893e+01
-Branch(Tip) 0.9 : -101.205774 3.1182e+00 -8.1068e+00
-Branch(Tip) 1.5 : -102.137369 6.1893e-01 -1.6698e+00
-Branch(Tip) 5.0 : -102.372957 9.9808e-05 -2.4251e-04
-Branch(Tip) 10.0 : -102.372998 5.3436e-10 -1.2970e-09
-Branch(Tip) 50.0 : -102.372998 -1.1896e-14 -1.8500e-31
-Branch(Tip) 90.0 : -102.372998 -1.1896e-14 -1.8500e-31
+Branch(Tip) 0.1 : -95.225032 2.9053e+00 1.1707e+01
+Branch(Tip) 0.2 : -96.169157 4.2420e+00 1.4835e+00
+Branch(Tip) 0.5 : -99.100065 3.1590e+00 -2.3830e+00
+Branch(Tip) 0.9 : -101.205774 1.2473e+00 -1.2971e+00
+Branch(Tip) 1.5 : -102.137369 2.4757e-01 -2.6717e-01
+Branch(Tip) 5.0 : -102.372957 3.9923e-05 -3.8801e-05
+Branch(Tip) 10.0 : -102.372998 2.1374e-10 -2.0752e-10
+Branch(Tip) 50.0 : -102.372998 -4.7584e-15 -2.9600e-32
+Branch(Tip) 90.0 : -102.372998 -4.7584e-15 -2.9600e-32
Test -96.169157 = -96.169157
TEST alpha(ncats) = 0.75( 1) ; pinv = 0.90
1.000000
-Branch 0.1 : -121.077217 8.8195e-01 -8.6903e+00
-Branch 0.2 : -121.133222 3.2761e-01 -3.2488e+00
-Branch 0.5 : -121.164660 1.7097e-02 -1.6709e-01
-Branch 0.9 : -121.166378 3.4811e-04 -3.3822e-03
-Branch 1.5 : -121.166414 1.0264e-06 -9.9656e-06
-Branch 5.0 : -121.166414 -4.6680e-14 -1.7414e-20
-Branch 10.0 : -121.166414 -4.6680e-14 -1.6772e-31
-Branch 50.0 : -121.166414 -4.6680e-14 -1.6772e-31
-Branch 90.0 : -121.166414 -4.6680e-14 -1.6772e-31
+Branch 0.1 : -121.077217 8.8195e-02 -8.6903e-02
+Branch 0.2 : -121.133222 3.2761e-02 -3.2488e-02
+Branch 0.5 : -121.164660 1.7097e-03 -1.6709e-03
+Branch 0.9 : -121.166378 3.4811e-05 -3.3822e-05
+Branch 1.5 : -121.166414 1.0264e-07 -9.9656e-08
+Branch 5.0 : -121.166414 -4.6680e-15 -1.7414e-22
+Branch 10.0 : -121.166414 -4.6680e-15 -1.6772e-33
+Branch 50.0 : -121.166414 -4.6680e-15 -1.6772e-33
+Branch 90.0 : -121.166414 -4.6680e-15 -1.6772e-33
Test -121.077217 = -121.077217
-Branch(Tip) 0.1 : -119.215967 2.0918e+01 -1.9042e+02
-Branch(Tip) 0.2 : -120.551659 7.6462e+00 -8.1447e+01
-Branch(Tip) 0.5 : -121.236738 3.2182e-01 -3.2758e+00
-Branch(Tip) 0.9 : -121.268238 6.1290e-03 -5.9820e-02
-Branch(Tip) 1.5 : -121.268865 1.7939e-05 -1.7419e-04
-Branch(Tip) 5.0 : -121.268867 -4.6680e-14 -3.0427e-19
-Branch(Tip) 10.0 : -121.268867 -4.6680e-14 -1.6835e-31
-Branch(Tip) 50.0 : -121.268867 -4.6680e-14 -1.6835e-31
-Branch(Tip) 90.0 : -121.268867 -4.6680e-14 -1.6835e-31
+Branch(Tip) 0.1 : -119.215967 2.0918e+00 -1.9042e+00
+Branch(Tip) 0.2 : -120.551659 7.6462e-01 -8.1447e-01
+Branch(Tip) 0.5 : -121.236738 3.2182e-02 -3.2758e-02
+Branch(Tip) 0.9 : -121.268238 6.1290e-04 -5.9820e-04
+Branch(Tip) 1.5 : -121.268865 1.7939e-06 -1.7419e-06
+Branch(Tip) 5.0 : -121.268867 -4.6680e-15 -3.0427e-21
+Branch(Tip) 10.0 : -121.268867 -4.6680e-15 -1.6835e-33
+Branch(Tip) 50.0 : -121.268867 -4.6680e-15 -1.6835e-33
+Branch(Tip) 90.0 : -121.268867 -4.6680e-15 -1.6835e-33
Test -120.551659 = -120.551659
@@ -229,75 +229,75 @@ Test -90.363715 = -90.363715
TEST alpha(ncats) = 1.50( 1) ; pinv = 0.30
1.000000
-Branch 0.1 : -91.991139 -3.1754e+00 7.2285e+01
-Branch 0.2 : -91.904873 6.2551e-01 1.9136e+01
-Branch 0.5 : -92.470985 2.3105e+00 -1.0281e-01
-Branch 0.9 : -93.298269 1.7182e+00 -1.9287e+00
-Branch 1.5 : -94.021985 7.8156e-01 -1.1099e+00
-Branch 5.0 : -94.557860 5.1732e-03 -7.2440e-03
-Branch 10.0 : -94.561564 4.9557e-06 -6.8744e-06
-Branch 50.0 : -94.561568 -7.3058e-15 -5.7432e-30
-Branch 90.0 : -94.561568 -7.3058e-15 -2.0891e-31
+Branch 0.1 : -91.991139 -2.2228e+00 3.5420e+01
+Branch 0.2 : -91.904873 4.3786e-01 9.3766e+00
+Branch 0.5 : -92.470985 1.6173e+00 -5.0374e-02
+Branch 0.9 : -93.298269 1.2028e+00 -9.4509e-01
+Branch 1.5 : -94.021985 5.4709e-01 -5.4388e-01
+Branch 5.0 : -94.557860 3.6212e-03 -3.5496e-03
+Branch 10.0 : -94.561564 3.4690e-06 -3.3685e-06
+Branch 50.0 : -94.561568 -5.1141e-15 -2.8141e-30
+Branch 90.0 : -94.561568 -5.1141e-15 -1.0236e-31
Test -91.991139 = -91.991139
-Branch(Tip) 0.1 : -91.023442 -1.6107e+00 1.1557e+02
-Branch(Tip) 0.2 : -91.236562 4.5468e+00 3.0796e+01
-Branch(Tip) 0.5 : -93.163026 6.8489e+00 -2.2728e+00
-Branch(Tip) 0.9 : -95.560471 4.9436e+00 -5.5454e+00
-Branch(Tip) 1.5 : -97.637397 2.2189e+00 -3.2810e+00
-Branch(Tip) 5.0 : -99.077667 1.1724e-02 -1.6649e-02
-Branch(Tip) 10.0 : -99.085987 1.0966e-05 -1.5215e-05
-Branch(Tip) 50.0 : -99.085995 -7.3467e-15 -1.2463e-29
-Branch(Tip) 90.0 : -99.085995 -7.3467e-15 -2.2150e-31
+Branch(Tip) 0.1 : -91.023442 -1.1275e+00 5.6630e+01
+Branch(Tip) 0.2 : -91.236562 3.1827e+00 1.5090e+01
+Branch(Tip) 0.5 : -93.163026 4.7942e+00 -1.1137e+00
+Branch(Tip) 0.9 : -95.560471 3.4605e+00 -2.7172e+00
+Branch(Tip) 1.5 : -97.637397 1.5532e+00 -1.6077e+00
+Branch(Tip) 5.0 : -99.077667 8.2069e-03 -8.1580e-03
+Branch(Tip) 10.0 : -99.085987 7.6761e-06 -7.4554e-06
+Branch(Tip) 50.0 : -99.085995 -5.1427e-15 -6.1068e-30
+Branch(Tip) 90.0 : -99.085995 -5.1427e-15 -1.0853e-31
Test -91.236562 = -91.236562
TEST alpha(ncats) = 1.50( 1) ; pinv = 0.60
1.000000
-Branch 0.1 : -97.395496 4.1869e-01 4.1576e+01
-Branch 0.2 : -97.566231 2.4650e+00 7.9705e+00
-Branch 0.5 : -98.337703 2.1781e+00 -3.8532e+00
-Branch 0.9 : -98.930700 9.0932e-01 -2.1922e+00
-Branch 1.5 : -99.215328 2.0430e-01 -5.1302e-01
-Branch 5.0 : -99.297308 3.8535e-05 -9.3567e-05
-Branch 10.0 : -99.297324 2.0653e-10 -5.0132e-10
-Branch 50.0 : -99.297324 -1.1880e-14 -1.7296e-31
-Branch 90.0 : -99.297324 -1.1880e-14 -1.7296e-31
+Branch 0.1 : -97.395496 1.6748e-01 6.6521e+00
+Branch 0.2 : -97.566231 9.8602e-01 1.2753e+00
+Branch 0.5 : -98.337703 8.7125e-01 -6.1652e-01
+Branch 0.9 : -98.930700 3.6373e-01 -3.5075e-01
+Branch 1.5 : -99.215328 8.1721e-02 -8.2083e-02
+Branch 5.0 : -99.297308 1.5414e-05 -1.4971e-05
+Branch 10.0 : -99.297324 8.2613e-11 -8.0212e-11
+Branch 50.0 : -99.297324 -4.7521e-15 -2.7673e-32
+Branch 90.0 : -99.297324 -4.7521e-15 -2.7673e-32
Test -97.395496 = -97.395496
-Branch(Tip) 0.1 : -95.225032 7.2632e+00 7.3170e+01
-Branch(Tip) 0.2 : -96.169157 1.0605e+01 9.2719e+00
-Branch(Tip) 0.5 : -99.100065 7.8974e+00 -1.4893e+01
-Branch(Tip) 0.9 : -101.205774 3.1182e+00 -8.1068e+00
-Branch(Tip) 1.5 : -102.137369 6.1893e-01 -1.6698e+00
-Branch(Tip) 5.0 : -102.372957 9.9808e-05 -2.4251e-04
-Branch(Tip) 10.0 : -102.372998 5.3436e-10 -1.2970e-09
-Branch(Tip) 50.0 : -102.372998 -1.1896e-14 -1.8500e-31
-Branch(Tip) 90.0 : -102.372998 -1.1896e-14 -1.8500e-31
+Branch(Tip) 0.1 : -95.225032 2.9053e+00 1.1707e+01
+Branch(Tip) 0.2 : -96.169157 4.2420e+00 1.4835e+00
+Branch(Tip) 0.5 : -99.100065 3.1590e+00 -2.3830e+00
+Branch(Tip) 0.9 : -101.205774 1.2473e+00 -1.2971e+00
+Branch(Tip) 1.5 : -102.137369 2.4757e-01 -2.6717e-01
+Branch(Tip) 5.0 : -102.372957 3.9923e-05 -3.8801e-05
+Branch(Tip) 10.0 : -102.372998 2.1374e-10 -2.0752e-10
+Branch(Tip) 50.0 : -102.372998 -4.7584e-15 -2.9600e-32
+Branch(Tip) 90.0 : -102.372998 -4.7584e-15 -2.9600e-32
Test -96.169157 = -96.169157
TEST alpha(ncats) = 1.50( 1) ; pinv = 0.90
1.000000
-Branch 0.1 : -121.077217 8.8195e-01 -8.6903e+00
-Branch 0.2 : -121.133222 3.2761e-01 -3.2488e+00
-Branch 0.5 : -121.164660 1.7097e-02 -1.6709e-01
-Branch 0.9 : -121.166378 3.4811e-04 -3.3822e-03
-Branch 1.5 : -121.166414 1.0264e-06 -9.9656e-06
-Branch 5.0 : -121.166414 -4.6680e-14 -1.7414e-20
-Branch 10.0 : -121.166414 -4.6680e-14 -1.6772e-31
-Branch 50.0 : -121.166414 -4.6680e-14 -1.6772e-31
-Branch 90.0 : -121.166414 -4.6680e-14 -1.6772e-31
+Branch 0.1 : -121.077217 8.8195e-02 -8.6903e-02
+Branch 0.2 : -121.133222 3.2761e-02 -3.2488e-02
+Branch 0.5 : -121.164660 1.7097e-03 -1.6709e-03
+Branch 0.9 : -121.166378 3.4811e-05 -3.3822e-05
+Branch 1.5 : -121.166414 1.0264e-07 -9.9656e-08
+Branch 5.0 : -121.166414 -4.6680e-15 -1.7414e-22
+Branch 10.0 : -121.166414 -4.6680e-15 -1.6772e-33
+Branch 50.0 : -121.166414 -4.6680e-15 -1.6772e-33
+Branch 90.0 : -121.166414 -4.6680e-15 -1.6772e-33
Test -121.077217 = -121.077217
-Branch(Tip) 0.1 : -119.215967 2.0918e+01 -1.9042e+02
-Branch(Tip) 0.2 : -120.551659 7.6462e+00 -8.1447e+01
-Branch(Tip) 0.5 : -121.236738 3.2182e-01 -3.2758e+00
-Branch(Tip) 0.9 : -121.268238 6.1290e-03 -5.9820e-02
-Branch(Tip) 1.5 : -121.268865 1.7939e-05 -1.7419e-04
-Branch(Tip) 5.0 : -121.268867 -4.6680e-14 -3.0427e-19
-Branch(Tip) 10.0 : -121.268867 -4.6680e-14 -1.6835e-31
-Branch(Tip) 50.0 : -121.268867 -4.6680e-14 -1.6835e-31
-Branch(Tip) 90.0 : -121.268867 -4.6680e-14 -1.6835e-31
+Branch(Tip) 0.1 : -119.215967 2.0918e+00 -1.9042e+00
+Branch(Tip) 0.2 : -120.551659 7.6462e-01 -8.1447e-01
+Branch(Tip) 0.5 : -121.236738 3.2182e-02 -3.2758e-02
+Branch(Tip) 0.9 : -121.268238 6.1290e-04 -5.9820e-04
+Branch(Tip) 1.5 : -121.268865 1.7939e-06 -1.7419e-06
+Branch(Tip) 5.0 : -121.268867 -4.6680e-15 -3.0427e-21
+Branch(Tip) 10.0 : -121.268867 -4.6680e-15 -1.6835e-33
+Branch(Tip) 50.0 : -121.268867 -4.6680e-15 -1.6835e-33
+Branch(Tip) 90.0 : -121.268867 -4.6680e-15 -1.6835e-33
Test -120.551659 = -120.551659
FREE CREATE
@@ -330,75 +330,75 @@ Test -92.278908 = -92.278908
TEST alpha(ncats) = 0.10( 2) ; pinv = 0.30
0.000539 1.999461
-Branch 0.1 : -97.913270 1.3977e+00 3.1666e+01
-Branch 0.2 : -98.146580 2.8283e+00 3.9246e+00
-Branch 0.5 : -98.915548 1.9580e+00 -4.5094e+00
-Branch 0.9 : -99.405679 6.7225e-01 -1.9429e+00
-Branch 1.5 : -99.592896 1.0475e-01 -3.5753e-01
-Branch 5.0 : -99.566885 -1.9303e-02 4.4119e-04
-Branch 10.0 : -99.475721 -1.7227e-02 3.7601e-04
-Branch 50.0 : -98.987600 -8.7894e-03 1.1807e-04
-Branch 90.0 : -98.709409 -5.5205e-03 5.6434e-05
+Branch 0.1 : -97.913270 9.7842e-01 1.5516e+01
+Branch 0.2 : -98.146580 1.9798e+00 1.9231e+00
+Branch 0.5 : -98.915548 1.3706e+00 -2.2096e+00
+Branch 0.9 : -99.405679 4.7058e-01 -9.5201e-01
+Branch 1.5 : -99.592896 7.3326e-02 -1.7519e-01
+Branch 5.0 : -99.566885 -1.3512e-02 2.1618e-04
+Branch 10.0 : -99.475721 -1.2059e-02 1.8424e-04
+Branch 50.0 : -98.987600 -6.1526e-03 5.7856e-05
+Branch 90.0 : -98.709409 -3.8644e-03 2.7652e-05
Test -97.913270 = -97.913270
-Branch(Tip) 0.1 : -95.423060 9.9272e+00 5.9420e+01
-Branch(Tip) 0.2 : -96.576107 1.2190e+01 1.3528e-01
-Branch(Tip) 0.5 : -99.656622 7.5952e+00 -1.8335e+01
-Branch(Tip) 0.9 : -101.516171 2.4569e+00 -7.5041e+00
-Branch(Tip) 1.5 : -102.187706 3.8862e-01 -1.1719e+00
-Branch(Tip) 5.0 : -102.325193 1.8710e-03 -5.5971e-05
-Branch(Tip) 10.0 : -102.334439 1.8441e-03 -1.4460e-06
-Branch(Tip) 50.0 : -102.407052 1.7868e-03 -1.4203e-06
-Branch(Tip) 90.0 : -102.477394 1.7305e-03 -1.3938e-06
+Branch(Tip) 0.1 : -95.423060 6.9491e+00 2.9116e+01
+Branch(Tip) 0.2 : -96.576107 8.5330e+00 6.6287e-02
+Branch(Tip) 0.5 : -99.656622 5.3166e+00 -8.9843e+00
+Branch(Tip) 0.9 : -101.516171 1.7198e+00 -3.6770e+00
+Branch(Tip) 1.5 : -102.187706 2.7204e-01 -5.7423e-01
+Branch(Tip) 5.0 : -102.325193 1.3097e-03 -2.7426e-05
+Branch(Tip) 10.0 : -102.334439 1.2909e-03 -7.0853e-07
+Branch(Tip) 50.0 : -102.407052 1.2507e-03 -6.9593e-07
+Branch(Tip) 90.0 : -102.477394 1.2113e-03 -6.8298e-07
Test -96.576107 = -96.576107
TEST alpha(ncats) = 0.10( 2) ; pinv = 0.60
0.000539 1.999461
-Branch 0.1 : -107.654926 3.5883e+00 -7.6412e+00
-Branch 0.2 : -107.966500 2.6031e+00 -1.0336e+01
-Branch 0.5 : -108.387430 5.7129e-01 -3.4296e+00
-Branch 0.9 : -108.457936 -3.1588e-02 -4.7050e-01
-Branch 1.5 : -108.401589 -1.1588e-01 -1.0716e-02
-Branch 5.0 : -108.051393 -8.3951e-02 7.4374e-03
-Branch 10.0 : -107.704312 -5.7975e-02 3.6289e-03
-Branch 50.0 : -106.566624 -1.5500e-02 3.0930e-04
-Branch 90.0 : -106.116526 -8.2959e-03 1.0442e-04
+Branch 0.1 : -107.654926 1.4353e+00 -1.2226e+00
+Branch 0.2 : -107.966500 1.0413e+00 -1.6537e+00
+Branch 0.5 : -108.387430 2.2852e-01 -5.4874e-01
+Branch 0.9 : -108.457936 -1.2635e-02 -7.5281e-02
+Branch 1.5 : -108.401589 -4.6351e-02 -1.7146e-03
+Branch 5.0 : -108.051393 -3.3581e-02 1.1900e-03
+Branch 10.0 : -107.704312 -2.3190e-02 5.8062e-04
+Branch 50.0 : -106.566624 -6.1998e-03 4.9488e-05
+Branch 90.0 : -106.116526 -3.3184e-03 1.6708e-05
Test -107.654926 = -107.654926
-Branch(Tip) 0.1 : -104.333811 2.0831e+01 -2.8183e+01
-Branch(Tip) 0.2 : -106.195692 1.5952e+01 -5.7317e+01
-Branch(Tip) 0.5 : -108.858155 3.8465e+00 -2.0495e+01
-Branch(Tip) 0.9 : -109.491239 4.5564e-01 -2.3717e+00
-Branch(Tip) 1.5 : -109.576689 2.3676e-02 -1.0821e-01
-Branch(Tip) 5.0 : -109.587233 1.7291e-03 -3.1628e-06
-Branch(Tip) 10.0 : -109.595839 1.7134e-03 -3.1333e-06
-Branch(Tip) 50.0 : -109.661921 1.5920e-03 -2.9361e-06
-Branch(Tip) 90.0 : -109.723303 1.4784e-03 -2.7473e-06
+Branch(Tip) 0.1 : -104.333811 8.3326e+00 -4.5093e+00
+Branch(Tip) 0.2 : -106.195692 6.3809e+00 -9.1708e+00
+Branch(Tip) 0.5 : -108.858155 1.5386e+00 -3.2793e+00
+Branch(Tip) 0.9 : -109.491239 1.8226e-01 -3.7948e-01
+Branch(Tip) 1.5 : -109.576689 9.4705e-03 -1.7314e-02
+Branch(Tip) 5.0 : -109.587233 6.9164e-04 -5.0605e-07
+Branch(Tip) 10.0 : -109.595839 6.8535e-04 -5.0132e-07
+Branch(Tip) 50.0 : -109.661921 6.3681e-04 -4.6977e-07
+Branch(Tip) 90.0 : -109.723303 5.9135e-04 -4.3956e-07
Test -106.195692 = -106.195692
TEST alpha(ncats) = 0.10( 2) ; pinv = 0.90
0.000539 1.999461
-Branch 0.1 : -128.498361 -1.1369e+00 1.2134e+00
-Branch 0.2 : -128.390505 -1.0231e+00 1.0477e+00
-Branch 0.5 : -128.123204 -7.8018e-01 6.2056e-01
-Branch 0.9 : -127.852322 -5.9142e-01 3.5881e-01
-Branch 1.5 : -127.549826 -4.3306e-01 1.9414e-01
-Branch 5.0 : -126.643122 -1.6586e-01 3.0007e-02
-Branch 10.0 : -126.055862 -8.5569e-02 8.5865e-03
-Branch 50.0 : -124.770415 -1.3673e-02 3.6027e-04
-Branch 90.0 : -124.409990 -5.9683e-03 1.0003e-04
+Branch 0.1 : -128.498361 -1.1369e-01 1.2134e-02
+Branch 0.2 : -128.390505 -1.0231e-01 1.0477e-02
+Branch 0.5 : -128.123204 -7.8018e-02 6.2056e-03
+Branch 0.9 : -127.852322 -5.9142e-02 3.5881e-03
+Branch 1.5 : -127.549826 -4.3306e-02 1.9414e-03
+Branch 5.0 : -126.643122 -1.6586e-02 3.0007e-04
+Branch 10.0 : -126.055862 -8.5569e-03 8.5865e-05
+Branch 50.0 : -124.770415 -1.3673e-03 3.6027e-06
+Branch 90.0 : -124.409990 -5.9683e-04 1.0003e-06
Test -128.498361 = -128.498361
-Branch(Tip) 0.1 : -128.292064 4.3505e+00 -9.3371e+01
-Branch(Tip) 0.2 : -128.473287 5.4538e-01 -1.0939e+01
-Branch(Tip) 0.5 : -128.502162 8.1647e-03 -2.8670e-02
-Branch(Tip) 0.9 : -128.504911 6.6741e-03 -5.9535e-05
-Branch(Tip) 1.5 : -128.508906 6.6451e-03 -4.7259e-05
-Branch(Tip) 5.0 : -128.531877 6.4815e-03 -4.6238e-05
-Branch(Tip) 10.0 : -128.563713 6.2539e-03 -4.4806e-05
-Branch(Tip) 50.0 : -128.780918 4.6754e-03 -3.4449e-05
-Branch(Tip) 90.0 : -128.942743 3.4718e-03 -2.6049e-05
+Branch(Tip) 0.1 : -128.292064 4.3505e-01 -9.3371e-01
+Branch(Tip) 0.2 : -128.473287 5.4538e-02 -1.0939e-01
+Branch(Tip) 0.5 : -128.502162 8.1647e-04 -2.8670e-04
+Branch(Tip) 0.9 : -128.504911 6.6741e-04 -5.9535e-07
+Branch(Tip) 1.5 : -128.508906 6.6451e-04 -4.7259e-07
+Branch(Tip) 5.0 : -128.531877 6.4815e-04 -4.6238e-07
+Branch(Tip) 10.0 : -128.563713 6.2539e-04 -4.4806e-07
+Branch(Tip) 50.0 : -128.780918 4.6754e-04 -3.4449e-07
+Branch(Tip) 90.0 : -128.942743 3.4718e-04 -2.6049e-07
Test -128.473287 = -128.473287
@@ -430,75 +430,75 @@ Test -90.370688 = -90.370688
TEST alpha(ncats) = 0.75( 2) ; pinv = 0.30
0.235541 1.764459
-Branch 0.1 : -93.121854 -4.7486e+00 7.1691e+01
-Branch 0.2 : -92.873444 -1.0459e+00 1.8278e+01
-Branch 0.5 : -92.934815 7.2378e-01 1.1149e+00
-Branch 0.9 : -93.252311 7.8758e-01 -1.9708e-01
-Branch 1.5 : -93.685962 6.5989e-01 -1.9525e-01
-Branch 5.0 : -95.057793 1.9078e-01 -7.6470e-02
-Branch 10.0 : -95.469931 2.6560e-02 -1.0003e-02
-Branch 50.0 : -95.543803 4.3439e-08 -1.4191e-08
-Branch 90.0 : -95.543803 8.3110e-14 -2.9982e-14
+Branch 0.1 : -93.121854 -3.3240e+00 3.5128e+01
+Branch 0.2 : -92.873444 -7.3215e-01 8.9564e+00
+Branch 0.5 : -92.934815 5.0664e-01 5.4630e-01
+Branch 0.9 : -93.252311 5.5130e-01 -9.6571e-02
+Branch 1.5 : -93.685962 4.6192e-01 -9.5672e-02
+Branch 5.0 : -95.057793 1.3355e-01 -3.7470e-02
+Branch 10.0 : -95.469931 1.8592e-02 -4.9014e-03
+Branch 50.0 : -95.543803 3.0407e-08 -6.9538e-09
+Branch 90.0 : -95.543803 5.8177e-14 -1.4691e-14
Test -93.121854 = -93.121854
-Branch(Tip) 0.1 : -92.051000 1.3832e+00 7.6240e+01
-Branch(Tip) 0.2 : -92.424643 5.1109e+00 1.4334e+01
-Branch(Tip) 0.5 : -94.029999 4.7549e+00 -5.8633e+00
-Branch(Tip) 0.9 : -95.516729 2.8698e+00 -3.2498e+00
-Branch(Tip) 1.5 : -96.832869 1.7316e+00 -1.0489e+00
-Branch(Tip) 5.0 : -99.972979 4.1677e-01 -1.6864e-01
-Branch(Tip) 10.0 : -100.861026 5.4893e-02 -2.1529e-02
-Branch(Tip) 50.0 : -101.008040 7.8194e-08 -2.5548e-08
-Branch(Tip) 90.0 : -101.008040 1.5604e-13 -5.3966e-14
+Branch(Tip) 0.1 : -92.051000 9.6827e-01 3.7357e+01
+Branch(Tip) 0.2 : -92.424643 3.5776e+00 7.0236e+00
+Branch(Tip) 0.5 : -94.029999 3.3285e+00 -2.8730e+00
+Branch(Tip) 0.9 : -95.516729 2.0089e+00 -1.5924e+00
+Branch(Tip) 1.5 : -96.832869 1.2121e+00 -5.1395e-01
+Branch(Tip) 5.0 : -99.972979 2.9174e-01 -8.2633e-02
+Branch(Tip) 10.0 : -100.861026 3.8425e-02 -1.0549e-02
+Branch(Tip) 50.0 : -101.008040 5.4736e-08 -1.2518e-08
+Branch(Tip) 90.0 : -101.008040 1.0923e-13 -2.6443e-14
Test -92.424643 = -92.424643
TEST alpha(ncats) = 0.75( 2) ; pinv = 0.60
0.235541 1.764459
-Branch 0.1 : -97.936100 -4.8534e+00 6.5909e+01
-Branch 0.2 : -97.660748 -1.4038e+00 1.7480e+01
-Branch 0.5 : -97.623089 4.9017e-01 1.9118e+00
-Branch 0.9 : -97.900858 7.8927e-01 1.3430e-01
-Branch 1.5 : -98.361777 7.0901e-01 -2.7177e-01
-Branch 5.0 : -99.461670 8.6754e-02 -5.5306e-02
-Branch 10.0 : -99.594917 4.1608e-03 -2.4372e-03
-Branch 50.0 : -99.602087 4.5567e-13 -2.6794e-13
-Branch 90.0 : -99.602087 -1.2995e-14 -3.1374e-23
+Branch 0.1 : -97.936100 -1.9414e+00 1.0545e+01
+Branch 0.2 : -97.660748 -5.6154e-01 2.7967e+00
+Branch 0.5 : -97.623089 1.9607e-01 3.0588e-01
+Branch 0.9 : -97.900858 3.1571e-01 2.1488e-02
+Branch 1.5 : -98.361777 2.8360e-01 -4.3484e-02
+Branch 5.0 : -99.461670 3.4702e-02 -8.8490e-03
+Branch 10.0 : -99.594917 1.6643e-03 -3.8996e-04
+Branch 50.0 : -99.602087 1.8227e-13 -4.2870e-14
+Branch 90.0 : -99.602087 -5.1980e-15 -5.0199e-24
Test -97.936100 = -97.936100
-Branch(Tip) 0.1 : -96.607480 5.6406e+00 2.9470e+01
-Branch(Tip) 0.2 : -97.232358 6.3108e+00 -5.3419e+00
-Branch(Tip) 0.5 : -98.761698 3.9868e+00 -5.6324e+00
-Branch(Tip) 0.9 : -100.047285 2.6843e+00 -1.8598e+00
-Branch(Tip) 1.5 : -101.399823 1.8993e+00 -1.0323e+00
-Branch(Tip) 5.0 : -104.144878 1.9582e-01 -1.3474e-01
-Branch(Tip) 10.0 : -104.427226 7.7707e-03 -4.7116e-03
-Branch(Tip) 50.0 : -104.440308 8.0616e-13 -4.6879e-13
-Branch(Tip) 90.0 : -104.440308 -1.3819e-14 -5.4893e-23
+Branch(Tip) 0.1 : -96.607480 2.2562e+00 4.7152e+00
+Branch(Tip) 0.2 : -97.232358 2.5243e+00 -8.5471e-01
+Branch(Tip) 0.5 : -98.761698 1.5947e+00 -9.0118e-01
+Branch(Tip) 0.9 : -100.047285 1.0737e+00 -2.9757e-01
+Branch(Tip) 1.5 : -101.399823 7.5972e-01 -1.6518e-01
+Branch(Tip) 5.0 : -104.144878 7.8329e-02 -2.1559e-02
+Branch(Tip) 10.0 : -104.427226 3.1083e-03 -7.5385e-04
+Branch(Tip) 50.0 : -104.440308 3.2247e-13 -7.5006e-14
+Branch(Tip) 90.0 : -104.440308 -5.5278e-15 -8.7829e-24
Test -97.232358 = -97.232358
TEST alpha(ncats) = 0.75( 2) ; pinv = 0.90
0.235541 1.764459
-Branch 0.1 : -115.827620 9.7694e-01 2.3830e+01
-Branch 0.2 : -115.999414 2.1449e+00 4.1596e+00
-Branch 0.5 : -116.625579 1.7232e+00 -3.1123e+00
-Branch 0.9 : -117.095655 7.2872e-01 -1.7033e+00
-Branch 1.5 : -117.328467 1.7359e-01 -4.1626e-01
-Branch 5.0 : -117.401740 5.2293e-05 -1.1966e-04
-Branch 10.0 : -117.401763 5.6526e-10 -1.2927e-09
-Branch 50.0 : -117.401763 -4.1944e-14 -7.7037e-29
-Branch 90.0 : -117.401763 -4.1944e-14 -7.7037e-29
+Branch 0.1 : -115.827620 9.7694e-02 2.3830e-01
+Branch 0.2 : -115.999414 2.1449e-01 4.1596e-02
+Branch 0.5 : -116.625579 1.7232e-01 -3.1123e-02
+Branch 0.9 : -117.095655 7.2872e-02 -1.7033e-02
+Branch 1.5 : -117.328467 1.7359e-02 -4.1626e-03
+Branch 5.0 : -117.401740 5.2293e-06 -1.1966e-06
+Branch 10.0 : -117.401763 5.6526e-11 -1.2927e-11
+Branch 50.0 : -117.401763 -4.1944e-15 -7.7037e-31
+Branch 90.0 : -117.401763 -4.1944e-15 -7.7037e-31
Test -115.827620 = -115.827620
-Branch(Tip) 0.1 : -113.666834 1.1913e+01 -2.0168e+01
-Branch(Tip) 0.2 : -114.771440 1.0262e+01 -1.4842e+01
-Branch(Tip) 0.5 : -117.200401 6.0293e+00 -1.2659e+01
-Branch(Tip) 0.9 : -118.782267 2.3358e+00 -5.9766e+00
-Branch(Tip) 1.5 : -119.489876 4.8375e-01 -1.2645e+00
-Branch(Tip) 5.0 : -119.681081 1.1924e-04 -2.7316e-04
-Branch(Tip) 10.0 : -119.681133 1.2864e-09 -2.9418e-09
-Branch(Tip) 50.0 : -119.681133 -4.4842e-14 -8.1173e-29
-Branch(Tip) 90.0 : -119.681133 -4.4842e-14 -8.1173e-29
+Branch(Tip) 0.1 : -113.666834 1.1913e+00 -2.0168e-01
+Branch(Tip) 0.2 : -114.771440 1.0262e+00 -1.4842e-01
+Branch(Tip) 0.5 : -117.200401 6.0293e-01 -1.2659e-01
+Branch(Tip) 0.9 : -118.782267 2.3358e-01 -5.9766e-02
+Branch(Tip) 1.5 : -119.489876 4.8375e-02 -1.2645e-02
+Branch(Tip) 5.0 : -119.681081 1.1924e-05 -2.7316e-06
+Branch(Tip) 10.0 : -119.681133 1.2864e-10 -2.9418e-11
+Branch(Tip) 50.0 : -119.681133 -4.4842e-15 -8.1173e-31
+Branch(Tip) 90.0 : -119.681133 -4.4842e-15 -8.1173e-31
Test -114.771440 = -114.771440
@@ -530,75 +530,75 @@ Test -90.134734 = -90.134734
TEST alpha(ncats) = 1.50( 2) ; pinv = 0.30
0.406939 1.593061
-Branch 0.1 : -92.365503 -4.4305e+00 7.4416e+01
-Branch 0.2 : -92.158930 -5.5052e-01 1.9496e+01
-Branch 0.5 : -92.399821 1.3649e+00 1.0928e+00
-Branch 0.9 : -92.954792 1.3055e+00 -6.6023e-01
-Branch 1.5 : -93.613996 9.0068e-01 -6.0254e-01
-Branch 5.0 : -94.808687 8.3033e-02 -5.4442e-02
-Branch 10.0 : -94.934462 3.8975e-03 -2.2704e-03
-Branch 50.0 : -94.941234 5.7319e-13 -3.2800e-13
-Branch 90.0 : -94.941234 -7.9445e-15 -5.1412e-23
+Branch 0.1 : -92.365503 -3.1013e+00 3.6464e+01
+Branch 0.2 : -92.158930 -3.8537e-01 9.5531e+00
+Branch 0.5 : -92.399821 9.5544e-01 5.3549e-01
+Branch 0.9 : -92.954792 9.1384e-01 -3.2351e-01
+Branch 1.5 : -93.613996 6.3048e-01 -2.9524e-01
+Branch 5.0 : -94.808687 5.8123e-02 -2.6677e-02
+Branch 10.0 : -94.934462 2.7282e-03 -1.1125e-03
+Branch 50.0 : -94.941234 4.0123e-13 -1.6072e-13
+Branch 90.0 : -94.941234 -5.5611e-15 -2.5192e-23
Test -92.365503 = -92.365503
-Branch(Tip) 0.1 : -91.401908 -1.4684e-01 9.0187e+01
-Branch(Tip) 0.2 : -91.674889 4.5195e+00 2.1222e+01
-Branch(Tip) 0.5 : -93.321916 5.3918e+00 -3.8037e+00
-Branch(Tip) 0.9 : -95.143857 3.7549e+00 -3.5476e+00
-Branch(Tip) 1.5 : -96.887847 2.2375e+00 -1.7556e+00
-Branch(Tip) 5.0 : -99.740373 1.8833e-01 -1.2932e-01
-Branch(Tip) 10.0 : -100.014059 7.7633e-03 -4.6411e-03
-Branch(Tip) 50.0 : -100.027312 1.0923e-12 -6.2119e-13
-Branch(Tip) 90.0 : -100.027312 -8.2680e-15 -9.7370e-23
+Branch(Tip) 0.1 : -91.401908 -1.0279e-01 4.4191e+01
+Branch(Tip) 0.2 : -91.674889 3.1636e+00 1.0399e+01
+Branch(Tip) 0.5 : -93.321916 3.7743e+00 -1.8638e+00
+Branch(Tip) 0.9 : -95.143857 2.6284e+00 -1.7383e+00
+Branch(Tip) 1.5 : -96.887847 1.5663e+00 -8.6024e-01
+Branch(Tip) 5.0 : -99.740373 1.3183e-01 -6.3366e-02
+Branch(Tip) 10.0 : -100.014059 5.4343e-03 -2.2741e-03
+Branch(Tip) 50.0 : -100.027312 7.6464e-13 -3.0438e-13
+Branch(Tip) 90.0 : -100.027312 -5.7876e-15 -4.7711e-23
Test -91.674889 = -91.674889
TEST alpha(ncats) = 1.50( 2) ; pinv = 0.60
0.406939 1.593061
-Branch 0.1 : -97.171584 -3.2326e+00 6.0546e+01
-Branch 0.2 : -97.041763 -6.1726e-02 1.5720e+01
-Branch 0.5 : -97.336267 1.3712e+00 4.4789e-01
-Branch 0.9 : -97.859335 1.1642e+00 -8.9853e-01
-Branch 1.5 : -98.400355 6.6311e-01 -6.8767e-01
-Branch 5.0 : -99.001427 1.5864e-02 -1.6254e-02
-Branch 10.0 : -99.017011 1.0722e-04 -1.0609e-04
-Branch 50.0 : -99.017120 -1.2069e-14 -7.3324e-22
-Branch 90.0 : -99.017120 -1.2069e-14 -2.9522e-30
+Branch 0.1 : -97.171584 -1.2930e+00 9.6874e+00
+Branch 0.2 : -97.041763 -2.4690e-02 2.5153e+00
+Branch 0.5 : -97.336267 5.4847e-01 7.1663e-02
+Branch 0.9 : -97.859335 4.6568e-01 -1.4376e-01
+Branch 1.5 : -98.400355 2.6525e-01 -1.1003e-01
+Branch 5.0 : -99.001427 6.3457e-03 -2.6006e-03
+Branch 10.0 : -99.017011 4.2887e-05 -1.6974e-05
+Branch 50.0 : -99.017120 -4.8277e-15 -1.1732e-22
+Branch 90.0 : -99.017120 -4.8277e-15 -4.7235e-31
Test -97.171584 = -97.171584
-Branch(Tip) 0.1 : -95.628921 5.4729e+00 4.7711e+01
-Branch(Tip) 0.2 : -96.306132 7.3545e+00 2.3421e+00
-Branch(Tip) 0.5 : -98.296099 5.5927e+00 -6.8435e+00
-Branch(Tip) 0.9 : -100.079782 3.5271e+00 -3.8500e+00
-Branch(Tip) 1.5 : -101.635271 1.8339e+00 -2.0434e+00
-Branch(Tip) 5.0 : -103.195410 3.3753e-02 -3.6226e-02
-Branch(Tip) 10.0 : -103.227529 2.0909e-04 -2.0754e-04
-Branch(Tip) 50.0 : -103.227740 -1.2661e-14 -1.4223e-21
-Branch(Tip) 90.0 : -103.227740 -1.2661e-14 -3.1640e-30
+Branch(Tip) 0.1 : -95.628921 2.1891e+00 7.6337e+00
+Branch(Tip) 0.2 : -96.306132 2.9418e+00 3.7473e-01
+Branch(Tip) 0.5 : -98.296099 2.2371e+00 -1.0950e+00
+Branch(Tip) 0.9 : -100.079782 1.4108e+00 -6.1600e-01
+Branch(Tip) 1.5 : -101.635271 7.3356e-01 -3.2695e-01
+Branch(Tip) 5.0 : -103.195410 1.3501e-02 -5.7961e-03
+Branch(Tip) 10.0 : -103.227529 8.3636e-05 -3.3207e-05
+Branch(Tip) 50.0 : -103.227740 -5.0645e-15 -2.2757e-22
+Branch(Tip) 90.0 : -103.227740 -5.0645e-15 -5.0625e-31
Test -96.306132 = -96.306132
TEST alpha(ncats) = 1.50( 2) ; pinv = 0.90
0.406939 1.593061
-Branch 0.1 : -118.388176 3.3285e+00 -6.0904e+00
-Branch 0.2 : -118.684617 2.5709e+00 -8.0133e+00
-Branch 0.5 : -119.158889 8.3886e-01 -3.3929e+00
-Branch 0.9 : -119.323933 1.6235e-01 -6.6596e-01
-Branch 1.5 : -119.360335 1.4316e-02 -5.7291e-02
-Branch 5.0 : -119.363929 1.3822e-08 -5.4610e-08
-Branch 10.0 : -119.363929 -4.3746e-14 -1.4390e-16
-Branch 50.0 : -119.363929 -4.3782e-14 -5.1622e-29
-Branch 90.0 : -119.363929 -4.3782e-14 -5.1622e-29
+Branch 0.1 : -118.388176 3.3285e-01 -6.0904e-02
+Branch 0.2 : -118.684617 2.5709e-01 -8.0133e-02
+Branch 0.5 : -119.158889 8.3886e-02 -3.3929e-02
+Branch 0.9 : -119.323933 1.6235e-02 -6.6596e-03
+Branch 1.5 : -119.360335 1.4316e-03 -5.7291e-04
+Branch 5.0 : -119.363929 1.3822e-09 -5.4610e-10
+Branch 10.0 : -119.363929 -4.3746e-15 -1.4390e-18
+Branch 50.0 : -119.363929 -4.3782e-15 -5.1622e-31
+Branch 90.0 : -119.363929 -4.3782e-15 -5.1622e-31
Test -118.388176 = -118.388176
-Branch(Tip) 0.1 : -115.700304 1.8043e+01 -6.1624e+01
-Branch(Tip) 0.2 : -117.224520 1.2696e+01 -4.6272e+01
-Branch(Tip) 0.5 : -119.461959 3.7145e+00 -1.6498e+01
-Branch(Tip) 0.9 : -120.149886 6.1083e-01 -2.7204e+00
-Branch(Tip) 1.5 : -120.279901 4.7245e-02 -1.9437e-01
-Branch(Tip) 5.0 : -120.291550 4.3449e-08 -1.7166e-07
-Branch(Tip) 10.0 : -120.291550 -4.5078e-14 -4.5233e-16
-Branch(Tip) 50.0 : -120.291550 -4.5192e-14 -5.2534e-29
-Branch(Tip) 90.0 : -120.291550 -4.5192e-14 -5.2534e-29
+Branch(Tip) 0.1 : -115.700304 1.8043e+00 -6.1624e-01
+Branch(Tip) 0.2 : -117.224520 1.2696e+00 -4.6272e-01
+Branch(Tip) 0.5 : -119.461959 3.7145e-01 -1.6498e-01
+Branch(Tip) 0.9 : -120.149886 6.1083e-02 -2.7204e-02
+Branch(Tip) 1.5 : -120.279901 4.7245e-03 -1.9437e-03
+Branch(Tip) 5.0 : -120.291550 4.3449e-09 -1.7166e-09
+Branch(Tip) 10.0 : -120.291550 -4.5078e-15 -4.5233e-18
+Branch(Tip) 50.0 : -120.291550 -4.5192e-15 -5.2534e-31
+Branch(Tip) 90.0 : -120.291550 -4.5192e-15 -5.2534e-31
Test -117.224520 = -117.224520
FREE CREATE
@@ -631,75 +631,75 @@ Test -97.589664 = -97.589664
TEST alpha(ncats) = 0.10( 4) ; pinv = 0.30
0.000001 0.001078 0.093753 3.905168
-Branch 0.1 : -102.524121 -5.1193e+00 4.7437e+01
-Branch 0.2 : -102.164345 -2.6152e+00 1.2810e+01
-Branch 0.5 : -101.677913 -1.0684e+00 2.2701e+00
-Branch 0.9 : -101.382191 -4.9565e-01 9.1334e-01
-Branch 1.5 : -101.204521 -1.5141e-01 3.4790e-01
-Branch 5.0 : -101.427451 1.2417e-01 3.3476e-05
-Branch 10.0 : -101.947045 7.6990e-02 -1.0609e-02
-Branch 50.0 : -102.468272 4.0833e-04 -3.3633e-05
-Branch 90.0 : -102.476814 1.8096e-04 4.8273e-07
+Branch 0.1 : -102.524121 -3.5835e+00 2.3244e+01
+Branch 0.2 : -102.164345 -1.8306e+00 6.2768e+00
+Branch 0.5 : -101.677913 -7.4790e-01 1.1123e+00
+Branch 0.9 : -101.382191 -3.4695e-01 4.4754e-01
+Branch 1.5 : -101.204521 -1.0599e-01 1.7047e-01
+Branch 5.0 : -101.427451 8.6921e-02 1.6403e-05
+Branch 10.0 : -101.947045 5.3893e-02 -5.1984e-03
+Branch 50.0 : -102.468272 2.8583e-04 -1.6480e-05
+Branch 90.0 : -102.476814 1.2667e-04 2.3654e-07
Test -102.524121 = -102.524121
-Branch(Tip) 0.1 : -100.963776 1.0734e+01 -2.5933e+01
-Branch(Tip) 0.2 : -101.872171 7.3343e+00 -3.3770e+01
-Branch(Tip) 0.5 : -103.043717 1.8518e+00 -7.1026e+00
-Branch(Tip) 0.9 : -103.486265 7.4912e-01 -7.3979e-01
-Branch(Tip) 1.5 : -103.872911 5.9505e-01 -8.6473e-02
-Branch(Tip) 5.0 : -105.578046 3.8974e-01 -5.1164e-02
-Branch(Tip) 10.0 : -106.979422 1.8927e-01 -2.9287e-02
-Branch(Tip) 50.0 : -108.211328 2.1999e-03 -6.2753e-05
-Branch(Tip) 90.0 : -108.282261 1.6243e-03 -3.7080e-06
+Branch(Tip) 0.1 : -100.963776 7.5135e+00 -1.2707e+01
+Branch(Tip) 0.2 : -101.872171 5.1340e+00 -1.6547e+01
+Branch(Tip) 0.5 : -103.043717 1.2962e+00 -3.4803e+00
+Branch(Tip) 0.9 : -103.486265 5.2438e-01 -3.6250e-01
+Branch(Tip) 1.5 : -103.872911 4.1653e-01 -4.2372e-02
+Branch(Tip) 5.0 : -105.578046 2.7282e-01 -2.5070e-02
+Branch(Tip) 10.0 : -106.979422 1.3249e-01 -1.4351e-02
+Branch(Tip) 50.0 : -108.211328 1.5399e-03 -3.0749e-05
+Branch(Tip) 90.0 : -108.282261 1.1370e-03 -1.8169e-06
Test -101.872171 = -101.872171
TEST alpha(ncats) = 0.10( 4) ; pinv = 0.60
0.000001 0.001078 0.093753 3.905168
-Branch 0.1 : -108.052524 -6.7950e+00 6.1862e+01
-Branch 0.2 : -107.577472 -3.3743e+00 1.8902e+01
-Branch 0.5 : -107.028652 -9.5722e-01 3.4067e+00
-Branch 0.9 : -106.826226 -2.0507e-01 1.0096e+00
-Branch 1.5 : -106.824429 1.3035e-01 2.8714e-01
-Branch 5.0 : -107.640758 1.9978e-01 -4.0049e-02
-Branch 10.0 : -108.232080 5.9213e-02 -1.5424e-02
-Branch 50.0 : -108.419823 -1.2476e-03 7.4742e-06
-Branch 90.0 : -108.375808 -9.6841e-04 5.7705e-06
+Branch 0.1 : -108.052524 -2.7180e+00 9.8980e+00
+Branch 0.2 : -107.577472 -1.3497e+00 3.0244e+00
+Branch 0.5 : -107.028652 -3.8289e-01 5.4507e-01
+Branch 0.9 : -106.826226 -8.2029e-02 1.6154e-01
+Branch 1.5 : -106.824429 5.2139e-02 4.5942e-02
+Branch 5.0 : -107.640758 7.9911e-02 -6.4078e-03
+Branch 10.0 : -108.232080 2.3685e-02 -2.4678e-03
+Branch 50.0 : -108.419823 -4.9905e-04 1.1959e-06
+Branch 90.0 : -108.375808 -3.8736e-04 9.2328e-07
Test -108.052524 = -108.052524
-Branch(Tip) 0.1 : -107.275574 7.0457e+00 -5.4359e+01
-Branch(Tip) 0.2 : -107.769163 3.3689e+00 -2.2196e+01
-Branch(Tip) 0.5 : -108.325954 1.2602e+00 -1.2053e+00
-Branch(Tip) 0.9 : -108.785943 1.0956e+00 -1.6975e-01
-Branch(Tip) 1.5 : -109.415058 1.0022e+00 -1.5509e-01
-Branch(Tip) 5.0 : -112.002323 5.0044e-01 -1.1686e-01
-Branch(Tip) 10.0 : -113.427775 1.3697e-01 -3.7298e-02
-Branch(Tip) 50.0 : -113.999564 1.7355e-03 -8.7155e-06
-Branch(Tip) 90.0 : -114.063470 1.4727e-03 -5.8803e-06
+Branch(Tip) 0.1 : -107.275574 2.8183e+00 -8.6974e+00
+Branch(Tip) 0.2 : -107.769163 1.3476e+00 -3.5514e+00
+Branch(Tip) 0.5 : -108.325954 5.0410e-01 -1.9284e-01
+Branch(Tip) 0.9 : -108.785943 4.3823e-01 -2.7160e-02
+Branch(Tip) 1.5 : -109.415058 4.0090e-01 -2.4814e-02
+Branch(Tip) 5.0 : -112.002323 2.0017e-01 -1.8697e-02
+Branch(Tip) 10.0 : -113.427775 5.4788e-02 -5.9677e-03
+Branch(Tip) 50.0 : -113.999564 6.9421e-04 -1.3945e-06
+Branch(Tip) 90.0 : -114.063470 5.8908e-04 -9.4085e-07
Test -107.769163 = -107.769163
TEST alpha(ncats) = 0.10( 4) ; pinv = 0.90
0.000001 0.001078 0.093753 3.905168
-Branch 0.1 : -122.690763 -4.5138e+00 6.2017e+01
-Branch 0.2 : -122.442118 -1.1456e+00 1.7920e+01
-Branch 0.5 : -122.502381 8.4906e-01 1.8453e+00
-Branch 0.9 : -122.900584 1.0055e+00 -3.5655e-01
-Branch 1.5 : -123.408905 6.7061e-01 -5.8101e-01
-Branch 5.0 : -124.035469 -5.6930e-04 -2.2646e-02
-Branch 10.0 : -123.945532 -2.0867e-02 5.9059e-04
-Branch 50.0 : -123.464673 -6.9540e-03 1.4418e-04
-Branch 90.0 : -123.268168 -3.4592e-03 5.2074e-05
+Branch 0.1 : -122.690763 -4.5138e-01 6.2017e-01
+Branch 0.2 : -122.442118 -1.1456e-01 1.7920e-01
+Branch 0.5 : -122.502381 8.4906e-02 1.8453e-02
+Branch 0.9 : -122.900584 1.0055e-01 -3.5655e-03
+Branch 1.5 : -123.408905 6.7061e-02 -5.8101e-03
+Branch 5.0 : -124.035469 -5.6930e-05 -2.2646e-04
+Branch 10.0 : -123.945532 -2.0867e-03 5.9059e-06
+Branch 50.0 : -123.464673 -6.9540e-04 1.4418e-06
+Branch 90.0 : -123.268168 -3.4592e-04 5.2074e-07
Test -122.690763 = -122.690763
-Branch(Tip) 0.1 : -121.745802 4.3297e+00 -4.4191e-01
-Branch(Tip) 0.2 : -122.178250 4.3171e+00 -3.5737e-01
-Branch(Tip) 0.5 : -123.428389 3.9443e+00 -1.8382e+00
-Branch(Tip) 0.9 : -124.842233 3.1017e+00 -2.2054e+00
-Branch(Tip) 1.5 : -126.325833 1.8932e+00 -1.7291e+00
-Branch(Tip) 5.0 : -128.160634 5.7124e-02 -5.0781e-02
-Branch(Tip) 10.0 : -128.243909 6.5752e-03 -5.0614e-04
-Branch(Tip) 50.0 : -128.426657 3.2785e-03 -5.1277e-05
-Branch(Tip) 90.0 : -128.524227 1.7598e-03 -2.7163e-05
+Branch(Tip) 0.1 : -121.745802 4.3297e-01 -4.4191e-03
+Branch(Tip) 0.2 : -122.178250 4.3171e-01 -3.5737e-03
+Branch(Tip) 0.5 : -123.428389 3.9443e-01 -1.8382e-02
+Branch(Tip) 0.9 : -124.842233 3.1017e-01 -2.2054e-02
+Branch(Tip) 1.5 : -126.325833 1.8932e-01 -1.7291e-02
+Branch(Tip) 5.0 : -128.160634 5.7124e-03 -5.0781e-04
+Branch(Tip) 10.0 : -128.243909 6.5752e-04 -5.0614e-06
+Branch(Tip) 50.0 : -128.426657 3.2785e-04 -5.1277e-07
+Branch(Tip) 90.0 : -128.524227 1.7598e-04 -2.7163e-07
Test -122.178250 = -122.178250
@@ -731,75 +731,75 @@ Test -90.580211 = -90.580211
TEST alpha(ncats) = 0.75( 4) ; pinv = 0.30
0.084885 0.386197 0.942076 2.586843
-Branch 0.1 : -93.425840 -4.9723e+00 7.4450e+01
-Branch 0.2 : -93.164805 -1.0973e+00 1.9516e+01
-Branch 0.5 : -93.251024 8.9865e-01 1.4821e+00
-Branch 0.9 : -93.649372 9.8187e-01 -3.6129e-01
-Branch 1.5 : -94.159237 7.1474e-01 -4.2290e-01
-Branch 5.0 : -95.300309 1.4237e-01 -4.5571e-02
-Branch 10.0 : -95.695401 4.2745e-02 -8.5702e-03
-Branch 50.0 : -95.930549 8.5746e-05 -1.0947e-05
-Branch 90.0 : -95.931235 6.8073e-07 -8.0482e-08
+Branch 0.1 : -93.425840 -3.4806e+00 3.6481e+01
+Branch 0.2 : -93.164805 -7.6808e-01 9.5627e+00
+Branch 0.5 : -93.251024 6.2906e-01 7.2623e-01
+Branch 0.9 : -93.649372 6.8731e-01 -1.7703e-01
+Branch 1.5 : -94.159237 5.0031e-01 -2.0722e-01
+Branch 5.0 : -95.300309 9.9660e-02 -2.2330e-02
+Branch 10.0 : -95.695401 2.9921e-02 -4.1994e-03
+Branch 50.0 : -95.930549 6.0023e-05 -5.3639e-06
+Branch 90.0 : -95.931235 4.7651e-07 -3.9436e-08
Test -93.425840 = -93.425840
-Branch(Tip) 0.1 : -92.400586 1.5931e+00 6.5437e+01
-Branch(Tip) 0.2 : -92.760691 4.7653e+00 1.2068e+01
-Branch(Tip) 0.5 : -94.268783 4.6317e+00 -4.1170e+00
-Branch(Tip) 0.9 : -95.813615 3.1828e+00 -2.9053e+00
-Branch(Tip) 1.5 : -97.303741 1.9252e+00 -1.4800e+00
-Branch(Tip) 5.0 : -100.072109 3.1553e-01 -1.0688e-01
-Branch(Tip) 10.0 : -100.940949 9.6105e-02 -1.7895e-02
-Branch(Tip) 50.0 : -101.522613 3.0608e-04 -3.7932e-05
-Branch(Tip) 90.0 : -101.525108 2.5419e-06 -3.0015e-07
+Branch(Tip) 0.1 : -92.400586 1.1152e+00 3.2064e+01
+Branch(Tip) 0.2 : -92.760691 3.3357e+00 5.9133e+00
+Branch(Tip) 0.5 : -94.268783 3.2422e+00 -2.0173e+00
+Branch(Tip) 0.9 : -95.813615 2.2280e+00 -1.4236e+00
+Branch(Tip) 1.5 : -97.303741 1.3476e+00 -7.2518e-01
+Branch(Tip) 5.0 : -100.072109 2.2087e-01 -5.2369e-02
+Branch(Tip) 10.0 : -100.940949 6.7274e-02 -8.7686e-03
+Branch(Tip) 50.0 : -101.522613 2.1426e-04 -1.8587e-05
+Branch(Tip) 90.0 : -101.525108 1.7793e-06 -1.4707e-07
Test -92.760691 = -92.760691
TEST alpha(ncats) = 0.75( 4) ; pinv = 0.60
0.084885 0.386197 0.942076 2.586843
-Branch 0.1 : -98.474386 -4.1935e+00 6.4206e+01
-Branch 0.2 : -98.259351 -8.4529e-01 1.6658e+01
-Branch 0.5 : -98.347365 7.5830e-01 8.9536e-01
-Branch 0.9 : -98.660561 7.2773e-01 -4.5814e-01
-Branch 1.5 : -99.014436 4.6421e-01 -3.5914e-01
-Branch 5.0 : -99.672908 7.3839e-02 -2.7075e-02
-Branch 10.0 : -99.852311 1.4875e-02 -4.4424e-03
-Branch 50.0 : -99.905397 1.4159e-06 -2.9298e-07
-Branch 90.0 : -99.905404 3.7060e-10 -7.6359e-11
+Branch 0.1 : -98.474386 -1.6774e+00 1.0273e+01
+Branch 0.2 : -98.259351 -3.3812e-01 2.6654e+00
+Branch 0.5 : -98.347365 3.0332e-01 1.4326e-01
+Branch 0.9 : -98.660561 2.9109e-01 -7.3302e-02
+Branch 1.5 : -99.014436 1.8568e-01 -5.7463e-02
+Branch 5.0 : -99.672908 2.9536e-02 -4.3320e-03
+Branch 10.0 : -99.852311 5.9500e-03 -7.1078e-04
+Branch 50.0 : -99.905397 5.6634e-07 -4.6877e-08
+Branch 90.0 : -99.905404 1.4824e-10 -1.2217e-11
Test -98.474386 = -98.474386
-Branch(Tip) 0.1 : -97.098569 5.5526e+00 2.9064e+01
-Branch(Tip) 0.2 : -97.721972 6.4281e+00 -2.0778e+00
-Branch(Tip) 0.5 : -99.393368 4.6110e+00 -5.9351e+00
-Branch(Tip) 0.9 : -100.845369 2.8307e+00 -3.2215e+00
-Branch(Tip) 1.5 : -102.101229 1.5341e+00 -1.4012e+00
-Branch(Tip) 5.0 : -104.159024 2.3345e-01 -7.8683e-02
-Branch(Tip) 10.0 : -104.757728 5.3851e-02 -1.4808e-02
-Branch(Tip) 50.0 : -104.965128 6.6817e-06 -1.3822e-06
-Branch(Tip) 90.0 : -104.965161 1.7494e-09 -3.6045e-10
+Branch(Tip) 0.1 : -97.098569 2.2210e+00 4.6503e+00
+Branch(Tip) 0.2 : -97.721972 2.5712e+00 -3.3244e-01
+Branch(Tip) 0.5 : -99.393368 1.8444e+00 -9.4961e-01
+Branch(Tip) 0.9 : -100.845369 1.1323e+00 -5.1545e-01
+Branch(Tip) 1.5 : -102.101229 6.1365e-01 -2.2420e-01
+Branch(Tip) 5.0 : -104.159024 9.3379e-02 -1.2589e-02
+Branch(Tip) 10.0 : -104.757728 2.1540e-02 -2.3692e-03
+Branch(Tip) 50.0 : -104.965128 2.6727e-06 -2.2115e-07
+Branch(Tip) 90.0 : -104.965161 6.9977e-10 -5.7672e-11
Test -97.721972 = -97.721972
TEST alpha(ncats) = 0.75( 4) ; pinv = 0.90
0.084885 0.386197 0.942076 2.586843
-Branch 0.1 : -115.786465 -2.5493e+00 3.8654e+01
-Branch 0.2 : -115.659268 -4.2987e-01 1.1036e+01
-Branch 0.5 : -115.762508 6.7565e-01 7.4031e-01
-Branch 0.9 : -116.047067 6.8294e-01 -3.1860e-01
-Branch 1.5 : -116.389048 4.5380e-01 -3.6885e-01
-Branch 5.0 : -116.874129 1.9117e-02 -1.6812e-02
-Branch 10.0 : -116.896027 2.7969e-04 -2.3175e-04
-Branch 50.0 : -116.896366 -4.2990e-14 -1.1026e-18
-Branch 90.0 : -116.896366 -4.2991e-14 -1.2216e-28
+Branch 0.1 : -115.786465 -2.5493e-01 3.8654e-01
+Branch 0.2 : -115.659268 -4.2987e-02 1.1036e-01
+Branch 0.5 : -115.762508 6.7565e-02 7.4031e-03
+Branch 0.9 : -116.047067 6.8294e-02 -3.1860e-03
+Branch 1.5 : -116.389048 4.5380e-02 -3.6885e-03
+Branch 5.0 : -116.874129 1.9117e-03 -1.6812e-04
+Branch 10.0 : -116.896027 2.7969e-05 -2.3175e-06
+Branch 50.0 : -116.896366 -4.2990e-15 -1.1026e-20
+Branch 90.0 : -116.896366 -4.2991e-15 -1.2216e-30
Test -115.786465 = -115.786465
-Branch(Tip) 0.1 : -114.157974 1.0234e+01 -3.1839e+01
-Branch(Tip) 0.2 : -115.041203 7.6162e+00 -2.0866e+01
-Branch(Tip) 0.5 : -116.685750 4.0385e+00 -6.4910e+00
-Branch(Tip) 0.9 : -117.931413 2.4388e+00 -2.5550e+00
-Branch(Tip) 1.5 : -119.035029 1.3591e+00 -1.3021e+00
-Branch(Tip) 5.0 : -120.363876 4.2518e-02 -4.0060e-02
-Branch(Tip) 10.0 : -120.410204 5.4068e-04 -4.5214e-04
-Branch(Tip) 50.0 : -120.410854 -4.6688e-14 -2.0982e-18
-Branch(Tip) 90.0 : -120.410854 -4.6690e-14 -1.3310e-28
+Branch(Tip) 0.1 : -114.157974 1.0234e+00 -3.1839e-01
+Branch(Tip) 0.2 : -115.041203 7.6162e-01 -2.0866e-01
+Branch(Tip) 0.5 : -116.685750 4.0385e-01 -6.4910e-02
+Branch(Tip) 0.9 : -117.931413 2.4388e-01 -2.5550e-02
+Branch(Tip) 1.5 : -119.035029 1.3591e-01 -1.3021e-02
+Branch(Tip) 5.0 : -120.363876 4.2518e-03 -4.0060e-04
+Branch(Tip) 10.0 : -120.410204 5.4068e-05 -4.5214e-06
+Branch(Tip) 50.0 : -120.410854 -4.6688e-15 -2.0982e-20
+Branch(Tip) 90.0 : -120.410854 -4.6690e-15 -1.3310e-30
Test -115.041203 = -115.041203
@@ -831,75 +831,75 @@ Test -90.173022 = -90.173022
TEST alpha(ncats) = 1.50( 4) ; pinv = 0.30
0.225323 0.588556 1.050422 2.135699
-Branch 0.1 : -92.546093 -4.5722e+00 7.5035e+01
-Branch 0.2 : -92.327350 -6.5768e-01 1.9732e+01
-Branch 0.5 : -92.544446 1.3069e+00 1.1907e+00
-Branch 0.9 : -93.080197 1.2602e+00 -6.7034e-01
-Branch 1.5 : -93.709849 8.4956e-01 -5.9638e-01
-Branch 5.0 : -94.887639 1.0598e-01 -5.3387e-02
-Branch 10.0 : -95.092199 1.1611e-02 -4.5809e-03
-Branch 50.0 : -95.123968 2.8628e-08 -8.9476e-09
-Branch 90.0 : -95.123968 9.8415e-14 -3.3318e-14
+Branch 0.1 : -92.546093 -3.2006e+00 3.6767e+01
+Branch 0.2 : -92.327350 -4.6038e-01 9.6686e+00
+Branch 0.5 : -92.544446 9.1482e-01 5.8345e-01
+Branch 0.9 : -93.080197 8.8213e-01 -3.2847e-01
+Branch 1.5 : -93.709849 5.9469e-01 -2.9223e-01
+Branch 5.0 : -94.887639 7.4187e-02 -2.6160e-02
+Branch 10.0 : -95.092199 8.1277e-03 -2.2446e-03
+Branch 50.0 : -95.123968 2.0040e-08 -4.3843e-09
+Branch 90.0 : -95.123968 6.8890e-14 -1.6326e-14
Test -92.546093 = -92.546093
-Branch(Tip) 0.1 : -91.581907 1.7255e-01 8.3535e+01
-Branch(Tip) 0.2 : -91.864872 4.4730e+00 1.9285e+01
-Branch(Tip) 0.5 : -93.465289 5.2305e+00 -3.4949e+00
-Branch(Tip) 0.9 : -95.247845 3.7031e+00 -3.4297e+00
-Branch(Tip) 1.5 : -96.961250 2.1695e+00 -1.8263e+00
-Branch(Tip) 5.0 : -99.769212 2.4608e-01 -1.2086e-01
-Branch(Tip) 10.0 : -100.254776 2.8491e-02 -1.1122e-02
-Branch(Tip) 50.0 : -100.332720 6.7815e-08 -2.1196e-08
-Branch(Tip) 90.0 : -100.332721 2.4393e-13 -7.8917e-14
+Branch(Tip) 0.1 : -91.581907 1.2078e-01 4.0932e+01
+Branch(Tip) 0.2 : -91.864872 3.1311e+00 9.4494e+00
+Branch(Tip) 0.5 : -93.465289 3.6613e+00 -1.7125e+00
+Branch(Tip) 0.9 : -95.247845 2.5922e+00 -1.6806e+00
+Branch(Tip) 1.5 : -96.961250 1.5187e+00 -8.9487e-01
+Branch(Tip) 5.0 : -99.769212 1.7225e-01 -5.9223e-02
+Branch(Tip) 10.0 : -100.254776 1.9944e-02 -5.4498e-03
+Branch(Tip) 50.0 : -100.332720 4.7471e-08 -1.0386e-08
+Branch(Tip) 90.0 : -100.332721 1.7075e-13 -3.8669e-14
Test -91.864872 = -91.864872
TEST alpha(ncats) = 1.50( 4) ; pinv = 0.60
0.225323 0.588556 1.050422 2.135699
-Branch 0.1 : -97.428303 -3.3576e+00 6.0916e+01
-Branch 0.2 : -97.286506 -1.8407e-01 1.5574e+01
-Branch 0.5 : -97.534836 1.1860e+00 2.8240e-01
-Branch 0.9 : -97.978350 9.6994e-01 -7.9721e-01
-Branch 1.5 : -98.430575 5.6788e-01 -5.1402e-01
-Branch 5.0 : -99.067709 3.5980e-02 -2.4845e-02
-Branch 10.0 : -99.120980 1.6519e-03 -9.4486e-04
-Branch 50.0 : -99.123919 4.7416e-13 -2.6608e-13
-Branch 90.0 : -99.123919 -1.2360e-14 -8.4023e-23
+Branch 0.1 : -97.428303 -1.3430e+00 9.7465e+00
+Branch 0.2 : -97.286506 -7.3629e-02 2.4919e+00
+Branch 0.5 : -97.534836 4.7438e-01 4.5185e-02
+Branch 0.9 : -97.978350 3.8798e-01 -1.2755e-01
+Branch 1.5 : -98.430575 2.2715e-01 -8.2243e-02
+Branch 5.0 : -99.067709 1.4392e-02 -3.9751e-03
+Branch 10.0 : -99.120980 6.6075e-04 -1.5118e-04
+Branch 50.0 : -99.123919 1.8967e-13 -4.2573e-14
+Branch 90.0 : -99.123919 -4.9441e-15 -1.3444e-23
Test -97.428303 = -97.428303
-Branch(Tip) 0.1 : -95.917608 5.3972e+00 4.4723e+01
-Branch(Tip) 0.2 : -96.578964 7.1594e+00 2.2326e+00
-Branch(Tip) 0.5 : -98.518204 5.4304e+00 -7.0486e+00
-Branch(Tip) 0.9 : -100.212718 3.2521e+00 -3.9771e+00
-Branch(Tip) 1.5 : -101.620648 1.6648e+00 -1.6986e+00
-Branch(Tip) 5.0 : -103.420611 9.9738e-02 -7.0137e-02
-Branch(Tip) 10.0 : -103.564757 4.1804e-03 -2.4498e-03
-Branch(Tip) 50.0 : -103.572066 1.1563e-12 -6.3953e-13
-Branch(Tip) 90.0 : -103.572066 -1.3094e-14 -2.0195e-22
+Branch(Tip) 0.1 : -95.917608 2.1589e+00 7.1556e+00
+Branch(Tip) 0.2 : -96.578964 2.8638e+00 3.5721e-01
+Branch(Tip) 0.5 : -98.518204 2.1722e+00 -1.1278e+00
+Branch(Tip) 0.9 : -100.212718 1.3008e+00 -6.3633e-01
+Branch(Tip) 1.5 : -101.620648 6.6590e-01 -2.7178e-01
+Branch(Tip) 5.0 : -103.420611 3.9895e-02 -1.1222e-02
+Branch(Tip) 10.0 : -103.564757 1.6722e-03 -3.9197e-04
+Branch(Tip) 50.0 : -103.572066 4.6251e-13 -1.0232e-13
+Branch(Tip) 90.0 : -103.572066 -5.2377e-15 -3.2312e-23
Test -96.578964 = -96.578964
TEST alpha(ncats) = 1.50( 4) ; pinv = 0.90
0.225323 0.588556 1.050422 2.135699
-Branch 0.1 : -117.149120 1.4694e+00 1.0377e+01
-Branch 0.2 : -117.324824 1.8823e+00 2.5114e-01
-Branch 0.5 : -117.807516 1.2272e+00 -2.5732e+00
-Branch 0.9 : -118.131501 4.8918e-01 -1.1708e+00
-Branch 1.5 : -118.287175 1.1679e-01 -2.7506e-01
-Branch 5.0 : -118.337857 4.7718e-05 -1.0449e-04
-Branch 10.0 : -118.337879 8.4657e-10 -1.8521e-09
-Branch 50.0 : -118.337879 -4.2348e-14 -7.2648e-29
-Branch 90.0 : -118.337879 -4.2348e-14 -7.2648e-29
+Branch 0.1 : -117.149120 1.4694e-01 1.0377e-01
+Branch 0.2 : -117.324824 1.8823e-01 2.5114e-03
+Branch 0.5 : -117.807516 1.2272e-01 -2.5732e-02
+Branch 0.9 : -118.131501 4.8918e-02 -1.1708e-02
+Branch 1.5 : -118.287175 1.1679e-02 -2.7506e-03
+Branch 5.0 : -118.337857 4.7718e-06 -1.0449e-06
+Branch 10.0 : -118.337879 8.4657e-11 -1.8521e-11
+Branch 50.0 : -118.337879 -4.2348e-15 -7.2648e-31
+Branch 90.0 : -118.337879 -4.2348e-15 -7.2648e-31
Test -117.149120 = -117.149120
-Branch(Tip) 0.1 : -114.840581 1.5070e+01 -5.1009e+01
-Branch(Tip) 0.2 : -116.123450 1.0880e+01 -3.3676e+01
-Branch(Tip) 0.5 : -118.310082 4.7106e+00 -1.2449e+01
-Branch(Tip) 0.9 : -119.473579 1.6330e+00 -4.3613e+00
-Branch(Tip) 1.5 : -119.962685 3.3422e-01 -8.6241e-01
-Branch(Tip) 5.0 : -120.097835 1.0984e-04 -2.4091e-04
-Branch(Tip) 10.0 : -120.097885 1.9435e-09 -4.2517e-09
-Branch(Tip) 50.0 : -120.097885 -4.4787e-14 -7.6139e-29
-Branch(Tip) 90.0 : -120.097885 -4.4787e-14 -7.6139e-29
+Branch(Tip) 0.1 : -114.840581 1.5070e+00 -5.1009e-01
+Branch(Tip) 0.2 : -116.123450 1.0880e+00 -3.3676e-01
+Branch(Tip) 0.5 : -118.310082 4.7106e-01 -1.2449e-01
+Branch(Tip) 0.9 : -119.473579 1.6330e-01 -4.3613e-02
+Branch(Tip) 1.5 : -119.962685 3.3422e-02 -8.6241e-03
+Branch(Tip) 5.0 : -120.097835 1.0984e-05 -2.4091e-06
+Branch(Tip) 10.0 : -120.097885 1.9435e-10 -4.2517e-11
+Branch(Tip) 50.0 : -120.097885 -4.4787e-15 -7.6139e-31
+Branch(Tip) 90.0 : -120.097885 -4.4787e-15 -7.6139e-31
Test -116.123450 = -116.123450
ti/tv:alpha(ncats) = 0.10( 1) logL: -120.551659
diff --git a/test/out/00110_NPDN_fasta.exe.out b/test/out/fasta-dna.exe.out
similarity index 100%
rename from test/out/00110_NPDN_fasta.exe.out
rename to test/out/fasta-dna.exe.out
diff --git a/test/out/00110_NPDN_fasta.out b/test/out/fasta-dna.out
similarity index 100%
rename from test/out/00110_NPDN_fasta.out
rename to test/out/fasta-dna.out
diff --git a/test/out/00120_NPAN_fasta.exe.out b/test/out/fasta-prot.exe.out
similarity index 100%
rename from test/out/00120_NPAN_fasta.exe.out
rename to test/out/fasta-prot.exe.out
diff --git a/test/out/00120_NPAN_fasta.out b/test/out/fasta-prot.out
similarity index 100%
rename from test/out/00120_NPAN_fasta.out
rename to test/out/fasta-prot.out
diff --git a/test/out/00032_NMOU_gamma.out b/test/out/odd-states.out
similarity index 100%
rename from test/out/00032_NMOU_gamma.out
rename to test/out/odd-states.out
diff --git a/test/runtest.py b/test/runtest.py
index 70924dd..903e970 100755
--- a/test/runtest.py
+++ b/test/runtest.py
@@ -40,16 +40,14 @@ import time
#####################
# Configuration #
#####################
-do_memtest = 1 # Evaluate memory leaks
-num_replicates = 20 # Number of samples for the speed test
-all_args = [0,1,2,3,4,5,8,9] # 0: No vector / No tip pattern
- # 1: No vector / Tip pattern
- # 2: AVX / No tip pattern
- # 3: AVX / Tip pattern
- # 4: SSE / No tip pattern
- # 5: SSE / Tip pattern
- # 8: AVX2 / No tip pattern
- # 9: AVX2 / Tip pattern
+do_memtest = 1 # Evaluate memory leaks
+num_replicates = 20 # Number of samples for the speed test
+all_args = [0,1,2,3,4,5] # 0: No vector / No tip pattern
+ # 1: No vector / Tip pattern
+ # 2: AVX / No tip pattern
+ # 3: AVX / Tip pattern
+ # 4: SSE / No tip pattern
+ # 5: SSE / Tip pattern
#####################
colors={"default":"",
@@ -156,14 +154,6 @@ def runSpeedTest(files):
attrib += " avx"
attribstr += " AVX"
typestr += "A"
- elif (args & 4):
- attrib += " sse"
- attribstr += " SSE"
- typestr += "S"
- elif (args & 8):
- attrib += " avx2"
- attribstr += " AVX2"
- typestr += "F"
else:
attribstr += " CPU"
typestr += "C"
@@ -284,14 +274,10 @@ def runValidation(files):
attrib += " avx"
attribstr += " AVX"
typestr += "A"
- elif (args & 4):
+ if (args & 4):
attrib += " sse"
attribstr += " SSE"
typestr += "S"
- elif (args & 8):
- attrib += " avx2"
- attribstr += " AVX2"
- typestr += "F"
else:
attribstr += " CPU"
typestr += "C"
diff --git a/test/src/00010_NMDU_lkcalc.c b/test/src/00010_NMDU_lkcalc.c
deleted file mode 100644
index 5c6f5ce..0000000
--- a/test/src/00010_NMDU_lkcalc.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- Copyright (C) 2015 Diego Darriba, Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Diego Darriba <Diego.Darriba at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-#include "common.h"
-
-#define N_STATES_NT 4
-#define N_CAT_GAMMA 4
-#define FLOAT_PRECISION 4
-
-static double titv = 2.5;
-static double alpha = 0.5;
-static unsigned int n_cat_gamma = N_CAT_GAMMA;
-unsigned int params_indices[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-int main(int argc, char * argv[])
-{
- unsigned int i,j;
- double lk_score;
- unsigned int n_sites = 12;
- unsigned int n_tips = 5;
- double rate_cats[N_CAT_GAMMA];
- pll_operation_t * operations;
-
- operations = (pll_operation_t *)malloc(4* sizeof(pll_operation_t));
-
- operations[0].parent_clv_index = 5;
- operations[0].child1_clv_index = 0;
- operations[0].child2_clv_index = 1;
- operations[0].child1_matrix_index = 1;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 6;
- operations[1].child1_clv_index = 5;
- operations[1].child2_clv_index = 2;
- operations[1].child1_matrix_index = 0;
- operations[1].child2_matrix_index = 1;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[2].parent_clv_index = 7;
- operations[2].child1_clv_index = 3;
- operations[2].child2_clv_index = 4;
- operations[2].child1_matrix_index = 1;
- operations[2].child2_matrix_index = 1;
- operations[2].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- /* check attributes */
- unsigned int attributes = get_attributes(argc, argv);
-
- pll_partition_t * partition;
- partition = pll_partition_create(
- n_tips, /* numer of tips */
- 4, /* clv buffers */
- N_STATES_NT, /* number of states */
- n_sites, /* sequence length */
- 1, /* different rate parameters */
- 2*n_tips-3, /* probability matrices */
- n_cat_gamma, /* gamma categories */
- 0, /* scale buffers */
- attributes
- ); /* attributes */
-
- if (!partition)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail creating partition");
- }
-
- double branch_lengths[4] = { 0.1, 0.2, 1, 1};
- double frequencies[4] = { 0.3, 0.4, 0.1, 0.2 };
- unsigned int matrix_indices[4] = { 0, 1, 2, 3 };
- double subst_params[6] = {1,titv,1,1,titv,1};
- double * persite_lnl = (double *) malloc(n_sites * sizeof(double));
- double checksum;
-
- if (pll_compute_gamma_cats(alpha, n_cat_gamma, rate_cats) == PLL_FAILURE)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail computing gamma cats");
- }
-
- pll_set_frequencies(partition, 0, frequencies);
- pll_set_subst_params(partition, 0, subst_params);
-
- pll_set_tip_states(partition, 0, pll_map_nt, "WAC-CTA-ATCT");
- pll_set_tip_states(partition, 1, pll_map_nt, "CCC-TTA-ATGT");
- pll_set_tip_states(partition, 2, pll_map_nt, "A-C-TAG-CTCT");
- pll_set_tip_states(partition, 3, pll_map_nt, "CTCTTAA-A-CG");
- pll_set_tip_states(partition, 4, pll_map_nt, "CAC-TCA-A-TG");
-
- pll_set_category_rates(partition, rate_cats);
-
- pll_update_prob_matrices(partition, params_indices, matrix_indices, branch_lengths, 4);
- pll_update_partials(partition, operations, 3);
-
- for (j = 0; j < 4; ++j)
- {
- printf ("[%d] P-matrix for branch length %f\n", i, branch_lengths[j]);
- pll_show_pmatrix(partition, j, FLOAT_PRECISION);
- printf ("\n");
- }
-
- /* show CLVs */
- printf ("[%d] CLV 5: ", i);
- pll_show_clv(partition,5,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 6: ", i);
- pll_show_clv(partition,6,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 7: ", i);
- pll_show_clv(partition,7,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
-
- lk_score = pll_compute_edge_loglikelihood(partition,
- 6,
- PLL_SCALE_BUFFER_NONE,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 0,
- params_indices,
- persite_lnl);
-
- /* test illegal alpha value */
- double invalid_alpha = 0;
- if (pll_compute_gamma_cats(invalid_alpha, N_CAT_GAMMA, rate_cats) == PLL_FAILURE)
- {
- if (pll_errno != PLL_ERROR_PARAM_INVALID)
- printf("Error is %d instead of %d\n", pll_errno, PLL_ERROR_PARAM_INVALID);
- }
- else
- {
- printf("Computing gamma rates for alpha = %f should have failed\n",
- invalid_alpha);
- }
-
- printf("\n");
- printf("inner-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- /* move to tip inner */
-
- operations[0].parent_clv_index = 7;
- operations[0].child1_clv_index = 6;
- operations[0].child2_clv_index = 3;
- operations[0].child1_matrix_index = 0;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- pll_update_partials(partition, operations, 1);
-
- lk_score = pll_compute_edge_loglikelihood(partition,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 4,
- PLL_SCALE_BUFFER_NONE,
- 1,
- params_indices,
- persite_lnl);
-
- printf("tip-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- pll_partition_destroy(partition);
- free(persite_lnl);
- free(operations);
-
- return (0);
-}
diff --git a/test/src/00011_NMAU_lkcalc.c b/test/src/00011_NMAU_lkcalc.c
deleted file mode 100644
index bb2409d..0000000
--- a/test/src/00011_NMAU_lkcalc.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- Copyright (C) 2015 Diego Darriba, Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Diego Darriba <Diego.Darriba at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-#include "common.h"
-
-#define N_STATES_AA 20
-#define N_CAT_GAMMA 4
-#define FLOAT_PRECISION 4
-
-static double alpha = 0.5;
-static unsigned int n_cat_gamma = N_CAT_GAMMA;
-unsigned int params_indices[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-int main(int argc, char * argv[])
-{
- unsigned int i,j;
- double lk_score;
- unsigned int n_sites = 15;
- unsigned int n_tips = 5;
- double rate_cats[N_CAT_GAMMA];
- pll_operation_t * operations;
- int return_val;
-
- operations = (pll_operation_t *)malloc(4* sizeof(pll_operation_t));
-
- operations[0].parent_clv_index = 5;
- operations[0].child1_clv_index = 0;
- operations[0].child2_clv_index = 1;
- operations[0].child1_matrix_index = 1;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 6;
- operations[1].child1_clv_index = 5;
- operations[1].child2_clv_index = 2;
- operations[1].child1_matrix_index = 0;
- operations[1].child2_matrix_index = 1;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[2].parent_clv_index = 7;
- operations[2].child1_clv_index = 3;
- operations[2].child2_clv_index = 4;
- operations[2].child1_matrix_index = 1;
- operations[2].child2_matrix_index = 1;
- operations[2].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- /* check attributes */
- unsigned int attributes = get_attributes(argc, argv);
-
- pll_partition_t * partition;
- partition = pll_partition_create(
- n_tips, /* numer of tips */
- 4, /* clv buffers */
- N_STATES_AA, /* number of states */
- n_sites, /* sequence length */
- 1, /* different rate parameters */
- 2*n_tips-3, /* probability matrices */
- n_cat_gamma, /* gamma categories */
- 0, /* scale buffers */
- attributes
- ); /* attributes */
-
- if (!partition)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail creating partition");
- }
-
- double branch_lengths[4] = { 0.1, 0.2, 1, 1};
- unsigned int matrix_indices[4] = { 0, 1, 2, 3 };
- double * persite_lnl = (double *) malloc(n_sites * sizeof(double));
- double checksum;
-
- if (pll_compute_gamma_cats(alpha, n_cat_gamma, rate_cats) == PLL_FAILURE)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail computing gamma cats");
- }
-
- pll_set_frequencies(partition, 0, pll_aa_freqs_dayhoff);
- pll_set_subst_params(partition, 0, pll_aa_rates_dayhoff);
-
- return_val = PLL_SUCCESS;
- return_val &= pll_set_tip_states(partition, 0, pll_map_aa, "PIGLRVTLRRDRMWI");
- return_val &= pll_set_tip_states(partition, 1, pll_map_aa, "IQGMDITIVT-----");
- return_val &= pll_set_tip_states(partition, 2, pll_map_aa, "--AFALLQKIGMPFE");
- return_val &= pll_set_tip_states(partition, 3, pll_map_aa, "MDISIVT------TA");
- return_val &= pll_set_tip_states(partition, 4, pll_map_aa, "GLSEQTVFHEIDQDK");
-
- if (!return_val)
- fatal("Error setting tip states");
-
- pll_set_category_rates(partition, rate_cats);
-
- pll_update_prob_matrices(partition, params_indices, matrix_indices, branch_lengths, 4);
- pll_update_partials(partition, operations, 3);
-
- for (j = 0; j < 4; ++j)
- {
- printf ("[%d] P-matrix for branch length %f\n", i, branch_lengths[j]);
- pll_show_pmatrix(partition, j, FLOAT_PRECISION);
- printf ("\n");
- }
-
- /* show CLVs */
- printf ("[%d] CLV 5: ", i);
- pll_show_clv(partition,5,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 6: ", i);
- pll_show_clv(partition,6,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 7: ", i);
- pll_show_clv(partition,7,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
-
- lk_score = pll_compute_edge_loglikelihood(partition,
- 6,
- PLL_SCALE_BUFFER_NONE,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 0,
- params_indices,
- persite_lnl);
-
- printf("\n");
- printf("inner-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- /* move to tip inner */
-
- operations[0].parent_clv_index = 7;
- operations[0].child1_clv_index = 6;
- operations[0].child2_clv_index = 3;
- operations[0].child1_matrix_index = 0;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- pll_update_partials(partition, operations, 1);
-
-assert(n_sites == partition->sites);
- lk_score = pll_compute_edge_loglikelihood(partition,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 4,
- PLL_SCALE_BUFFER_NONE,
- 1,
- params_indices,
- persite_lnl);
-
- printf("tip-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- pll_partition_destroy(partition);
- free(persite_lnl);
- free(operations);
-
- return (0);
-}
diff --git a/test/src/00012_NMOU_lkcalc.c b/test/src/00012_NMOU_lkcalc.c
deleted file mode 100644
index 81f943a..0000000
--- a/test/src/00012_NMOU_lkcalc.c
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- Copyright (C) 2015 Diego Darriba, Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Diego Darriba <Diego.Darriba at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-#include "common.h"
-
-#define N_STATES_ODD 7
-#define N_SUBST_PARAMS 21 // N_STATES*(N_STATES-1)/2
-#define N_CAT_GAMMA 4
-#define FLOAT_PRECISION 4
-
-static double alpha = 0.5;
-static unsigned int n_cat_gamma = N_CAT_GAMMA;
-unsigned int params_indices[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-/* odd map with 7 states: A..G */
-const unsigned int odd_map[256] =
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x3f, 0, 0, 0x3f, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x3f, 0, 0x01, 0x02, 0x04,
- 0x08, 0x0c, 0x10, 0x20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x0c, 0x10, 0x20, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-int main(int argc, char * argv[])
-{
- unsigned int i,j;
- double lk_score;
- unsigned int n_sites = 12;
- unsigned int n_tips = 5;
- double rate_cats[N_CAT_GAMMA];
- pll_operation_t * operations;
- int return_val;
-
- operations = (pll_operation_t *)malloc(4* sizeof(pll_operation_t));
-
- operations[0].parent_clv_index = 5;
- operations[0].child1_clv_index = 0;
- operations[0].child2_clv_index = 1;
- operations[0].child1_matrix_index = 1;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 6;
- operations[1].child1_clv_index = 5;
- operations[1].child2_clv_index = 2;
- operations[1].child1_matrix_index = 0;
- operations[1].child2_matrix_index = 1;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[2].parent_clv_index = 7;
- operations[2].child1_clv_index = 3;
- operations[2].child2_clv_index = 4;
- operations[2].child1_matrix_index = 1;
- operations[2].child2_matrix_index = 1;
- operations[2].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- /* check attributes */
- unsigned int attributes = get_attributes(argc, argv);
-
- pll_partition_t * partition;
- partition = pll_partition_create(
- n_tips, /* numer of tips */
- 4, /* clv buffers */
- N_STATES_ODD, /* number of states */
- n_sites, /* sequence length */
- 1, /* different rate parameters */
- 2*n_tips-3, /* probability matrices */
- n_cat_gamma, /* gamma categories */
- 0, /* scale buffers */
- attributes
- ); /* attributes */
-
- if (!partition)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail creating partition");
- }
-
- double branch_lengths[4] = { 0.1, 0.2, 1, 1};
- double frequencies[N_STATES_ODD] = {0.12, 0.14, 0.13, 0.11, 0.15, 0.13, 0.12};
- unsigned int matrix_indices[4] = { 0, 1, 2, 3 };
- double subst_params[N_SUBST_PARAMS] = { 0.5, 2.0, 3.0, 4.0, 5.0, 1.1,
- 1.2, 1.3, 1.4, 1.5, 2.1,
- 2.2, 2.3, 2.4, 2.5,
- 3.1, 3.2, 3.3,
- 3.4, 3.5,
- 1.0 };
- double * persite_lnl = (double *) malloc(n_sites * sizeof(double));
- double checksum;
-
- if (pll_compute_gamma_cats(alpha, n_cat_gamma, rate_cats) == PLL_FAILURE)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail computing gamma cats");
- }
-
- pll_set_frequencies(partition, 0, frequencies);
- pll_set_subst_params(partition, 0, subst_params);
-
- return_val = PLL_SUCCESS;
- return_val &= pll_set_tip_states(partition, 0, odd_map, "AAB-CCD-EFAA");
- return_val &= pll_set_tip_states(partition, 1, odd_map, "ACC-FBA-ABGG");
- return_val &= pll_set_tip_states(partition, 2, odd_map, "A-C-GAG-GCCF");
- return_val &= pll_set_tip_states(partition, 3, odd_map, "ADCFCAA-A-CG");
- return_val &= pll_set_tip_states(partition, 4, odd_map, "ABC-BCA-A-BG");
-
- if (!return_val)
- fatal("Error setting tip states");
-
- pll_set_category_rates(partition, rate_cats);
-
- pll_update_prob_matrices(partition, params_indices, matrix_indices, branch_lengths, 4);
- pll_update_partials(partition, operations, 3);
-
- for (j = 0; j < 4; ++j)
- {
- printf ("[%d] P-matrix for branch length %f\n", i, branch_lengths[j]);
- pll_show_pmatrix(partition, j, FLOAT_PRECISION);
- printf ("\n");
- }
-
- /* show CLVs */
- printf ("[%d] CLV 5: ", i);
- pll_show_clv(partition,5,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 6: ", i);
- pll_show_clv(partition,6,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 7: ", i);
- pll_show_clv(partition,7,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
-
- lk_score = pll_compute_edge_loglikelihood(partition,
- 6,
- PLL_SCALE_BUFFER_NONE,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 0,
- params_indices,
- persite_lnl);
-
- printf("\n");
- printf("inner-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- /* move to tip inner */
-
- operations[0].parent_clv_index = 7;
- operations[0].child1_clv_index = 6;
- operations[0].child2_clv_index = 3;
- operations[0].child1_matrix_index = 0;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- pll_update_partials(partition, operations, 1);
-
- lk_score = pll_compute_edge_loglikelihood(partition,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 4,
- PLL_SCALE_BUFFER_NONE,
- 1,
- params_indices,
- persite_lnl);
-
- printf("tip-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- pll_partition_destroy(partition);
- free(persite_lnl);
- free(operations);
-
- return (0);
-}
diff --git a/test/src/00020_NMDR_lkcalc.c b/test/src/00020_NMDR_lkcalc.c
deleted file mode 100644
index a634755..0000000
--- a/test/src/00020_NMDR_lkcalc.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- Copyright (C) 2015 Diego Darriba, Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Diego Darriba <Diego.Darriba at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-#include "common.h"
-
-#define N_STATES_NT 4
-#define N_CAT_GAMMA 4
-#define FLOAT_PRECISION 4
-
-static double titv = 2.5;
-static double alpha = 0.5;
-static unsigned int n_cat_gamma = N_CAT_GAMMA;
-unsigned int params_indices[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-int main(int argc, char * argv[])
-{
- unsigned int i,j;
- double lk_score;
- unsigned int n_sites = 12;
- unsigned int n_tips = 5;
- double rate_cats[N_CAT_GAMMA];
- pll_operation_t * operations;
- double * persite_lnl = (double *) malloc(n_sites * sizeof(double));
- double checksum;
-
- operations = (pll_operation_t *)malloc(4* sizeof(pll_operation_t));
-
- operations[0].parent_clv_index = 5;
- operations[0].child1_clv_index = 0;
- operations[0].child2_clv_index = 1;
- operations[0].child1_matrix_index = 1;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 6;
- operations[1].child1_clv_index = 5;
- operations[1].child2_clv_index = 2;
- operations[1].child1_matrix_index = 0;
- operations[1].child2_matrix_index = 1;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[2].parent_clv_index = 7;
- operations[2].child1_clv_index = 3;
- operations[2].child2_clv_index = 4;
- operations[2].child1_matrix_index = 1;
- operations[2].child2_matrix_index = 1;
- operations[2].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[3].parent_clv_index = 8;
- operations[3].child1_clv_index = 7;
- operations[3].child2_clv_index = 6;
- operations[3].child1_matrix_index = 2;
- operations[3].child2_matrix_index = 3;
- operations[3].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[3].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[3].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- /* check attributes */
- unsigned int attributes = get_attributes(argc, argv);
-
- pll_partition_t * partition;
- partition = pll_partition_create(
- n_tips, /* numer of tips */
- 4, /* clv buffers */
- N_STATES_NT, /* number of states */
- n_sites, /* sequence length */
- 1, /* different rate parameters */
- 2*n_tips-3, /* probability matrices */
- n_cat_gamma, /* gamma categories */
- 0, /* scale buffers */
- attributes
- ); /* attributes */
-
- if (!partition)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail creating partition");
- }
-
- double branch_lengths[4] = { 0.5, 0.5, 0.3, 0.2};
- double frequencies[4] = { 0.3, 0.4, 0.1, 0.2 };
- unsigned int matrix_indices[4] = { 0, 1, 2, 3 };
- double subst_params[6] = {1,titv,1,1,titv,1};
-
- if (pll_compute_gamma_cats(alpha, n_cat_gamma, rate_cats) == PLL_FAILURE)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail computing gamma cats");
- }
-
- pll_set_frequencies(partition, 0, frequencies);
- pll_set_subst_params(partition, 0, subst_params);
-
- pll_set_tip_states(partition, 0, pll_map_nt, "WAC-CTA-ATCT");
- pll_set_tip_states(partition, 1, pll_map_nt, "CCC-TTA-ATGT");
- pll_set_tip_states(partition, 2, pll_map_nt, "A-C-TAG-CTCT");
- pll_set_tip_states(partition, 3, pll_map_nt, "CTCTTAA-A-CG");
- pll_set_tip_states(partition, 4, pll_map_nt, "CAC-TCA-A-TG");
-
- pll_set_category_rates(partition, rate_cats);
-
- pll_update_prob_matrices(partition, params_indices, matrix_indices, branch_lengths, 4);
- pll_update_partials(partition, operations, 4);
-
- for (j = 0; j < 4; ++j)
- {
- printf ("[%d] P-matrix for branch length %f\n", i, branch_lengths[j]);
- pll_show_pmatrix(partition, j, FLOAT_PRECISION);
- printf ("\n");
- }
-
- /* show CLVs */
- printf ("[%d] CLV 5: ", i);
- pll_show_clv(partition,5,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 6: ", i);
- pll_show_clv(partition,6,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 7: ", i);
- pll_show_clv(partition,7,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
-
- lk_score = pll_compute_root_loglikelihood(partition,
- 8,
- PLL_SCALE_BUFFER_NONE,
- params_indices,
- persite_lnl);
-
- /* test illegal alpha value */
- double invalid_alpha = 0;
- if (pll_compute_gamma_cats(invalid_alpha, N_CAT_GAMMA, rate_cats) == PLL_FAILURE)
- {
- if (pll_errno != PLL_ERROR_PARAM_INVALID)
- printf("Error is %d instead of %d\n", pll_errno, PLL_ERROR_PARAM_INVALID);
- }
- else
- {
- printf("Computing gamma rates for alpha = %f should have failed\n",
- invalid_alpha);
- }
-
- printf("\n");
- printf("inner-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- /* move to tip inner */
-
- operations[0].parent_clv_index = 7;
- operations[0].child1_clv_index = 6;
- operations[0].child2_clv_index = 3;
- operations[0].child1_matrix_index = 0;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 8;
- operations[1].child1_clv_index = 7;
- operations[1].child2_clv_index = 4;
- operations[1].child1_matrix_index = 2;
- operations[1].child2_matrix_index = 3;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- pll_update_partials(partition, operations, 2);
-
- lk_score = pll_compute_root_loglikelihood(partition,
- 8,
- PLL_SCALE_BUFFER_NONE,
- params_indices,
- persite_lnl);
-
- printf("tip-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- pll_partition_destroy(partition);
- free(persite_lnl);
- free(operations);
-
- return (0);
-}
diff --git a/test/src/00021_NMAR_lkcalc.c b/test/src/00021_NMAR_lkcalc.c
deleted file mode 100644
index 348e328..0000000
--- a/test/src/00021_NMAR_lkcalc.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- Copyright (C) 2015 Diego Darriba, Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Diego Darriba <Diego.Darriba at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-#include "common.h"
-
-#define N_STATES_AA 20
-#define N_CAT_GAMMA 4
-#define FLOAT_PRECISION 4
-
-static double alpha = 0.5;
-static unsigned int n_cat_gamma = N_CAT_GAMMA;
-unsigned int params_indices[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-int main(int argc, char * argv[])
-{
- unsigned int i,j;
- double lk_score;
- unsigned int n_sites = 12;
- unsigned int n_tips = 5;
- double rate_cats[N_CAT_GAMMA];
- pll_operation_t * operations;
- double * persite_lnl = (double *) malloc(n_sites * sizeof(double));
- double checksum;
- int return_val;
-
- operations = (pll_operation_t *)malloc(4* sizeof(pll_operation_t));
-
- operations[0].parent_clv_index = 5;
- operations[0].child1_clv_index = 0;
- operations[0].child2_clv_index = 1;
- operations[0].child1_matrix_index = 1;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 6;
- operations[1].child1_clv_index = 5;
- operations[1].child2_clv_index = 2;
- operations[1].child1_matrix_index = 0;
- operations[1].child2_matrix_index = 1;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[2].parent_clv_index = 7;
- operations[2].child1_clv_index = 3;
- operations[2].child2_clv_index = 4;
- operations[2].child1_matrix_index = 1;
- operations[2].child2_matrix_index = 1;
- operations[2].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[3].parent_clv_index = 8;
- operations[3].child1_clv_index = 7;
- operations[3].child2_clv_index = 6;
- operations[3].child1_matrix_index = 2;
- operations[3].child2_matrix_index = 3;
- operations[3].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[3].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[3].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- /* check attributes */
- unsigned int attributes = get_attributes(argc, argv);
-
- pll_partition_t * partition;
- partition = pll_partition_create(
- n_tips, /* numer of tips */
- 4, /* clv buffers */
- N_STATES_AA, /* number of states */
- n_sites, /* sequence length */
- 1, /* different rate parameters */
- 2*n_tips-3, /* probability matrices */
- n_cat_gamma, /* gamma categories */
- 0, /* scale buffers */
- attributes
- ); /* attributes */
-
- if (!partition)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail creating partition");
- }
-
- double branch_lengths[4] = { 0.5, 0.5, 0.3, 0.2};
- unsigned int matrix_indices[4] = { 0, 1, 2, 3 };
-
- if (pll_compute_gamma_cats(alpha, n_cat_gamma, rate_cats) == PLL_FAILURE)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail computing gamma cats");
- }
-
- pll_set_frequencies(partition, 0, pll_aa_freqs_dayhoff);
- pll_set_subst_params(partition, 0, pll_aa_rates_dayhoff);
-
- return_val = PLL_SUCCESS;
- return_val &= pll_set_tip_states(partition, 0, pll_map_aa, "PIGLRVTLRRDRMWI");
- return_val &= pll_set_tip_states(partition, 1, pll_map_aa, "IQGMDITIVT-----");
- return_val &= pll_set_tip_states(partition, 2, pll_map_aa, "--AFALLQKIGMPFE");
- return_val &= pll_set_tip_states(partition, 3, pll_map_aa, "MDISIVT------TA");
- return_val &= pll_set_tip_states(partition, 4, pll_map_aa, "GLSEQTVFHEIDQDK");
-
- if (!return_val)
- fatal("Error setting tip states");
-
- pll_set_category_rates(partition, rate_cats);
-
- pll_update_prob_matrices(partition, params_indices, matrix_indices, branch_lengths, 4);
- pll_update_partials(partition, operations, 4);
-
- for (j = 0; j < 4; ++j)
- {
- printf ("[%d] P-matrix for branch length %f\n", i, branch_lengths[j]);
- pll_show_pmatrix(partition, j, FLOAT_PRECISION);
- printf ("\n");
- }
-
- /* show CLVs */
- printf ("[%d] CLV 5: ", i);
- pll_show_clv(partition,5,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 6: ", i);
- pll_show_clv(partition,6,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 7: ", i);
- pll_show_clv(partition,7,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
-
- lk_score = pll_compute_root_loglikelihood(partition,
- 8,
- PLL_SCALE_BUFFER_NONE,
- params_indices,
- persite_lnl);
-
- printf("\n");
- printf("inner-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- /* move to tip inner */
-
- operations[0].parent_clv_index = 7;
- operations[0].child1_clv_index = 6;
- operations[0].child2_clv_index = 3;
- operations[0].child1_matrix_index = 0;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 8;
- operations[1].child1_clv_index = 7;
- operations[1].child2_clv_index = 4;
- operations[1].child1_matrix_index = 2;
- operations[1].child2_matrix_index = 3;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- pll_update_partials(partition, operations, 2);
-
- lk_score = pll_compute_root_loglikelihood(partition,
- 8,
- PLL_SCALE_BUFFER_NONE,
- params_indices,
- persite_lnl);
-
- printf("tip-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- pll_partition_destroy(partition);
- free(persite_lnl);
- free(operations);
-
- return (0);
-}
diff --git a/test/src/00022_NMOR_lkcalc.c b/test/src/00022_NMOR_lkcalc.c
deleted file mode 100644
index d578602..0000000
--- a/test/src/00022_NMOR_lkcalc.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- Copyright (C) 2015 Diego Darriba, Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Diego Darriba <Diego.Darriba at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-#include "common.h"
-
-#define N_STATES_ODD 7
-#define N_SUBST_PARAMS 21 // N_STATES*(N_STATES-1)/2
-#define N_CAT_GAMMA 4
-#define FLOAT_PRECISION 4
-
-static double alpha = 0.5;
-static unsigned int n_cat_gamma = N_CAT_GAMMA;
-unsigned int params_indices[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-/* odd map with 7 states: A..G */
-const unsigned int odd_map[256] =
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x3f, 0, 0, 0x3f, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x3f, 0, 0x01, 0x02, 0x04,
- 0x08, 0x0c, 0x10, 0x20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0x01, 0x02, 0x04, 0x08, 0x0c, 0x10, 0x20, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-int main(int argc, char * argv[])
-{
- unsigned int i,j;
- double lk_score;
- unsigned int n_sites = 12;
- unsigned int n_tips = 5;
- double rate_cats[N_CAT_GAMMA];
- pll_operation_t * operations;
- double * persite_lnl = (double *) malloc(n_sites * sizeof(double));
- double checksum;
- int return_val;
-
- operations = (pll_operation_t *)malloc(4* sizeof(pll_operation_t));
-
- operations[0].parent_clv_index = 5;
- operations[0].child1_clv_index = 0;
- operations[0].child2_clv_index = 1;
- operations[0].child1_matrix_index = 1;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 6;
- operations[1].child1_clv_index = 5;
- operations[1].child2_clv_index = 2;
- operations[1].child1_matrix_index = 0;
- operations[1].child2_matrix_index = 1;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[2].parent_clv_index = 7;
- operations[2].child1_clv_index = 3;
- operations[2].child2_clv_index = 4;
- operations[2].child1_matrix_index = 1;
- operations[2].child2_matrix_index = 1;
- operations[2].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[3].parent_clv_index = 8;
- operations[3].child1_clv_index = 7;
- operations[3].child2_clv_index = 6;
- operations[3].child1_matrix_index = 2;
- operations[3].child2_matrix_index = 3;
- operations[3].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[3].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[3].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- /* check attributes */
- unsigned int attributes = get_attributes(argc, argv);
-
- pll_partition_t * partition;
- partition = pll_partition_create(
- n_tips, /* numer of tips */
- 4, /* clv buffers */
- N_STATES_ODD, /* number of states */
- n_sites, /* sequence length */
- 1, /* different rate parameters */
- 2*n_tips-3, /* probability matrices */
- n_cat_gamma, /* gamma categories */
- 0, /* scale buffers */
- attributes
- ); /* attributes */
-
- if (!partition)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail creating partition");
- }
-
- double branch_lengths[4] = { 0.5, 0.5, 0.3, 0.2};
- double frequencies[N_STATES_ODD] = {0.12, 0.14, 0.13, 0.11, 0.15, 0.13, 0.12};
- unsigned int matrix_indices[4] = { 0, 1, 2, 3 };
- double subst_params[N_SUBST_PARAMS] = { 0.5, 2.0, 3.0, 4.0, 5.0, 1.1,
- 1.2, 1.3, 1.4, 1.5, 2.1,
- 2.2, 2.3, 2.4, 2.5,
- 3.1, 3.2, 3.3,
- 3.4, 3.5,
- 1.0 };
-
- if (pll_compute_gamma_cats(alpha, n_cat_gamma, rate_cats) == PLL_FAILURE)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail computing gamma cats");
- }
-
- pll_set_frequencies(partition, 0, frequencies);
- pll_set_subst_params(partition, 0, subst_params);
-
- return_val = PLL_SUCCESS;
- return_val &= pll_set_tip_states(partition, 0, odd_map, "AAB-CCD-EFAA");
- return_val &= pll_set_tip_states(partition, 1, odd_map, "ACC-FBA-ABGG");
- return_val &= pll_set_tip_states(partition, 2, odd_map, "A-C-GAG-GCCF");
- return_val &= pll_set_tip_states(partition, 3, odd_map, "ADCFCAA-A-CG");
- return_val &= pll_set_tip_states(partition, 4, odd_map, "ABC-BCA-A-BG");
-
- if (!return_val)
- fatal("Error setting tip states");
-
- pll_set_category_rates(partition, rate_cats);
-
- pll_update_prob_matrices(partition, params_indices, matrix_indices, branch_lengths, 4);
- pll_update_partials(partition, operations, 4);
-
- for (j = 0; j < 4; ++j)
- {
- printf ("[%d] P-matrix for branch length %f\n", i, branch_lengths[j]);
- pll_show_pmatrix(partition, j, FLOAT_PRECISION);
- printf ("\n");
- }
-
- /* show CLVs */
- printf ("[%d] CLV 5: ", i);
- pll_show_clv(partition,5,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 6: ", i);
- pll_show_clv(partition,6,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 7: ", i);
- pll_show_clv(partition,7,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
-
- lk_score = pll_compute_root_loglikelihood(partition,
- 8,
- PLL_SCALE_BUFFER_NONE,
- params_indices,
- persite_lnl);
-
- /* test illegal alpha value */
- double invalid_alpha = 0;
- if (pll_compute_gamma_cats(invalid_alpha, N_CAT_GAMMA, rate_cats) == PLL_FAILURE)
- {
- if (pll_errno != PLL_ERROR_PARAM_INVALID)
- printf("Error is %d instead of %d\n", pll_errno, PLL_ERROR_PARAM_INVALID);
- }
- else
- {
- printf("Computing gamma rates for alpha = %f should have failed\n",
- invalid_alpha);
- }
-
- printf("\n");
- printf("inner-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- /* move to tip inner */
-
- operations[0].parent_clv_index = 7;
- operations[0].child1_clv_index = 6;
- operations[0].child2_clv_index = 3;
- operations[0].child1_matrix_index = 0;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 8;
- operations[1].child1_clv_index = 7;
- operations[1].child2_clv_index = 4;
- operations[1].child1_matrix_index = 2;
- operations[1].child2_matrix_index = 3;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- pll_update_partials(partition, operations, 2);
-
- lk_score = pll_compute_root_loglikelihood(partition,
- 8,
- PLL_SCALE_BUFFER_NONE,
- params_indices,
- persite_lnl);
-
- printf("tip-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- pll_partition_destroy(partition);
- free(persite_lnl);
- free(operations);
-
- return (0);
-}
diff --git a/test/src/00030_NMDU_gamma.c b/test/src/00030_NMDU_gamma.c
deleted file mode 100644
index 8a64118..0000000
--- a/test/src/00030_NMDU_gamma.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- Copyright (C) 2015 Diego Darriba, Tomas Flouri
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- Contact: Diego Darriba <Diego.Darriba at h-its.org>,
- Exelixis Lab, Heidelberg Instutute for Theoretical Studies
- Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
-*/
-#include "common.h"
-
-#define N_STATES_NT 4
-#define N_CAT_GAMMA 4
-#define FLOAT_PRECISION 4
-
-static double titv = 2.5;
-static double alpha = 0.5;
-static unsigned int n_cat_gamma = N_CAT_GAMMA;
-unsigned int params_indices[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
-
-int main(int argc, char * argv[])
-{
- unsigned int i,j;
- double lk_score;
- unsigned int n_sites = 12;
- unsigned int n_tips = 5;
- double rate_cats[N_CAT_GAMMA];
- int return_val;
- pll_operation_t * operations;
-
- operations = (pll_operation_t *)malloc(4* sizeof(pll_operation_t));
-
- operations[0].parent_clv_index = 5;
- operations[0].child1_clv_index = 0;
- operations[0].child2_clv_index = 1;
- operations[0].child1_matrix_index = 1;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[1].parent_clv_index = 6;
- operations[1].child1_clv_index = 5;
- operations[1].child2_clv_index = 2;
- operations[1].child1_matrix_index = 0;
- operations[1].child2_matrix_index = 1;
- operations[1].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[1].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- operations[2].parent_clv_index = 7;
- operations[2].child1_clv_index = 3;
- operations[2].child2_clv_index = 4;
- operations[2].child1_matrix_index = 1;
- operations[2].child2_matrix_index = 1;
- operations[2].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[2].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- /* check attributes */
- unsigned int attributes = get_attributes(argc, argv);
-
- pll_partition_t * partition;
- partition = pll_partition_create(
- n_tips, /* numer of tips */
- 4, /* clv buffers */
- N_STATES_NT, /* number of states */
- n_sites, /* sequence length */
- 1, /* different rate parameters */
- 2*n_tips-3, /* probability matrices */
- n_cat_gamma, /* gamma categories */
- 0, /* scale buffers */
- attributes
- ); /* attributes */
-
- if (!partition)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail creating partition");
- }
-
- double branch_lengths[4] = { 0.1, 0.2, 1, 1};
- double frequencies[4] = { 0.3, 0.4, 0.1, 0.2 };
- unsigned int matrix_indices[4] = { 0, 1, 2, 3 };
- double subst_params[6] = {1,titv,1,1,titv,1};
- double * persite_lnl = (double *) malloc(n_sites * sizeof(double));
- double checksum;
-
- if (pll_compute_gamma_cats(alpha, n_cat_gamma, rate_cats) == PLL_FAILURE)
- {
- printf("Error %d: %s\n", pll_errno, pll_errmsg);
- fatal("Fail computing gamma cats");
- }
-
- pll_set_frequencies(partition, 0, frequencies);
- pll_set_subst_params(partition, 0, subst_params);
-
- return_val = PLL_SUCCESS;
- return_val &= pll_set_tip_states(partition, 0, pll_map_nt, "WAC-CTA-ATCT");
- return_val &= pll_set_tip_states(partition, 1, pll_map_nt, "CCC-TTA-ATGT");
- return_val &= pll_set_tip_states(partition, 2, pll_map_nt, "A-C-TAG-CTCT");
- return_val &= pll_set_tip_states(partition, 3, pll_map_nt, "CTCTTAA-A-CG");
- return_val &= pll_set_tip_states(partition, 4, pll_map_nt, "CAC-TCA-A-TG");
-
- if (!return_val)
- fatal("Error setting tip states");
-
- pll_set_category_rates(partition, rate_cats);
-
- pll_update_prob_matrices(partition, params_indices, matrix_indices, branch_lengths, 4);
- pll_update_partials(partition, operations, 3);
-
- for (j = 0; j < 4; ++j)
- {
- printf ("[%d] P-matrix for branch length %f\n", i, branch_lengths[j]);
- pll_show_pmatrix(partition, j, FLOAT_PRECISION);
- printf ("\n");
- }
-
- /* show CLVs */
- printf ("[%d] CLV 5: ", i);
- pll_show_clv(partition,5,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 6: ", i);
- pll_show_clv(partition,6,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
- printf ("[%d] CLV 7: ", i);
- pll_show_clv(partition,7,PLL_SCALE_BUFFER_NONE,FLOAT_PRECISION+1);
-
- lk_score = pll_compute_edge_loglikelihood(partition,
- 6,
- PLL_SCALE_BUFFER_NONE,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 0,
- params_indices,
- persite_lnl);
-
- /* test illegal alpha value */
- double invalid_alpha = 0;
- if (pll_compute_gamma_cats(invalid_alpha, N_CAT_GAMMA, rate_cats) == PLL_FAILURE)
- {
- if (pll_errno != PLL_ERROR_PARAM_INVALID)
- printf("Error is %d instead of %d\n", pll_errno, PLL_ERROR_PARAM_INVALID);
- }
- else
- {
- printf("Computing gamma rates for alpha = %f should have failed\n",
- invalid_alpha);
- }
-
- printf("\n");
- printf("inner-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- /* move to tip inner */
-
- operations[0].parent_clv_index = 7;
- operations[0].child1_clv_index = 6;
- operations[0].child2_clv_index = 3;
- operations[0].child1_matrix_index = 0;
- operations[0].child2_matrix_index = 1;
- operations[0].parent_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child1_scaler_index = PLL_SCALE_BUFFER_NONE;
- operations[0].child2_scaler_index = PLL_SCALE_BUFFER_NONE;
-
- pll_update_partials(partition, operations, 1);
-
- lk_score = pll_compute_edge_loglikelihood(partition,
- 7,
- PLL_SCALE_BUFFER_NONE,
- 4,
- PLL_SCALE_BUFFER_NONE,
- 1,
- params_indices,
- persite_lnl);
-
- printf("tip-inner logL: %.6f\n",
- lk_score);
- printf("persite logL: ");
- checksum = 0.0;
- for (int i=0; i<n_sites; i++)
- {
- checksum += persite_lnl[i];
- printf("%.7f ", persite_lnl[i]);
- }
- printf("\n");
- printf("checksum logL: %.6f\n",
- checksum);
-
- pll_partition_destroy(partition);
- free(persite_lnl);
- free(operations);
-
- return (0);
-}
diff --git a/test/src/README.md b/test/src/README.md
index b395f9d..888b8b0 100644
--- a/test/src/README.md
+++ b/test/src/README.md
@@ -12,9 +12,6 @@ Each test must focus on evaluating one or a reduced set of features. Also
testing cases that should fail and it is determined how the library would
behave is interesting. For example, attempting to read an unexistent file.
-* 00010_NMPU_lkcalc compute likelihood score for a simple unrooted tree
-* 00020_NMPR_lkcalc compute likelihood score for a simple rooted tree
-
## alpha-cats
Evaluate the likelihood for different alpha shape parameters and number of
diff --git a/test/src/asc-bias.c b/test/src/asc-bias.c
index 5f0813a..2cb55b5 100644
--- a/test/src/asc-bias.c
+++ b/test/src/asc-bias.c
@@ -74,11 +74,10 @@ void print_operations(pll_operation_t * operations, unsigned int len)
static double eval(pll_partition_t * partition,
pll_utree_t * tree,
- double alpha,
- double old_lnl)
+ double alpha)
{
unsigned int i;
- double logl, upbl_logl;
+ double logl;
double d_f, dd_f;
double * sumtable;
@@ -102,11 +101,6 @@ static double eval(pll_partition_t * partition,
params_indices,
NULL);
- if (old_lnl < 0 && fabs(old_lnl - logl) > 1e-4)
- {
- printf("ERROR: Likelihood mismatch %f vs %f\n", logl, old_lnl);
- }
-
printf("Log-L: %f\n", logl);
sumtable = pll_aligned_alloc(
@@ -116,8 +110,6 @@ static double eval(pll_partition_t * partition,
pll_update_sumtable(partition,
tree->clv_index,
tree->back->clv_index,
- tree->scaler_index,
- tree->back->scaler_index,
params_indices,
sumtable);
@@ -145,7 +137,7 @@ static double eval(pll_partition_t * partition,
&(tree->pmatrix_index),
&branch_length,
1);
- upbl_logl = pll_compute_edge_loglikelihood(partition,
+ logl = pll_compute_edge_loglikelihood(partition,
tree->clv_index,
tree->scaler_index,
tree->back->clv_index,
@@ -154,10 +146,10 @@ static double eval(pll_partition_t * partition,
params_indices,
NULL);
- printf("%8.4f %18.6f %15.8e %15.8e ", branch_length, upbl_logl, d_f, dd_f);
- if (upbl_logl > max_logl)
+ printf("%8.4f %18.6f %15.8e %15.8e ", branch_length, logl, d_f, dd_f);
+ if (logl > max_logl)
{
- max_logl = upbl_logl;
+ max_logl = logl;
printf("*");
}
printf("\n");
@@ -175,12 +167,9 @@ int main(int argc, char * argv[])
unsigned int taxa_count, nodes_count, inner_nodes_count, branch_count;
double alpha = 0.5;
unsigned int rate_cats = 4;
- int i;
- double lnl_test[4] = {0};
/* check attributes */
attributes = get_attributes(argc, argv);
- attributes |= PLL_ATTRIB_AB_FLAG;
tree = pll_utree_parse_newick(TRE_FILENAME, &taxa_count);
printf("Read %s: %u taxa\n", TRE_FILENAME, taxa_count);
@@ -196,71 +185,68 @@ int main(int argc, char * argv[])
operations = (pll_operation_t *)malloc(inner_nodes_count *
sizeof(pll_operation_t));
- partition = parse_msa(MSA_FILENAME, taxa_count, STATES, rate_cats, 1,
- tree, attributes);
- printf("Read %s: %u sites\n", MSA_FILENAME, partition->sites);
-
- for (i=0;i<3;++i)
- {
- tree = tree->next;
-
- pll_set_asc_bias_type(partition, 0);
-
- pll_utree_traverse(tree,
- cb_full_traversal,
- travbuffer,
- &traversal_size);
-
- pll_utree_create_operations(travbuffer,
- traversal_size,
- branch_lengths,
- matrix_indices,
- operations,
- &matrix_count,
- &ops_count);
+ pll_utree_traverse(tree,
+ cb_full_traversal,
+ travbuffer,
+ &traversal_size);
- /* test 1: no ascertainment bias correction */
- printf("\nTEST 1: NO ASC BIAS\n");
+ pll_utree_create_operations(travbuffer,
+ traversal_size,
+ branch_lengths,
+ matrix_indices,
+ operations,
+ &matrix_count,
+ &ops_count);
- lnl_test[0] = eval(partition, tree, alpha, lnl_test[0]);
+ printf(" Traversal buffer: "); print_travbuffer(travbuffer, traversal_size);
+ printf(" Operations: "); print_operations(operations, ops_count);
- /* test 2: ascertainment bias correction */
- printf("\nTEST 2: ASC BIAS LEWIS\n");
-
- pll_set_asc_bias_type(partition, PLL_ATTRIB_AB_LEWIS);
+ /* test 1: no ascertainment bias correction */
+ printf("\nTEST 1: NO ASC BIAS\n");
+ partition = parse_msa(MSA_FILENAME, taxa_count, STATES, rate_cats, 1,
+ tree, attributes);
+ printf("Read %s: %u sites\n", MSA_FILENAME, partition->sites);
- lnl_test[1] = eval(partition, tree, alpha, lnl_test[1]);
+ eval(partition, tree, alpha);
- /* attempt to update invariant sites proportion. This should fail */
- if (pll_update_invariant_sites_proportion(partition, 0, 0.5))
- {
- printf("Error: Setting P-inv with ASC BIAS should fail");
- return 1;
- }
+ pll_partition_destroy(partition);
- /* test 2: ascertainment bias correction */
- printf("\nTEST 2: ASC BIAS FELSENSTEIN\n");
- pll_set_asc_bias_type(partition, PLL_ATTRIB_AB_FELSENSTEIN);
- pll_set_asc_state_weights(partition, invar_weights);
- lnl_test[2] = eval(partition, tree, alpha, lnl_test[2]);
-
- /* test 2: ascertainment bias correction */
- printf("\nTEST 2: ASC BIAS STAMATAKIS\n");
- pll_set_asc_bias_type(partition, PLL_ATTRIB_AB_STAMATAKIS);
- pll_set_asc_state_weights(partition, invar_weights);
+ /* test 2: ascertainment bias correction */
+ printf("\nTEST 2: ASC BIAS LEWIS\n");
+ attributes |= PLL_ATTRIB_AB_LEWIS;
+ partition = parse_msa(MSA_FILENAME, taxa_count, STATES, rate_cats, 1,
+ tree, attributes);
- lnl_test[3] = eval(partition, tree, alpha, lnl_test[3]);
+ pll_set_asc_bias_type(partition, PLL_ATTRIB_AB_LEWIS);
+ eval(partition, tree, alpha);
+ /* attempt to update invariant sites proportion. This should fail */
+ if (pll_update_invariant_sites_proportion(partition, 0, 0.5))
+ {
+ printf("Error: Setting P-inv with ASC BIAS should fail");
+ return 1;
}
- /* clean */
- free(travbuffer);
- free(branch_lengths);
- free(operations);
- free(matrix_indices);
- pll_partition_destroy(partition);
-
- pll_utree_destroy(tree,NULL);
+
+ /* test 2: ascertainment bias correction */
+ printf("\nTEST 2: ASC BIAS FELSENSTEIN\n");
+ pll_set_asc_bias_type(partition, PLL_ATTRIB_AB_FELSENSTEIN);
+ pll_set_asc_state_weights(partition, invar_weights);
+ eval(partition, tree, alpha);
+
+ /* test 2: ascertainment bias correction */
+ printf("\nTEST 2: ASC BIAS STAMATAKIS\n");
+ pll_set_asc_bias_type(partition, PLL_ATTRIB_AB_STAMATAKIS);
+ pll_set_asc_state_weights(partition, invar_weights);
+ eval(partition, tree, alpha);
+
+ /* clean */
+ free(travbuffer);
+ free(branch_lengths);
+ free(operations);
+ free(matrix_indices);
+ pll_utree_destroy(tree);
+ pll_partition_destroy(partition);
return 0;
}
diff --git a/test/src/common.c b/test/src/common.c
index 454689a..9e711a5 100644
--- a/test/src/common.c
+++ b/test/src/common.c
@@ -3,7 +3,6 @@
#include <stdlib.h>
#include <string.h>
#include <search.h>
-#include <stdarg.h>
unsigned int get_attributes(int argc, char **argv)
{
@@ -27,11 +26,6 @@ unsigned int get_attributes(int argc, char **argv)
/* sse3 vectorization */
attributes |= PLL_ATTRIB_ARCH_SSE;
}
- else if (!strcmp (argv[i], "avx2"))
- {
- /* avx2 vectorization */
- attributes |= PLL_ATTRIB_ARCH_AVX2;
- }
else
{
printf("Unrecognised attribute: %s\n", argv[i]);
@@ -51,31 +45,12 @@ void skip_test ()
It is intended to use with the test datasets that were
validated in advance. */
pll_partition_t * parse_msa(const char * filename,
- unsigned int taxa_count,
- unsigned int states,
- unsigned int rate_cats,
- unsigned int rate_matrices,
- pll_utree_t * tree,
- unsigned int attributes)
-{
- return parse_msa_reduced(filename,
- taxa_count,
- states,
- rate_cats,
- rate_matrices,
- tree,
- attributes,
- -1);
-}
-
-pll_partition_t * parse_msa_reduced(const char * filename,
unsigned int taxa_count,
unsigned int states,
unsigned int rate_cats,
unsigned int rate_matrices,
pll_utree_t * tree,
- unsigned int attributes,
- unsigned int max_sites)
+ unsigned int attributes)
{
unsigned int i;
pll_partition_t * partition;
@@ -120,9 +95,6 @@ pll_partition_t * parse_msa_reduced(const char * filename,
return NULL;
}
- if (max_sites != -1)
- sites = max_sites;
-
partition = pll_partition_create(taxa_count, /* tip nodes */
taxa_count - 2, /* inner nodes */
states,
@@ -145,11 +117,10 @@ pll_partition_t * parse_msa_reduced(const char * filename,
sizeof(unsigned int));
for (i = 0; i < taxa_count; ++i)
{
- data[i] = tipnodes[i]->clv_index;
+ data[i] = i;
ENTRY entry;
entry.key = tipnodes[i]->label;
entry.data = (void *)(data+i);
-
hsearch(entry, ENTER);
}
@@ -196,14 +167,3 @@ int cb_rfull_traversal(pll_rtree_t * node)
{
return 1;
}
-
-__attribute__((format(printf, 1, 2)))
-void fatal(const char * format, ...)
-{
- va_list argptr;
- va_start(argptr, format);
- vfprintf(stderr, format, argptr);
- va_end(argptr);
- fprintf(stderr, "\n");
- exit(EXIT_FAILURE);
-}
diff --git a/test/src/common.h b/test/src/common.h
index 3e38708..4d8f52c 100644
--- a/test/src/common.h
+++ b/test/src/common.h
@@ -37,18 +37,7 @@ pll_partition_t * parse_msa(const char * filename,
pll_utree_t * tree,
unsigned int attributes);
-pll_partition_t * parse_msa_reduced(const char * filename,
- unsigned int taxa_count,
- unsigned int states,
- unsigned int rate_cats,
- unsigned int rate_matrices,
- pll_utree_t * tree,
- unsigned int attributes,
- unsigned int max_sites);
int cb_full_traversal(pll_utree_t * node);
int cb_rfull_traversal(pll_rtree_t * node);
-/* print error and exit */
-void fatal(const char * format, ...) __attribute__ ((noreturn));
-
#endif /* COMMON_H_ */
diff --git a/test/src/derivatives-oddstates.c b/test/src/derivatives-oddstates.c
index e582cc4..d24d58b 100644
--- a/test/src/derivatives-oddstates.c
+++ b/test/src/derivatives-oddstates.c
@@ -197,9 +197,7 @@ int main(int argc, char * argv[])
params_indices,
NULL);
- pll_update_sumtable(partition, 6, 7,
- PLL_SCALE_BUFFER_NONE, PLL_SCALE_BUFFER_NONE,
- params_indices, sumtable);
+ pll_update_sumtable(partition, 6, 7, params_indices, sumtable);
for (b = 0; b < NUM_BRANCHES; ++b) {
if (!pll_compute_likelihood_derivatives(partition,
@@ -278,9 +276,7 @@ int main(int argc, char * argv[])
params_indices,
NULL);
- pll_update_sumtable(partition, 4, 7,
- PLL_SCALE_BUFFER_NONE, PLL_SCALE_BUFFER_NONE,
- params_indices, sumtable);
+ pll_update_sumtable(partition, 4, 7, params_indices, sumtable);
for (b = 0; b < NUM_BRANCHES; ++b) {
if (!pll_compute_likelihood_derivatives(partition,
diff --git a/test/src/derivatives.c b/test/src/derivatives.c
index dcdc552..b70e6fa 100644
--- a/test/src/derivatives.c
+++ b/test/src/derivatives.c
@@ -185,9 +185,7 @@ int main(int argc, char * argv[])
params_indices,
NULL);
- pll_update_sumtable(partition, 6, 7,
- PLL_SCALE_BUFFER_NONE, PLL_SCALE_BUFFER_NONE,
- params_indices, sumtable);
+ pll_update_sumtable(partition, 6, 7, params_indices, sumtable);
for (b = 0; b < NUM_BRANCHES; ++b) {
if (!pll_compute_likelihood_derivatives(partition,
@@ -266,9 +264,7 @@ int main(int argc, char * argv[])
params_indices,
NULL);
- pll_update_sumtable(partition, 4, 7,
- PLL_SCALE_BUFFER_NONE, PLL_SCALE_BUFFER_NONE,
- params_indices, sumtable);
+ pll_update_sumtable(partition, 4, 7, params_indices, sumtable);
for (b = 0; b < NUM_BRANCHES; ++b) {
if (!pll_compute_likelihood_derivatives(partition,
diff --git a/test/src/00110_NPDN_fasta.c b/test/src/fasta-dna.c
similarity index 100%
rename from test/src/00110_NPDN_fasta.c
rename to test/src/fasta-dna.c
diff --git a/test/src/00120_NPAN_fasta.c b/test/src/fasta-prot.c
similarity index 100%
rename from test/src/00120_NPAN_fasta.c
rename to test/src/fasta-prot.c
diff --git a/test/src/00032_NMOU_gamma.c b/test/src/odd-states.c
similarity index 100%
rename from test/src/00032_NMOU_gamma.c
rename to test/src/odd-states.c
diff --git a/test/src/partial-traversal.c b/test/src/partial-traversal.c
index 96cae29..424b999 100644
--- a/test/src/partial-traversal.c
+++ b/test/src/partial-traversal.c
@@ -1,6 +1,7 @@
#include "common.h"
#include "rng.h"
+#include <stdarg.h>
#include <search.h>
#define STATES 4
@@ -9,6 +10,8 @@
#define FASTAFILE "testdata/246x4465.fas"
#define TREEFILE "testdata/246x4465.tree"
+static void fatal(const char * format, ...) __attribute__ ((noreturn));
+
typedef struct
{
int clv_valid;
@@ -90,6 +93,16 @@ static void set_missing_branch_length(pll_utree_t * tree, double length)
set_missing_branch_length_recursive(tree->back, length);
}
+static void fatal(const char * format, ...)
+{
+ va_list argptr;
+ va_start(argptr, format);
+ vfprintf(stderr, format, argptr);
+ va_end(argptr);
+ fprintf(stderr, "\n");
+ exit(EXIT_FAILURE);
+}
+
int main(int argc, char * argv[])
{
unsigned int i,j,r;
@@ -106,7 +119,7 @@ int main(int argc, char * argv[])
/* parse the unrooted binary tree in newick format, and store the number
of tip nodes in tip_nodes_count */
pll_utree_t * tree = pll_utree_parse_newick(TREEFILE, &tip_nodes_count);
-
+
unsigned int attributes = get_attributes(argc, argv);
/* fix all missing branch lengths (i.e. those that did not appear in the
@@ -133,7 +146,7 @@ int main(int argc, char * argv[])
hcreate(tip_nodes_count);
/* populate a libc hash table with tree tip labels */
- unsigned int * data = (unsigned int *)malloc(tip_nodes_count *
+ unsigned int * data = (unsigned int *)malloc(tip_nodes_count *
sizeof(unsigned int));
for (i = 0; i < tip_nodes_count; ++i)
{
@@ -234,7 +247,7 @@ int main(int argc, char * argv[])
if (!found)
fatal("Sequence with header %s does not appear in the tree", hdr);
-
+
unsigned int tip_clv_index = *((unsigned int *)(found->data));
pll_set_tip_states(partition, tip_clv_index, pll_map_nt, seqdata[i]);
@@ -258,14 +271,14 @@ int main(int argc, char * argv[])
free(headers);
- /* allocate a buffer for storing pointers to nodes of the tree in postorder
+ /* allocate a buffer for storing pointers to nodes of the tree in postorder
traversal */
travbuffer = (pll_utree_t **)malloc(nodes_count * sizeof(pll_utree_t *));
branch_lengths = (double *)malloc(branch_count * sizeof(double));
matrix_indices = (unsigned int *)malloc(branch_count * sizeof(int));
- operations = (pll_operation_t *)malloc(inner_nodes_count *
+ operations = (pll_operation_t *)malloc(inner_nodes_count *
sizeof(pll_operation_t));
/* get inner nodes */
@@ -290,17 +303,17 @@ int main(int argc, char * argv[])
r = RAND % inner_nodes_count;
pll_utree_t * node = inner_nodes_list[r];
- /* compute a partial traversal starting from the randomly selected
+ /* compute a partial traversal starting from the randomly selected
inner node */
-
- if (!pll_utree_traverse(node,
- cb_partial_traversal,
+
+ if (!pll_utree_traverse(node,
+ cb_partial_traversal,
travbuffer,
&traversal_size))
fatal("Function pll_utree_traverse() requires inner nodes as parameters");
- /* given the computed traversal descriptor, generate the operations
- structure, and the corresponding probability matrix indices that
+ /* given the computed traversal descriptor, generate the operations
+ structure, and the corresponding probability matrix indices that
may need recomputing */
pll_utree_create_operations(travbuffer,
traversal_size,
@@ -325,13 +338,13 @@ int main(int argc, char * argv[])
printf ("Matrices: %d\n", matrix_count);
/* update matrix_count probability matrices for model with index 0. The i-th
- matrix (i ranges from 0 to matrix_count - 1) is generated using branch
- length branch_lengths[i] and can be refered to with index
+ matrix (i ranges from 0 to matrix_count - 1) is generated using branch
+ length branch_lengths[i] and can be refered to with index
matrix_indices[i] */
- pll_update_prob_matrices(partition,
- params_indices,
- matrix_indices,
- branch_lengths,
+ pll_update_prob_matrices(partition,
+ params_indices,
+ matrix_indices,
+ branch_lengths,
matrix_count);
/* use the operations array to compute all ops_count inner CLVs. Operations
@@ -374,7 +387,7 @@ int main(int argc, char * argv[])
/* destroy all structures allocated for the concrete PLL partition instance */
pll_partition_destroy(partition);
- /* deallocate traversal buffer, branch lengths array, matrix indices
+ /* deallocate traversal buffer, branch lengths array, matrix indices
array and operations */
free(travbuffer);
free(branch_lengths);
@@ -382,7 +395,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_utree_destroy(tree,NULL);
+ pll_utree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/test/src/rooted-tipinner.c b/test/src/rooted-tipinner.c
index 3fdf2bb..6d8742c 100644
--- a/test/src/rooted-tipinner.c
+++ b/test/src/rooted-tipinner.c
@@ -9,6 +9,7 @@
#define FASTAFILE "testdata/small.fas"
#define TREEFILE "testdata/small.rooted.tip.tree"
+static void fatal(const char * format, ...) __attribute__ ((noreturn));
static double prop_invar_list[4] = {0.0, 0.1, 0.5, 0.9};
typedef struct
@@ -16,6 +17,16 @@ typedef struct
int clv_valid;
} node_info_t;
+static void fatal(const char * format, ...)
+{
+ va_list argptr;
+ va_start(argptr, format);
+ vfprintf(stderr, format, argptr);
+ va_end(argptr);
+ fprintf(stderr, "\n");
+ exit(EXIT_FAILURE);
+}
+
int main(int argc, char * argv[])
{
unsigned int i, j;
@@ -289,7 +300,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_rtree_destroy(tree,NULL);
+ pll_rtree_destroy(tree);
return (EXIT_SUCCESS);
}
diff --git a/test/src/rooted.c b/test/src/rooted.c
index 1a274ff..2e898a3 100644
--- a/test/src/rooted.c
+++ b/test/src/rooted.c
@@ -10,6 +10,7 @@
#define TREEFILE "testdata/small.rooted.tree"
#define TREEFILE_TIP "testdata/small.rooted.tip.tree"
+static void fatal(const char * format, ...) __attribute__ ((noreturn));
static double prop_invar_list[4] = {0.0, 0.1, 0.5, 0.9};
typedef struct
@@ -17,6 +18,16 @@ typedef struct
int clv_valid;
} node_info_t;
+static void fatal(const char * format, ...)
+{
+ va_list argptr;
+ va_start(argptr, format);
+ vfprintf(stderr, format, argptr);
+ va_end(argptr);
+ fprintf(stderr, "\n");
+ exit(EXIT_FAILURE);
+}
+
int main(int argc, char * argv[])
{
unsigned int i, j;
@@ -256,6 +267,12 @@ int main(int argc, char * argv[])
will be carried out sequentially starting from operation 0 towrds ops_count-1 */
pll_update_partials(partition, operations, ops_count);
+ // for (i = tip_nodes_count; i < nodes_count; ++i)
+ // {
+ // printf ("CLV %d: ", i);
+ // pll_show_clv(partition,i, PLL_SCALE_BUFFER_NONE, 6);
+ // }
+
/* compute the likelihood on an edge of the unrooted tree by specifying
the CLV indices at the two end-point of the branch, the probability matrix
index for the concrete branch length, and the index of the model of whose
@@ -284,7 +301,7 @@ int main(int argc, char * argv[])
free(operations);
/* we will no longer need the tree structure */
- pll_rtree_destroy(tree,NULL);
+ pll_rtree_destroy(tree);
return (EXIT_SUCCESS);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libpll.git
More information about the debian-med-commit
mailing list