[FlopCpp] Constraint Names and Limited Row Creation by Subset

Tim Hultberg Tim.Hultberg at eumetsat.int
Wed Feb 13 11:52:09 EST 2008


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