[FlopCpp] Re : Iterating over a solution variable and a domain.

yo yo yoyovicks at yahoo.fr
Fri Jan 11 08:06:36 EST 2008


Hello Tim,

Thanks for your answers.
I had noticed the display method but I don't want to display them. So, I had the idea deriving from Functor and using forall but it sounds quite complicated for a such necessary feature so I asked the question on this ml first.

The context is the following:
I have an application written in C# that needs to solve an LP problem.
I want to use C++/CLI to create the model with FLOPC++ based on data coming from a Managed DataSet in C#.(this is ok so far).
Then solve it. (this is also ok).
Then I want to get back the solution from flopc++ into a managed dataset.(this is the problem.)
Therefore I need a way to enumerate the content of flopc++ variables and to populate the dataset. dimensions are in columns.

I am using subsets and the variables are very sparses so I cannot iterate continuously using a for loop.
So, my only chance is to derive the functor class?
Do you have any example on how deriving the functor class, please?

Thanks for you help.
YO.


----- Message d'origine ----
De : Tim Hultberg <Tim.Hultberg at eumetsat.int>
À : flopcpp at list.coin-or.org; yoyovicks at yahoo.fr
Envoyé le : Mardi, 8 Janvier 2008, 18h34mn 19s
Objet : Re: [FlopCpp] Iterating over a solution variable and a domain.

Some alternatives:
1. The display method of MP_variable does exactly this. See the
 examples.
2. Generally sets are indexed from 0 to size()-1
3. You might use forall to iterate over a domain, but then you will
 have to derive a class from Functor. I can show you how to do this if you
 want and give me the context.

Cheers, Tim

>>> yo yo <yoyovicks at yahoo.fr> 01/08/08 4:48 PM >>>
Hello,

I am trying to use flopcpp, so far the modelling works OK. Now I would
 like to dump the content of a solution variable. I cannot find any way
 to iterate over a variable and its domain. How can I do? I do not know
 the values of the index because they are generated automatically.
I would like to make a "for each" on my solution variables and write
 the value (with index) to somewhere else. Is this possible?

Thanks for your help.
YO.




    
  _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
 Mail http://mail.yahoo.fr

_______________________________________________
FlopCpp mailing list
FlopCpp at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/flopcpp






      _____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr



More information about the FlopCpp mailing list