[FlopCpp] Constraint Names and Limited Row Creation bySubset

Shigeru Tsubakitani stsubakitani at neomeshsolutions.com
Wed Feb 13 21:06:28 EST 2008


Tim,
Thanks for your suggestion.  It worked.

Are you going to implement the row name feature?  It would be a tremendous
help for my project.  Please let me know when implement it.

Shigeru

-----Original Message-----
From: Tim Hultberg [mailto:Tim.Hultberg at eumetsat.int] 
Sent: Wednesday, February 13, 2008 11:52 AM
To: flopcpp at list.coin-or.org; Shigeru Tsubakitani
Subject: Re: [FlopCpp] Constraint Names and Limited Row Creation bySubset

1. setName() was originally only intended for the internal debugging
information (in verbose mode). But I agree, it would be obvious to pass
these names on to the solver. I have never looked into this but I expect it
to be easy.

2. All rows are "created", but they do not contain any coefficients and will
be removed by the presolver. Alternatively you can change the last two lines
to:
            
  MP_constraint rTest(AB);
  rTest(AB(a, b)) = x(a, b) == 1;

in which case the extra rows are not "created".

Cheers, Tim

>>> "Shigeru Tsubakitani" <stsubakitani at neomeshsolutions.com> 11/02/2008
01:53 >>>
I have two questions.

1. How do you print user-specified row and column names rather than "cons1,
cons2 ." for row names and "x1, x2 ." for column names in the matrix file
when you use a matrix print command such as
"MP_model::getDefaultModel()->Solver->WriteLp();"?  The setName() method
does not work for this.

 

2. How do you generate rows only for index combinations defined in a subset?
In the following example, I want to create a row only for (0, 0), but it
creates rows for all 4 index combinations.

              MP_set A(2), B(2);

              MP_subset<2> AB(A, B);

              AB.insert(0, 0);

              MP_index a, b;

              MP_variable x(A, B);

              MP_constraint rTest(A, B);

              rTest(a, b).such_that( AB(a, b)) = x(a, b) == 1;

 

Thanks for your help in advance.

Shigeru





More information about the FlopCpp mailing list