Hello all,
I have a matrix that I am trying to put constraints on
my conditions are:
- for each row, # of 1's is >=1;
- for each column, # of 1's = 1;
I did:
bit [X-1][Y-1] matrix;
constraint matrix{
foreach(matrix[i]){
$countones(matrix[i])>=1;
}
//Here I need a foreach to loop through the columns and make sure the countones ==1, I'm
//just not sure of the correct syntax to use.
}
Thank you!