[gecode-users] seg fault with posting dom constraint

Mikael Zayenz Lagerkvist zayenz at gmail.com
Tue Jun 30 07:45:20 CEST 2009


H,

You are indeed right that passing vars as you are doing will not allow
changing the the argument so that it is visible outside of assign. To
send the argument so that changes are visible outside you should use a
reference:
  int assign(GecodeSpace* solver, IntVarArgs& vars) {
         vars[0] = solver->vInt[0];
  }

As for debug information, an optimized build will include
debug-information, but due to inlining it will very often not be very
accurate. It is good enough to give some indication as to where the
problem lies, but not much more.

Cheers,
Mikael


On Mon, Jun 29, 2009 at 10:20 PM, Kish Shen<kisshen at cisco.com> wrote:
> I should have looked at the problem more before posting. It seems that
> the problem is in the way I assign the IntVarArg:
>
>> vars[0] = solver->vInt[0];
>
> which is actually done via a call to a procedure, something like:
>
> int assign(GecodeSpace* solver, IntVarArgs vars) {
>        vars[0] = solver->vInt[0];
> }
> ...
> IntVarArgs vars[1];
> assign(solver, vars);
>
> dom(*solver, vars);
>
> I assume I cannot pass IntVarArgs vars in the way I am doing -- this is
> probably due to my C background, I had assumed that IntVarArgs is an
> array, I can just pass it and any changes to its elements will be seen
> in the parent, but I guess this is not correct?
>
> --Kish
>
>
>
> --
> This e-mail may contain confidential and privileged material for the
> sole use of the intended recipient. Any review, use, distribution or
> disclosure by others is strictly prohibited. If you are not the intended
> recipient (or authorized to receive for the recipient), please contact
> the sender by reply e-mail and delete all copies of this message.
> Cisco Systems Limited (Company Number: 02558939), is registered in
> England and Wales with its registered office at 1 Callaghan Square,
> Cardiff, South Glamorgan CF10 5BT.
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>



-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list