0

I am trying to read a .lp file using CPLEX, and it is giving me an error 1615, which is not being able to read "(" or even "[". I am not happy with it because what I have needs to be read must have parentheses in it. Here is what I have:

[num1 + num2 + num3 + num4 + num5] * 1/12

First of all, I don't know how CPLEX would take in the multiplication sign. So, instead I have:

[num1 + num2 + num3 + num4 + num5] 1/12

And, then it may not be able to read fractions or the division sign. I am not even sure how to write this, so that it reads it. I can't solve the problem unless CPLEX reads the file successfully.

Now, similarly I am also using LPsolve, and it also cannot read parentheses, fractions, multiplication sign, and a division sign. Both of these are currently useless for me. In LPsolve, I just have to copy and paste the content into the window, and run it.

If any of you have an alternate way to write the statement I have above or a way for either CPLEX or LPsolve to read it, then that would be really helpful.

4

1 回答 1

0

以下是 LP 文件格式的无效语法:

[num1 + num2 + num3 + num4 + num5] 1/12

方括号 ([]) 只允许在二次表达式中。相反,您可以执行以下操作:

0.083333 数字1 + 0.083333 数字2 + 0.083333 数字3 + 0.083333 数字4 + 0.083333 数字5

(请注意,这样做可能会降低一些精度,因为 1/12 不能完全表示为浮点数)。

请参阅此处的 CPLEX LP 格式文档。此外,请记住,LP 文件格式可能有不同的实现,具体取决于供应商(即,适用于 LPsolve 的内容可能不适用于 CPLEX,反之亦然)。

于 2017-04-04T15:40:31.547 回答