Nothing
## Vectorizing the objective function
##
## Enio Gjerga, 2020
transformObjectiveFunction <- function(mt = mt, lpFile = lpFile){
matrixProblem <- matrix(data = , nrow = 1, ncol = nrow(mt))
idx <- which(grepl(pattern = "Obj:", x = lpFile$`enter Problem`))
problem <- as.character(lpFile[idx, ])
problem <- gsub(pattern = "Obj:\t ", replacement = "", x = problem,
fixed = TRUE)
coefficients <- as.numeric(
unlist(
lapply(
strsplit(
x = strsplit(
x = problem, split = "+ ", fixed = TRUE)[[1]],
split = " ", fixed = TRUE), "[[", 1)))
varID <- as.character(
unlist(
lapply(
strsplit(
x = strsplit(
x = problem, split = "+ ", fixed = TRUE)[[1]],
split = " ", fixed = TRUE), "[[", 2)))
idx <- rep(NA, length(varID))
for(ii in seq_len(length(varID))){
idx[ii] = which(mt[, 1]==varID[ii])
}
f.obj = rep(0, nrow(mt))
f.obj[idx] = coefficients
return(f.obj)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.