Please see the 'userguide.pdf' for a detailed introduction to this pacakge. This file is located at the root of this package:
system.file("userguide.pdf", package="Rmosek")
mosek(problem, opts = list())
Depending on the specified solver, one or more solutions mays be returned. The interior-point solution itr
, the basic (corner point) solution bas
, and the integer solution int
.
The problem status prosta
in all solutions shows the feasibility of your problem definition. All solutions are described by a solution status solsta
(e.g. optimal) along with the variable and constraint activities. All activities will further have a bound key that specify their value in relation to the declared bounds.
Dual variables are returned for all defined bounds wherever possible. Integer solutions int
does not have any dual variables as such definitions would not make sense. Basic (corner point) solutions bas
would never be returned if the problem had conic constraints, and does not define snx
.
A
.Like a Linear Program it has a linear objective with one coefficient in c
for each variable, some optional constant c0
, and the improving direction sense
. The constraints can either be linear, specified as rows in A
with lower bounds blc
and upper bounds buc
(you can use Inf
if needed), or conic as specified in the list cones
(add constraints copyx=x if some variable x appears in multiple cones). Each variable is bounded by blx
and bux
and will be integer if it appears in the intsub
list.
Parameters can also be specified for the MOSEK call. iparam
is integer-typed parameters, dparam
ia double-typed parameters and sparam
is string-typed parameters. These parameters can be ignored by setting the option useparam
to FALSE (the default is TRUE).
Initial solutions are specified in sol
and should have the same format as the solution returned by the function call. This solution can be ignored by setting the option usesol
to FALSE (the default is TRUE).
The amount of information printed by the interface can be limited by verbose
(default=10). The generated model can be exported to any standard modelling fileformat (e.g. lp, opf, lp or mbt), with (resp. without) the identified solution using writeafter
(resp. writebefore
).
The optimization process can be terminated at any moment using CTRL + C.
mosek_version
mosek_clean
lo1 <- list()
lo1$sense <- "max"
lo1$c <- c(3,1,5,1)
lo1$A <- Matrix(c(3,1,2,0,
2,1,3,1,
0,2,0,3), nrow=3, byrow=TRUE, sparse=TRUE)
lo1$blc <- c(30,15,-Inf)
lo1$buc <- c(30,Inf,25)
lo1$blx <- c(0,0,0,0)
lo1$bux <- c(Inf,10,Inf,Inf)
r <- mosek(lo1)
Run the code above in your browser using DataLab