Hi !
Thank YOU for your help , i konw what i did is wrong because there is a
defference between the tow type of varibles, but how can i put my variables
that exist in vector<int> into IntVar Args or any other type of variables
used in linear constraints. It is easy to fillful the IntVarArgs by a
simple declaration like what is described in MPG , but my problem is when i
have another sort of varibles for exemple the keybord or an xml file or
something like that.

i tryed a simple exemple like this :

IntArgs R(n,20,10,15,5,25,30); // that works verry well

but when i have this variables (20,10,15,5,25,30) in a vector , i have to
put theme in a type that can be used in linear constraint right and this is
the problem : how can i put theme in an IntVarArgs for exemple

Sorry to bother you with this stupid things but it really bother me, any
help , tahnk you

PETER






---------- Forwarded message ----------
From: Christian Schulte <[email protected]>
Date: 2013/10/2
Subject: RE: [gecode-users] Fwd: Initialize IntVArArgs from variable array a
To: peter Tomson <[email protected]>, [email protected]


How on earth should that work: you use a vector of integers (that is,
vector<int>) to initialize an array of integer VARIABLES that is,
(IntVarArgs).****

** **

You really need to read MPG more carefully. Maybe you meant IntArgs as an
array of integers?****

** **

Christian****

** **

--****

Christian Schulte, Professor of Computer Science, KTH,
www.ict.kth.se/~cschulte/****

** **

*From:* [email protected] [mailto:[email protected]] *On
Behalf Of *peter Tomson
*Sent:* Wednesday, October 02, 2013 6:26 AM
*To:* [email protected]
*Subject:* [gecode-users] Fwd: Initialize IntVArArgs from variable array a**
**

** **

** **

---------- Forwarded message ----------
From: *peter Tomson* <[email protected]>
Date: 2013/10/2
Subject: Re: [gecode-users] Initialize IntVArArgs from variable array a
To: Guido Tack <[email protected]>

****

Hi ****

** **

Sorry to be so bothring but this instruction that YOU gave me : IntVarArgs
x(v); doesn't work for me!!!!****

** **

let me explain: by just writing this instruction in the model it gave me
also an error because none of the declaration that exist in the site of
Gecode does match the argument list????****

** **

this is what i wrote : vector<int> W;****

for (int i=0;i< 10;i++)****

W.push_back(i);****

             IntVarArgs R(W);****

** **

i konw there is a mistack here but i don't konw what is it ??? I'm really
 new with Gecode that's why i do so my errors ****

So sorry to be so bothring ****

** **

Thank YOU for any help at all ****

** **

PETER****

** **

2013/10/2 Guido Tack <[email protected]>****

Hi,

I think you need to brush up on your C++, that's the type signature, not
the code you should write.  Just check our documentation, you can construct
an IntVarArgs from a vector v like this IntVarArgs x(v);

Cheers,
Guido****


On 02/10/2013, at 1:21 PM, peter Tomson <[email protected]> wrote:

> hi all !
>
> in my model i have to get the interger variables from a vector , So i
used this code that i found in MPG :
>
> IntVarArgs (const std::vector< IntVar > &a);
>
> but i have an error about the const : type name not allowed!!!!!!!!!!
>
> honnestly i declared an IntVarArray R, after that i wrote that code, So
do i do any thing wrong ??? Do i mis ay thing ??
>
> Thank you very much for your hepl
>
> PETER
>****

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

** **

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

Reply via email to