mosek_read(Rmosek)
mosek_read()所属R语言包:Rmosek
Read problem from a model file
从模型文件的读取问题
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Interprets a model from any standard modeling fileformat (e.g. lp, opf, mps, mbt, etc.), controlled by a set of options. The result contains an optimization problem which is compliant with the input specifications of function mosek.
从任何标准的建模档案格式(如LP,OPF,公安部,主战坦克等),由一组选项控制的模型解释。结果包含一个优化问题,这是符合的输入规格功能mosek。
用法----------Usage----------
mosek_read(modelfile, opts = list())
参数----------Arguments----------
参数:modelfile
The file containing an optimization model. <table summary="Rd table"> <tr> <td align="left"> modelfile </td><td align="left"> STRING (filepath) </td><td align="left"> </td> </tr> <tr> <td align="left"> </td> </tr> </table>
该文件包含一个优化模型。 <table summary="Rd table"> <TR> <td ALIGN="LEFT"> modelfile </ TD> <TD ALIGN="LEFT"> STRING(路径)</ TD> <TD ALIGN="LEFT"> < / TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> </ TR> </ TABLE>
参数:opts
The interface options. <table summary="Rd table"> <tr> <td align="left"> opts </td><td align="left"> LIST </td><td align="left"> (OPTIONAL) </td> </tr> <tr> <td align="left"> ..$verbose </td><td align="left"> NUMERIC </td><td align="left"> (OPTIONAL) </td> </tr> <tr> <td align="left"> ..$usesol </td><td align="left"> BOOLEAN </td><td align="left"> (OPTIONAL) </td> </tr> <tr> <td align="left"> ..$useparam </td><td align="left"> BOOLEAN </td><td align="left"> (OPTIONAL) </td> </tr> <tr> <td align="left"> ..$getinfo </td><td align="left"> BOOLEAN </td><td align="left"> (OPTIONAL) </td> </tr> <tr> <td align="left"> ..$scofile </td><td align="left"> STRING (filepath) </td><td align="left"> (OPTIONAL) </td> </tr> <tr> <td align="left"> ..$matrixformat </td><td align="left"> STRING </td><td align="left"> (OPTIONAL) </td> </tr> <tr> <td align="left"> </td> </tr> </table>
接口选项。 <table summary="Rd table"> <TR> <td ALIGN="LEFT"> OPTS </ TD> <TD ALIGN="LEFT"> LIST </ TD> <TD ALIGN="LEFT">(可选)< / TD> </ TR> <TR> <td ALIGN="LEFT">元详细</ TD> <td ALIGN="LEFT">数字</ TD> <TD ALIGN="LEFT">(可选) </ TD> </ TR> <TR> <td ALIGN="LEFT">元以UseSOL方式</ TD> <TD ALIGN="LEFT"> BOOLEAN </ TD> <TD ALIGN="LEFT">(OPTIONAL )</ TD> </ TR> <TR> <td ALIGN="LEFT">元useparam </ TD> <TD ALIGN="LEFT"> BOOLEAN </ TD> <TD ALIGN="LEFT">(可选)</ TD> </ TR> <TR> <td ALIGN="LEFT">元GetInfo的</ TD> <TD ALIGN="LEFT"> BOOLEAN </ TD> <TD ALIGN="LEFT"> (可选)</ TD> </ TR> <TR> <td ALIGN="LEFT">元scofile </ TD> <TD ALIGN="LEFT"> STRING(路径)</ TD> <TD对齐= “左”>(可选)</ TD> </ TR> <TR> <td ALIGN="LEFT">元matrixformat </ TD> <TD ALIGN="LEFT"> STRING </ TD> <TD调整=“”>(可选)</ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> </ TR> </ TABLE>
Details
详细信息----------Details----------
The modelfile should be an absolute or relative path to a model file.
modelfile应该是一个绝对或相对路径的模型文件。
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.
信息的接口打印量是有限的,verbose(默认为10)。无论是读取初始的解决方案,如果有一个这样的模型文件存在,表示usesol在默认情况下是FALSE。无论是读取参数设置的完整列表,其中一些可能已定义的模型文件,表示useparam在默认情况下是FALSE。
The option scofile is used in separable convex optimization to specify the absolute or relative path to the operator file.
scofile采用的是可分离凸优化到指定的操作文件的绝对或相对路径的选项。
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.
进口的约束矩阵的格式控制matrixformat“,可以是稀疏的坐标COO,压缩稀疏列CSC,或基于列表的替代simple:COO。矩阵格式CSC和COO是基于包的“矩阵”超CsparseMatrix和TsparseMatrix。
值----------Value----------
参数:r
The returned result. <table summary="Rd table"> <tr> <td align="left"> r </td><td align="left"> LIST </td><td align="left"> </td> </tr> <tr> <td align="left"> ..$response </td><td align="left"> LIST </td><td align="left"> </td> </tr> <tr> <td align="left"> ....$code </td><td align="left"> NUMERIC </td><td align="left"> </td> </tr> <tr> <td align="left"> ....$msg </td><td align="left"> STRING </td><td align="left"> </td> </tr> <tr> <td align="left"> ..$prob </td><td align="left"> LIST </td><td align="left"> </td> </tr> <tr> <td align="left"> ..$iinfo/$dinfo </td><td align="left"> LIST </td><td align="left"> * </td> </tr> <tr> <td align="left"> ....$<MSK_INFO> </td><td align="left"> NUMERIC </td><td align="left"> * </td> </tr> <tr> <td align="left"> </td> </tr> </table> <table summary="Rd table"> <tr> <td align="left">*Starred items must be requested using an option.</td> </tr> </table>
返回的结果。 <table summary="Rd table"> <TR> <td ALIGN="LEFT"> R </ TD> <TD ALIGN="LEFT"> LIST </ TD> <TD ALIGN="LEFT"> </ TD> </ TR> <TR> <td ALIGN="LEFT">元响应</ TD> <TD ALIGN="LEFT"> LIST </ TD> <TD ALIGN="LEFT"> </ TD> </ TR文章<td ALIGN="LEFT"> .... $代码</ TD> <TD ALIGN="LEFT"> NUMERIC </ TD> <TD ALIGN="LEFT"> </ TD> </ TR> <TR> <td ALIGN="LEFT"> .... $味精</ TD> <TD ALIGN="LEFT"> STRING </ TD> <TD ALIGN="LEFT"> </ TD> </ TR> <TR> <td ALIGN="LEFT">元的概率</ TD> <TD ALIGN="LEFT"> LIST </ TD> <TD ALIGN="LEFT"> </ TD> </ TR> <TR> <td ALIGN="LEFT">元iinfo / $ dinfo </ TD> <TD ALIGN="LEFT"> LIST </ TD> <TD ALIGN="LEFT"> </ TD> </ TR文章<td ALIGN="LEFT"> .... $ <MSK_INFO> </ TD> <td ALIGN="LEFT">数字</ TD> <TD ALIGN="LEFT"> </ TD> </ TR> <TR> <td ALIGN="LEFT"> </ TD> </ TR> </ TABLE> summary="Rd table"> <TR> <td ALIGN="LEFT"> *加星标的项目,必须要求使用的选项。</ TD> </ TR> </ TABLE>
The result is a named list containing the response of the MOSEK Optimization Library when reading the model file. A response code of zero is the signal of success.
结果是命名列表,包含MOSEK优化库中读取模型文件时的反应。零响应代码是成功的信号。
On success, the result contains the problem specification with all problem data. This problem specification is compliant with the input specifications of function mosek.
成功时,结果中包含所有问题数据规范的问题。这个问题说明是符合输入规格功能mosek。
Setting option getinfo to TRUE extracts iinfo and dinfo.
设置选项“getinfo到TRUE,提取iinfo和dinfo。
参见----------See Also----------
mosek mosek_write
mosekmosek_write
实例----------Examples----------
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)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|