[Lemon-user] Inheriting from Lemon classes

Tim Keitt tkeitt at utexas.edu
Wed May 25 15:46:58 CEST 2016


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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20160525/050b5177/attachment.html>


More information about the Lemon-user mailing list