[
https://issues.apache.org/jira/browse/MATH-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17161106#comment-17161106
]
Gilles Sadowski commented on MATH-1549:
---------------------------------------
{quote}My personal impression is that these vectors are hard to work with.
{quote}
Could you elaborate? [Maybe that's something we could/should fix.]
{quote}I figured I'd rather not add another copy into that.
{quote}
I understand. However, in-place changes should be especially well documented
and, IMO, we should avoid them by default (i.e. until proven necessary).
{quote}copying all this stuff around is not good for anything.
{quote}
Sure. There is a balance to be found (copying in Java is not nearly as bad as
in C and sometimes an extra copy even provides a performance boost!).
{quote}I'm not quite sure how you see SimplexTableau changing.
{quote}
The basic idea would be to perform the tasks that need mutability within the
constructor (or in private methods that return the final values to be assigned
to the instance fields).
If/when the tableau must be changed, a new instance would be created (e.g. as
is done at [this
line|https://gitbox.apache.org/repos/asf?p=commons-math.git;a=blob;f=src/main/java/org/apache/commons/math4/optim/linear/SimplexTableau.java;h=15a84819b2eb8ede0914d939d89c2f79bdb7caf3;hb=HEAD#l433]
anyways), from current input. IMHO, this would greatly simplify the code,
allowing further improvements to be safely implemented.
> Simplex solver report unbounded solution when solvable constraints scaling up
> -----------------------------------------------------------------------------
>
> Key: MATH-1549
> URL: https://issues.apache.org/jira/browse/MATH-1549
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 3.6.1
> Environment: macOS catalina
> Reporter: Fan Zhang
> Priority: Major
> Attachments: CommonsMathSimplexSolverTest.java
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> *scenario 1:*
> {code:java}
> min: x + y
> x, y >= 0
> 9000x + y >= 0
> 10000x + y >= 2000
> x >= 2{code}
> *scenario 2:*
> {code:java}
> min: x + y
> x, y >= 0
> 9.0E15x + 1.0E12y >= 0
> 1.1e16x + 1.0e12y >= 2.0e15
> 1.0e12x >= 2e12{code}
> for scenario 1, it works out. but for scenario 2 whose constrains are just
> scaled up by 1e12, the solver reports unbounded solution.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)