Re: [gecode-users] Extra level of variables needed for count?

2018-03-12 Thread Christian Schulte
Hi, I think you stopped reading a little too early. MPG says that you can also use integer sets instead of variables. Then, in your example you do not need x and c, just pass b and v directly! IntVarArray is automatically casted to IntVarArgs. Cheers Christian -- Christian Schulte,

Re: [gecode-users] Extra level of variables needed for count?

2018-03-12 Thread Neill Clift
Thanks. I think I might now be seeing what you are saying. Sorry to be so stupid. I found this count stuff to be mind boggling. IntSetArgs s((LPTYPER)bp.MaxBit); for (LPTYPER i = 0; i < (LPTYPER)bp.MaxBit; i++) {

Re: [gecode-users] Extra level of variables needed for count?

2018-03-12 Thread Christian Schulte
Yep, that looks good. Gecode will choose the most efficient representation anyway at runtime. Cheers Christian -- Christian Schulte, https://chschulte.github.io/ Professor of Computer Science, KTH, cschu...@kth.se Expert Researcher, RISE SICS,

Re: [gecode-users] Extra level of variables needed for count?

2018-03-12 Thread Neill Clift
OK thanks for that. This makes the code simpler but I do still have to make a set of variables to contain the multiplicities (the v’s). Of course they immediately become assigned to a single value. Would it be right in assuming the cost of that on the model is very small? Sent from

Re: [gecode-users] Extra level of variables needed for count?

2018-03-12 Thread Christian Schulte
No, the point is to not use variables, you can use sets with a single element instead. Christian -- Christian Schulte, https://chschulte.github.io/ Professor of Computer Science, KTH, cschu...@kth.se Expert Researcher, RISE SICS,