Skip to content

Commit

Permalink
CF fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Nov 5, 2023
1 parent dd9ce54 commit 580c2a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions R/symengine.R
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ rxToSE <- function(x, envir = NULL, progress = FALSE,
call. = FALSE
)
} else if (length(.ret0) == length(.f)) {
if (is.environment(envir)){
if (is.environment(envir)) {
assign(.fun, .rxFunction(.fun), envir = envir)
}
.ret0 <- unlist(.ret0)
Expand Down Expand Up @@ -3390,7 +3390,7 @@ rxSupportedFuns <- function() {
.rxFun2cIf <- function(x, envir) {
.logic <- .rxFun2c(x[[2]], envir=envir)
.pre <- paste0(rep(" ", envir$n), collapse="")
.ret <- paste(.pre, "if (", .logic, ") ");
.ret <- paste(.pre, "if (", .logic, ") ")
.ret <- paste0(.ret, .rxFun2c(x[[3]], envir=envir))

if (length(x) == 3) {
Expand Down Expand Up @@ -3446,7 +3446,7 @@ rxSupportedFuns <- function() {
identical(x[[1]], quote(`>=`)) ||
identical(x[[1]], quote(`!=`)) ||
identical(x[[1]], quote(`!`))
){
) {
return(.rxFun2cLogic(x, envir=envir))
} else if (identical(x[[1]], quote(`*`)) ||
identical(x[[1]], quote(`**`)) ||
Expand Down Expand Up @@ -3595,7 +3595,7 @@ rxFun2c <- function(fun, name, onlyF=FALSE) {
.s <- rxS(.body)
.lastValue <- .s$rxLastValue
return(c(list(.ret),
lapply(.env$args, function(v){
lapply(.env$args, function(v) {
.v <- symengine::D(.lastValue, symengine::S(v))
.v <- paste0("function(", paste(.env$args, collapse=", "), ") {\n", rxOptExpr(paste0("rxLastValue=", rxFromSE(.v)), msg=paste0("d(", .funName, ")/d(", v, ")")),
"\nrxLastValue}")
Expand Down
2 changes: 1 addition & 1 deletion R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ model <- function(x, ..., append=FALSE, auto=getOption("rxode2.autoVarPiping", T
cov=NULL, envir=parent.frame()) {
if (is(substitute(x), "{")) {
.funName <- try(as.character(as.list(with(envir, match.call()))[[1]]), silent=TRUE)
if (inherits(.funName, "try-error")){
if (inherits(.funName, "try-error")) {
.funName <- NULL
} else if (length(.funName) == 1L && exists(.funName, envir=parent.env(envir))) {
rxode2parse::.udfEnvSet(parent.env(envir))
Expand Down

0 comments on commit 580c2a8

Please sign in to comment.