[gecode-users] Posting "or" conditions
Claudio Cesar de Sá
claudio at colmeia.udesc.br
Wed Apr 28 13:53:41 CEST 2010
Hi
I am kicking my head on "a simple question" on matrix constraints:
for (int i=0; i < m.height() ; i++)
rel(*this, BOT_AND, m.row(i),1 );
so the constraints posted seems such:
m.row(0) = true AND m.row(1) = true AND m.row(3) = true .... AND m.row(n-1)
= true
So, obviously, as the result for the matrix m, in all lines MUST filled
with one.... not desirable.
What I am want: at least one (or more) line of this matrix m should
contain only 1's in its line ...
so should be post conditionally something like:
m.row(0) = true OR m.row(1) = true OR m.row(3) = true .... OR m.row(n-1) =
true
the branch is over the m.
I am thinking on an auxiliary array for each line ... and post it
conditionally. I am not sure,
or something like
for (int i=0; i < m.height() ; i++)
rel(*this, BOT_OR , function_post_conditional( m.row(i), ....) ,1
);
where the function_post_conditional( m.row(i), ....) ... will return only
valids post for m.row(i) = true
How to control what should be posted?
Thanks in advance
claudio
--
claudio
(
))
|""|-.
|__|-'
**********************************************************************
Skype: claudio_cesar_sa
Links:
http://laic.u-clermont1.fr/
http://www.colmeia.udesc.br/
http://www2.joinville.udesc.br/~coca/
http://www2.joinville.udesc.br/~esp7maratona/
Blog: http://claudiocesar.wordpress.com/
***********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20100428/cba9ecdb/attachment.htm>
More information about the users
mailing list