[PPL-devel] easy way to extract rays from a polyhedron

John Perry john.perry at usm.edu
Sun Jan 15 15:56:37 CET 2017


On Jan 15, 2017, at 3:15 AM, Roberto Bagnara <bagnara at cs.unipr.it> wrote:
> 
> On 01/14/2017 05:18 PM, John Perry wrote:
>> I'd like to extract the rays of a polyhedron. As far as I can tell from the documentation, the only way to do this is to extract the generators, then loop over them, testing which is a ray:
>> 
>>    Generator_System G = P.generators();
>>    for (Generator g : G)
>>        if (g.is_ray()) {
>>            /* party time */
>>        }
>> 
>> Is there a more direct way to do this, something like G.rays() or even P.rays()?
> 
> Hello John,
> 
> the snippet above makes lots of unnecessary copies.
> I would do something like
> 
>  const Generator_System& G = P.generators();
>  for (const Generator& g : G)
>    if (g.is_ray()) {
>      /* party time */
>    }

Oh, right, thank you! I actually had the second, but not the first.

> Apart from this, no, there is no more direct way:
> if it were, it would be implemented along those lines.

I understand. Thank you again.

sincerely
regards
john perry



More information about the PPL-devel mailing list