[PPL-devel] Another question

Enea Zaffanella zaffanella at cs.unipr.it
Thu May 3 23:10:55 CEST 2012


On 05/03/2012 06:13 PM, Ezio Bartocci wrote:
> Dear PPL developers,
>
>         I forward the message that I sent to Roberto. Since he is
> traveling, maybe some of you can help us...
>
> Thanks a lot
>
> Best Regards
>
> Ezio


Hello Ezio.

I suspect the main problem is in the right hand side of the line:

 >>                 lin_exp[j]+=single_point[m]*(*it);

Here single_point[m] has type mpf_class.
However, the PPL only supports *integral* coefficients.

When a generator has non-integral coordinates, it can be expressed using 
integral coefficients and providing a common divisor.

For instance, if you need to specify a point in 3d having coordinates
   (1.5, 0.5, 2.5)
you can express it as
   (3, 1, 5) / 2

In C++, something like the following:

   Variable A(0);
   Variable B(1);
   Variable C(2);
   Linear_Expression le = 3*A + B + 5*C;
   ph.add_generator(point(le, 2));

where the second argument to `point' is the divisor
(that gets applied to all the coefficients of `le').

Hope this helps.

Regards,
Enea.



More information about the PPL-devel mailing list