New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

row() and col() functions for variable matrices #2

Closed
scand1sk opened this Issue Jan 23, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@scand1sk

scand1sk commented Jan 23, 2015

There are MiniZinc builtins for row() and col() projection of matrices of parameters. I recently modelled timetabling problems where I required such projections for matrices of variables, which do not seem to be provided. I could implement them easily, maybe they could be added to builtins:

function array [int] of var int: col(array [int, int] of var int: tab, par int: c) = 
  [tab[i, c] | i in index_set_1of2(tab)];
function array [int] of var int: row(array [int, int] of var int: tab, par int: r) = 
  [tab[r, i] | i in index_set_2of2(tab)];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment