Outputs a model of an optimization problem in any standard modeling fileformat (e.g. lp, opf, mps, mbt, etc.), controlled by a set of options. The modeling fileformat is selected based on the extension of the modelfile.
1  mosek_write(problem, modelfile, opts = list())

problem 
The optimization problem.
 
modelfile 
The file to write the optimization model.
 
opts 
The interface options.

The problem
should be compliant with the input specification of
function mosek
. Please see this function for more details.
The modelfile
should be an absolute or relative path to the model
file. If the file extension is .opf
, the model will be written in
the Optimization Problem Format. Other formats include lp, mps and mbt.
The amount of information printed by the interface can be limited by
verbose
(default=10). Whether to write the initial solution, if
one such exists in the problem description, is indicated by usesol
which by default is FALSE. Whether to write the full list of parameter
settings, some of which may have been specified by the problem description,
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.
problem  Problem description 
modelfile  Filepath to the model 
opts  Options 
.$verbose  Output logging verbosity 
.$usesol  Whether to write an initial solution 
.$useparam  Whether to write all parameter settings 
.$getinfo  Whether to extract MOSEK information items 
.$scofile  Destination of operators from scopt 
r 
The returned result.

The result is a named list containing the response of the MOSEK Optimization Library when writing to the model file. A response code of zero is the signal of success.
Setting option getinfo
to TRUE
extracts iinfo
and dinfo
.
r  Result 
.$response  Response from the MOSEK Optimization Library 
..$code  IDcode of response 
..$msg  Humanreadable message 
.$iinfo/$dinfo  MOSEK information list 
..$<MSK_INFO>  Value of any <MSK_INFO> 
1 2 3 4 5 6 7 8 9 10 11 12 13  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$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));
rr < mosek_write(lo1, "lo1.opf")
if (!identical(rr$response$code, 0))
stop("Failed to write model file to current working directory")

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.