Thanks for the reply Christian.

I found my mistake was the mis-use of Matrix constructor. I passed height of the matrix first, then the width, which was the opposite order of the right order.

Regards,
Yong

Christian Schulte wrote:

The argument to the linear constraint (*.col(a)) defines the coefficients for the variables in the second argument  (*.row(d)). They  must be of the same size (same number of arguments), naturally. If not, an exception is thrown.

 

Check the reference documentation of linear, it says in which cases linear throws which exceptions.

 

Christian

 

--

Christian Schulte, web.ict.kth.se/~cschulte/

 

From: [email protected] [mailto:[email protected]] On Behalf Of Yong
Sent: Thursday, January 07, 2010 6:50 PM
To: 'gecode gecode'
Subject: [gecode-users] About ArgumentSizeMismatch exception and linear constraint

 

Hi group,
Can you kindly give some hint on the possible relationship between linear constraint and the ArgumentSizeMismatch expection?

My program is running under Virtual C++ 2008 Express Edition, and every time I debug it. It will give below output with an arrow pointing to my linear constraint in the editor. My linear constraint is as below:
linear(*this,scene_actor_matrix.col(a),shooting_day_and_scene_matrix.row(d),IRT_EQ,sum,ICL_DEF);

And the exception message:
First-chance exception at 0x76a1b727 in NewSceneAllocation.exe: Microsoft C++ exception: Gecode::Int::ArgumentSizeMismatch at memory location 0x001cf364..
Unhandled exception at 0x76a1b727 in NewSceneAllocation.exe: Microsoft C++ exception: Gecode::Int::ArgumentSizeMismatch at memory location 0x001cf364..


I also tried initializing the matrixes with proper domain and also checked the size of the matrix. Still got the exception.

Thanks for your reply in advance.

Regards,
Yong


_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to