[PPL-devel] Another question
Enea Zaffanella
zaffanella at cs.unipr.it
Fri May 4 18:08:46 CEST 2012
On 05/04/2012 05:25 PM, Ezio Bartocci wrote:
> so for integral you mean integers ?
Yes.
> So it mean that accept only
> rational number in the set of Q ?
Yes. There is no way to specify a polyhedron having a vertex with
irrational coordinates.
Enea.
> On Thu, May 3, 2012 at 11:10 PM, Enea Zaffanella<zaffanella at cs.unipr.it> wrote:
>> 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