conjure-cp / conjure-notebook

3 stars 2 forks source link

Matrix not recognised as matrix #14

Closed sasha704 closed 1 year ago

sasha704 commented 1 year ago

Previous models generating a matrix can't be used in new models due to error: Error: Expecting a matrix, but got: function

ozgurakgun commented 1 year ago

Great, thanks! If you include a minimal example to reproduce the bug that would be great as well.

sasha704 commented 1 year ago

running

%%conjure find m1 : matrix indexed by [int(0..3)] of int(0..6) such that m1[1] > 1

then running

%%conjure given m1 : matrix indexed by [int(0..3)] of int(0..6) find total: int(0..100000) such that total = sum i : int(0..3) . m1[i]

produces

Exception: Error: Expecting a matrix, but got: function(0 --> 0, 1 --> 2, 2 --> 0, 3 --> 0)

ozgurakgun commented 1 year ago

This is actually fixed in Conjure, but we need to make a new release. Thanks!

ozgurakgun commented 1 year ago

I think this is now fixed, see: https://colab.research.google.com/drive/1-kMOP-G5eRmRRnT5vIQLMHNU4QpOvG66?usp=sharing