From 4e51ae54f16b57079c99b17bc94f55c8d1358801 Mon Sep 17 00:00:00 2001 From: stla Date: Wed, 28 Aug 2024 02:41:01 +0200 Subject: [PATCH] fix attempt --- R/CPP.R | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/R/CPP.R b/R/CPP.R index d013ff9..7737ef9 100644 --- a/R/CPP.R +++ b/R/CPP.R @@ -96,14 +96,14 @@ JackPol <- function(n, lambda, alpha, which = "J") { return(qzero()) } which <- match.arg(which, c("J", "P", "Q", "C")) - alpha <- as.character(alpha) - if(alpha == "0") { + alpha_c <- as.character(alpha) + if(alpha_c == "0") { lambdaPrime <- dualPartition(lambda) f <- prod(factorialZ(lambdaPrime)) JackPolynomial <- f * esPolynomial(n, lambdaPrime) } else { JackPolynomial <- - qspray_from_list(JackPolRcpp(as.integer(n), lambda, alpha)) + qspray_from_list(JackPolRcpp(as.integer(n), lambda, alpha_c)) } if(which != "J") { K <- switch( @@ -152,7 +152,8 @@ Jack <- function(x, lambda, alpha) { if(is.na(alpha)) { stop("Invalid `alpha`.") } - alpha <- as.character(alpha) + alpha_q <- alpha + alpha <- as.character(alpha_q) x <- as.bigq(x) x <- as.character(x) } else if(isNumber(alpha)) { @@ -174,7 +175,7 @@ Jack <- function(x, lambda, alpha) { return(f * ESF(x, lambdaPrime)) } if(gmp) { - res <- JackEvalRcpp_gmpq(x, lambda, alpha) + res <- JackEvalRcpp_gmpq(x, lambda, alpha_q) as.bigq(res) } else { JackEvalRcpp_double(x, lambda, alpha)