[Lemon-user] Inheriting from Lemon classes

Balázs Dezső deba.mf at gmail.com
Wed May 25 16:58:02 CEST 2016


In LEMON, you can create an own length map, and the LengthMap can do the
distance computation for you.

The length map can be any type which fullfills the ReadMap concept:
http://lemon.cs.elte.hu/pub/doc/1.3.1/a00319.html
So you have to implement a class with Key and Value typedefs, and implement
Value operator[](Key).

There are a bunch of maps in LEMON, which do some on-the-fly computation:
http://lemon.cs.elte.hu/pub/doc/1.3.1/a00016.html

Of course, the computation can be more complex.



On Wed, May 25, 2016 at 3:48 PM Tim Keitt <tkeitt at utexas.edu> wrote:

> You could use Boost Graph, which was designed for exactly this sort of
> adaptation.
>
> THK
>
> http://www.keittlab.org/
>
> On Wed, May 25, 2016 at 8:30 AM, Marco Blanco <blanco at zib.de> wrote:
>
>> Hello,
>>
>> I am implementing a shortest path algorithm where the arc costs are
>> unknown a priori and need to be computed on the fly. For that reason, I
>> decided to try to define a class MyDijkstra, which inherits from
>> lemon::Dijkstra<ListDigraph>. My plan was to override the member function
>> processNextNode(), but then I realized that the Dijkstra class has some
>> private members that I would need and don't have access to, such as the
>> underlying digraph object. I temporarily solved the issue by replacing all
>> "private" labels with "protected" in "dijkstra.h", but I don't like messing
>> with the Lemon source code.
>>
>> Is inheriting from Lemon classes discouraged in general? Can you think of
>> an alternative way in which I could make use of the existing structure
>> without having to copy-paste the entire class definition only to change two
>> lines?
>>
>> Thank you,
>> Marco
>>
>> _______________________________________________
>> Lemon-user mailing list
>> Lemon-user at lemon.cs.elte.hu
>> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>>
>>
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20160525/18827d23/attachment.html>


More information about the Lemon-user mailing list