Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing a bug where the CPLEX check was forcefully implemented even when using Gurobi #96

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions R/JaBbA.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,29 @@ low.count=high.count=seg=chromosome=alpha_high=alpha_low=beta_high=beta_low=pred
!file.exists(paste0(cplex.dir, "/cplex/lib"))){
jmessage("${CPLEX_DIR}/cplex/[(include)|(lib)] do not both exist")
}

cplex_installed = ((file.exists(paste0(cplex.dir, "/cplex"))) & (file.exists(paste0(cplex.dir, "/cplex/include")) ||
file.exists(paste0(cplex.dir, "/cplex/lib"))))

if (!requireNamespace("gurobi", quietly = TRUE)) {
jmessage("Gurobi is not installed! REMEMBER: You need to have either CPLEX or Gurobi!")
gurobi_installed = (requireNamespace("gurobi", quietly = TRUE))

if ((!cplex_installed) & (gurobi_installed)) {
jmessage("Gurobi is found.")

} else {
} else if ((cplex_installed) & (!gurobi_installed)) {

library(gGnome)
gGnome:::testOptimizationFunction()
}

} else if ((cplex_installed) & (gurobi_installed)) {

library(gGnome)
gGnome:::testOptimizationFunction()

} else {

jmessage("WARNING: Both CPLEX and Gurobi not found!")
}

invisible()
}
Expand Down