Rmosek can be loaded with
All functions of Rmosek are found by
The short manual of a function is found by
The short manual of the 'mosek' function would first tell you that it calls MOSEK to solve the optimization problem given to it, and then present all of its arguments with descriptions and examples. On this homepage, we will skip right to the examples.
A linear optimization problem is defined and solved.
lo1 <- list()
lo1$sense <- "max"
lo1$c <- c(3,1,5,1)
lo1$A <- Matrix(c(3,1,2,0,
0,2,0,3), nrow=3, byrow=TRUE, sparse=TRUE)
lo1$bc <- rbind(blc = c(30,15,-Inf),
buc = c(30,Inf,25))
lo1$bx <- rbind(blx = c(0,0,0,0),
bux = c(Inf,10,Inf,Inf))
r <- mosek(lo1)
A mixed-integer linear problem is read from file and solved. The first command resolves the path of the problem file "milo1.opf" from within the package directory.
modelfile <- system.file(package="Rmosek", "extdata", "milo1.opf")
r_read <- mosek_read(modelfile)
r_solve <- mosek(r_read$prob)
See examples for more on optimization using Rmosek.