同时使用Rsymphony和slam解决线性程序

时间:2019-06-03 15:18:54

标签: r linear-programming glpk

我正在尝试使用Rsymphony解决LP问题。除了-我正在使用slam创建稀疏约束矩阵(下面的model_list$constr)之外,我的代码没有什么特别的。代码看起来像这样(整个问题很大,要发布):

Rsymphony_solve_LP(arcs$cost, 
                   model_list$constr, 
                   model_list$constr_dir, 
                   model_list$rhs$sd, 
                   max = FALSE)

我得到的错误是:

Error in Rsymphony_solve_LP(arcs$cost, model_list$constr, model_list$constr_dir,  : 
NA/NaN/Inf in foreign function call (arg 5)

有什么我可以解决的吗?

我很确定该模型没有错。它可以与Rglpk一起使用(但我想使用Rsymphony,因为它似乎更快,请参见http://strimas.com/prioritization/ilp-performance/):

Rglpk_solve_LP(arcs$cost,
               model_list$constr,
               model_list$constr_dir,
               model_list$rhs$sd,
               max = FALSE)

0 个答案:

没有答案