【发布时间】:2018-07-10 22:38:26
【问题描述】:
我在文件lp 中有一个线性程序,GLPK 用这个命令解决了这个程序:
glpsol --math -m lp
屏幕上的部分输出是:
Generating priority_words...
Model has been successfully generated
...
Long-step dual simplex will be used
+ 770: mip = not found yet <= +inf (1; 0)
Solution found by heuristic: 1569225
...
INTEGER OPTIMAL SOLUTION FOUND
...
Writing MIP solution to 'result'...
result 文件未格式化,我想将结果保存为 CSV。因此,我在最后一个约束之后和end; 关键字之前添加了一行将结果输出到表中:
...
s.t. priority_words{w in words}: include[w] >= priority[w];
table num{u in unicodes} OUT "CSV" "num.csv": u~unicode, number_of_characters[u]~count;
end;
而 GLPK 给出了这个错误:
Generating priority_words...
Writing num...
Assertion failed: out != out
Error detected in file mpl/mpl3.c at line 5072
Abort trap: 6
wikibook 和发行版中的 gmpl 手册(doc/gmpl.pdf)都没有从 GLPK 中获取表的示例。
求解模型后如何向 GLPK 索要结果表?
【问题讨论】:
-
永远不应该达到断言。请将包含模型文件的邮件发送至 bug-glpk@gnu.org。参照。 lists.gnu.org/mailman/listinfo/bug-glpk
-
@Xypron 不,确实不应该!原因是我是 GLPK 的新手,在要求输出表格之前忘记添加
solve;。我写了这个作为答案。
标签: glpk