Hard to use auxiliary variables
- Dominant language
- JetBrains MPS
- Stars
- 192
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
Sometimes it is necessary to use one-dimensional variables. These are currently not handled correctly in matrix-style constraint definitions. Let me provide an example based on [this setInteger example](http://mpy.github.io/CyLPdoc/modules/CyClpSimplex.html) (where "from CyLP" should be "from cylp"):
``` Python
import numpy as np
from cylp.cy import CyClpSimplex
from cylp.py.modeling.CyLPModel import CyLPModel, CyLPArray
model = CyLPModel()
x = model.addVariable('x', 3)
y = model.addVariable('y', 1)
A = np.matrix([[1., 2., 0],[1., 0, 1.]])
B = np.matrix([[1., 0, 0], [0, 0, 1.]])
D = np.matrix([[1.],[0]])
a = CyLPArray([5, 2.5])
b = CyLPArray([4.2, 3])
x_u= CyLPArray([2., 3.5])
model += A*x <= a
model += 2 <= B * x + D * y <= b
```
> IndexError: tuple index out of range
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.