scipopt / scip

SCIP - Solving Constraint Integer Programs
Other
393 stars 63 forks source link

Does the order of the elements of the `ind` & `val` array returned by `SCIPlpiGetCols()` should be same as the input? #18

Closed vistart closed 2 years ago

vistart commented 2 years ago

Here are the input: https://github.com/scipopt/scip/blob/4d77a5ab4ef629afc0a4bcee62a592e691a6065b/tests/src/lpi/change.c#L758 https://github.com/scipopt/scip/blob/4d77a5ab4ef629afc0a4bcee62a592e691a6065b/tests/src/lpi/change.c#L759 The fourth and fifth elements are 2, 1. https://github.com/scipopt/scip/blob/4d77a5ab4ef629afc0a4bcee62a592e691a6065b/tests/src/lpi/change.c#L756 Its corresponding value is 3e5, 2.0.

https://github.com/scipopt/scip/blob/4d77a5ab4ef629afc0a4bcee62a592e691a6065b/tests/src/lpi/change.c#L828 If I call SCIPlpiGetCols() at this point, should I return it in the order it was received, not in positive order?

leoneifler commented 2 years ago

Are you in the process of writing a new LPI?

To answer the question: yes it expects the same order as when the nonzeros were added

vistart commented 2 years ago

I see.