From dba4e07f84815313e2c6eaea72af3d2940309596 Mon Sep 17 00:00:00 2001 From: Thomas Flouris Date: Fri, 12 May 2017 20:57:32 +0100 Subject: [PATCH] pll_set_tip_clv now accepts a parameter indicating whether input array is padded --- src/pll.c | 5 +++-- src/pll.h | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pll.c b/src/pll.c index d3a4691..d0d64f1 100644 --- a/src/pll.c +++ b/src/pll.c @@ -988,7 +988,8 @@ PLL_EXPORT int pll_set_tip_states(pll_partition_t * partition, //TODO: We should account for padding before calling this function PLL_EXPORT int pll_set_tip_clv(pll_partition_t * partition, unsigned int tip_index, - const double * clv) + const double * clv, + int padding) { unsigned int i,j,k; @@ -1009,7 +1010,7 @@ PLL_EXPORT int pll_set_tip_clv(pll_partition_t * partition, memcpy(tipclv, clv, partition->states*sizeof(double)); tipclv += partition->states_padded; } - clv += partition->states_padded; + clv += padding ? partition->states_padded : partition->states; } /* if asc_bias is set, we initialize the additional positions */ diff --git a/src/pll.h b/src/pll.h index a63fe53..b84b746 100644 --- a/src/pll.h +++ b/src/pll.h @@ -55,6 +55,9 @@ #define PLL_FAILURE 0 #define PLL_SUCCESS 1 +#define PLL_FALSE 0 +#define PLL_TRUE 1 + #define PLL_ALIGNMENT_CPU 8 #define PLL_ALIGNMENT_SSE 16 #define PLL_ALIGNMENT_AVX 32 @@ -505,7 +508,8 @@ PLL_EXPORT int pll_set_tip_states(pll_partition_t * partition, PLL_EXPORT int pll_set_tip_clv(pll_partition_t * partition, unsigned int tip_index, - const double * clv); + const double * clv, + int padding); PLL_EXPORT void pll_set_pattern_weights(pll_partition_t * partition, const unsigned int * pattern_weights);