
mosek
.mosek_read(modelfile, opts = list())
On success, the result contains the problem specification with all problem data. This problem specification is compliant with the input specifications of function mosek
.
Setting option getinfo
to TRUE
extracts iinfo
and dinfo
.
modelfile
should be an absolute or relative path to a model file. The amount of information printed by the interface can be limited by verbose
(default=10). Whether to read the initial solution, if one such exists in the model file, is indicated by usesol
which by default is FALSE. Whether to read the full list of parameter settings, some of which may have been defined by the model file, is indicated by useparam
which by default is FALSE.
The option scofile
is used in separable convex optimization to specify the absolute or relative path to the operator file.
The format of the imported constraint matrix is controlled by matrixformat
and can be either sparse coordinate COO
, compressed sparse column CSC
, or a list-based alternative simple:COO
. The matrix formats CSC
and COO
are based on the package 'Matrix' superclasses CsparseMatrix
and TsparseMatrix
.
mosek
mosek_write
modelfile <- system.file(package="Rmosek", "extdata", "lo1.opf")
rr <- mosek_read(modelfile)
if (!identical(rr$response$code, 0))
stop("Failed to read model file")
rlo1 <- mosek(rr$prob)
modelfile <- system.file(package="Rmosek", "extdata", "milo1.opf")
rr <- mosek_read(modelfile)
if (!identical(rr$response$code, 0))
stop("Failed to read model file")
rmilo1 <- mosek(rr$prob)
modelfile <- system.file(package="Rmosek", "extdata", "cqo1.opf")
rr <- mosek_read(modelfile)
if (!identical(rr$response$code, 0))
stop("Failed to read model file")
rcqo1 <- mosek(rr$prob)
modelfile <- system.file(package="Rmosek", "extdata", "sco1.opf")
modelscofile <- system.file(package="Rmosek", "extdata", "sco1.sco")
rr <- mosek_read(modelfile, list(scofile=modelscofile))
if (!identical(rr$response$code, 0))
stop("Failed to read model file")
rsco1 <- mosek(rr$prob)
Run the code above in your browser using DataLab