Thank you for the help! Also, the element constraint expects Matrix<IntVarArgs>, not Matrix<IntVarArray>.
Best, Christian On Fri, 2009-10-30 at 09:06 +0100, Christian Schulte wrote: > I guess the problem is that element over matrices expects variables as > arguments and not integers. So instead of: > element(home, mat, mat(i,j), mat(j,i), i) > You have to create an integer variable that is equal to i and use that as > last argument, such as: > element(home, mat, mat(i,j), mat(j,i), IntVar(home,i,i)) > > Cheers > Christian > > -- > Christian Schulte, www.ict.kth.se/~cschulte/ > > -----Original Message----- > From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf > Of Christian Drescher > Sent: Friday, October 30, 2009 4:18 AM > To: us...@gecode.org > Subject: [gecode-users] Modelling Conditions on Latin Squares > > Dear Subscribers, > > I try to model an algebraic problem. In fact, I try to determine the > existence of Latin Squares with certain properties. Hence, my model > contains a Matrix of IntVar: > > Matrix<IntVarArray> mat(l, n, n); > > The constraint I want to post is that for all i,j in Q: > > (i*j) * (j*i) == i > > or rather > > mat(mat(i,j),mat(j,i)) == i > > I tried two different approaches, but gecode's library doesn't support > the following: > > // this doesn't work > post(home, mat(mat(i,j),mat(j,i)) == i); > > // this neither > element(home, mat, mat(i,j), mat(j,i), i); > > How do I model the constraint correctly? > > Best, > Christian > > > _______________________________________________ > Gecode users mailing list > us...@gecode.org > https://www.gecode.org/mailman/listinfo/gecode-users > _______________________________________________ Gecode users mailing list us...@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users