[英]SCIP: Solving QPs via interactive shell
是否可以通過預編譯的二進制文件(交互式Shell)來求解QP?
我嘗試了幾個樣本,但都沒有成功。 我有什么想念的嗎?
Minimize
obj: a + b + [ a^2 + 4 a * b + 7 b^2 ]
Subject To
c1: a + b >= 10
End
在這一章中,我得到以下消息:
[src/scip/reader_lp.c:147] ERROR: Syntax error in line 3 ('Subject'): expected '/2' or '/ 2' after end of quadratic part in objective.
input: Subject To
^
[src/scip/reader_lp.c:3362] ERROR: Error <-2> in function cal
另一個例子:
Maximize
obj: x1 + 2 x2 + 3 x3 + x4
Subject To
c1: - x1 * x3 + x2 + x3 + 10 x4 <= 20
c2: x1 - 3 x2 + x3 <= 30
c3: x2 - 3.5 x4 = 0
Bounds
0 <= x1 <= 40
2 <= x4 <= 3
General
x4
End
這是這里的輸出消息:
[src/scip/reader_lp.c:147] ERROR: Syntax error in line 4 ('x3'): expected sign ('+' or '-') or sense ('<' or '>').
input: c1: - x1 x3 + x2 + x3 + 10 x4 <= 20
^
[src/scip/reader_lp.c:3362] ERROR: Error <-2> in function call
error reading file <sample.lp>
也許嘗試.pip格式( http://polip.zib.de/pipformat.php )。 這與.lp相似,但是在指定二次方時不太麻煩。
固定的第一個例子是
Minimize
obj: a + b + [ 2 a^2 + 8 a * b + 14 b^2 ] / 2
Subject To
c1: a + b >= 10
End
固定的第二個例子是
Maximize
obj: x1 + 2 x2 + 3 x3 + x4
Subject To
c1: x2 + x3 + 10 x4 + [ - x1 * x3 ] + <= 20
c2: x1 - 3 x2 + x3 <= 30
c3: x2 - 3.5 x4 = 0
Bounds
0 <= x1 <= 40
2 <= x4 <= 3
General
x4
End
另請參閱CPLEX手冊中有關.lp文件格式的規范。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.