ibex-team / ibex-lib

IBEX is a C++ library for constraint processing over real numbers.
http://ibex-team.github.io/ibex-lib/
GNU Lesser General Public License v3.0
67 stars 51 forks source link

Vector-matrix expression issue when computing #502

Open raphaelchenouard opened 3 years ago

raphaelchenouard commented 3 years ago

When using vector or matrices in the modelling, ibex does not make relevant computations. Modeling a linear system like the following one:

Constants
    N=2;
    M=3;
    A[M][N] = ((1,6);(2,2);(4,1));
    b[M] = (30;15;24);
Variables
    x[N] in [0,oo];
Constraints
    A*x<=b;
End

gives errors in the results and different results depending on the run. I get a few several solutions or 1 solution or infeasible problem! I formulate the same problem without vector expression and it works well.

Using ibexopt adding an objective function, we get an error message about mul_VV contractor not yet implemented. Maybe the same kind of message should be thrown for ibexsolve:

***********************************************************************
IBEX has crashed because the following feature is not implemented yet:
Inner projection of "mul_VV"
Please, submit a new feature request.
***********************************************************************
gchabert commented 3 years ago

I cant' reproduce the issue with ibexsolve. I run it 10 times and obtain each time solution n°1 = ([0, 6] ; [0, 5]) What did you execute precisely? With ibexopt, you have to turn off inhc4 but the flag is missing for the exectutable unfortunately. I'm adding it.

raphaelchenouard commented 3 years ago

I tested with 2.8.9 and current dev (2.8.9.1) using soplex and I get:

$ ibexsolve pl.mbx --trace

***************************** setup *****************************
  file loaded:      pl.mbx
  output file:      pl.cov
  trace:        ON
*****************************************************************

running............

 [solution] ([0, 6] ; [0, 5])

 solving successful!

 number of solution boxes:  1
 number of boundary boxes:  --
 number of unknown boxes:   --
 number of pending boxes:   --
 cpu time used:         0.00065s
 number of cells:       1

 results written in pl.cov

Or

$ ibexsolve pl.mbx --trace

***************************** setup *****************************
  file loaded:      pl.mbx
  output file:      pl.cov
  trace:        ON
*****************************************************************

running............

 infeasible problem

 number of solution boxes:  --
 number of boundary boxes:  --
 number of unknown boxes:   --
 number of pending boxes:   --
 cpu time used:         0.00055s
 number of cells:       1

 results written in pl.cov

Or

$ ibexsolve pl.mbx --trace

***************************** setup *****************************
  file loaded:      pl.mbx
  output file:      pl.cov
  trace:        ON
*****************************************************************

running............

 [solution] ([0, 0.5467500000000002] ; [0, 1.012500000000001])
 [solution] ([0.5467500000000001, 1.215000000000001] ; [0, 1.012500000000001])
 [solution] ([0, 1.215000000000001] ; [1.0125, 2.250000000000001])
 [solution] ([2.7, 3.368250000000001] ; [0, 0.9213750000000004])
 [solution] ([3.36825, 4.185000000000001] ; [0, 0.4146187500000003])
 [solution] ([3.36825, 4.185000000000001] ; [0.4146187500000002, 0.9213750000000004])
 [solution] ([2.7, 3.368250000000001] ; [0.9213750000000003, 2.047500000000001])
 [solution] ([3.36825, 4.185000000000001] ; [0.9213750000000003, 2.047500000000001])
 [solution] ([4.185, 6] ; [0, 2.047500000000001])

 solving successful!

 number of solution boxes:  9
 number of boundary boxes:  --
 number of unknown boxes:   --
 number of pending boxes:   --
 cpu time used:         0.002477s
 number of cells:       23

 results written in pl.cov
gchabert commented 3 years ago

I've made a fix on ibexsolve. Can you try again? Now I obtain plenty of boundary boxes, which is the normal behavior.

For ibexopt, I remember now that inhc4 is already automatically turned off when it can't be applied. When I run your problem with a goal, I just have the warning: warning: inHC4 disabled (unimplemented operator) and the optimization runs well. I am surprised by this old error message. Note: inhc4 is not used in ibexsolve.

raphaelchenouard commented 3 years ago

I conform that ibexsolve works normally now. For ibexopt I have to clean and build again since i face the same error message with inner projection of mul_VV and I have no warning about inHC4 being disabled.

gchabert commented 3 years ago

Ok let me know.

raphaelchenouard commented 3 years ago

I use this model:

Constants
    N=2;
    M=3;
    c[1][N] = (-2,-3);
    A[M][N] = ((1,6);(2,2);(4,1));
    b[M] = (30;15;24);
Variables
    x[N] in [0,oo];
Minimize c*x;
Constraints
    A*x<=b;
End

And I stil get this error latest dev branch:

$ ~/lib/ibex-lib/build/bin/ibexopt pl.mbx

************************ setup ************************
  file loaded:      pl.mbx
  output COV file:  pl.cov
*******************************************************

running............

***********************************************************************
IBEX has crashed because the following feature is not implemented yet:
Inner projection of "mul_VV"
Please, submit a new feature request.
***********************************************************************