[Lemon-user] A couple of questions about lemon
Alpar Juttner
alpar at cs.elte.hu
Fri Jun 12 11:52:18 CEST 2015
Hi,
> 1) Can it be used header-only? (I'm curious because it would make it
> much easier to embed in eg R)
Basically yes, it can be, but with some limitations. This is a hopefully
complete list tools that need non-header files right now:
* Time measuring tools (#include <time_measure.h>) needs a single
global variable defined in base.cc
* lemon::ArgParser (arg_parser.cc)
* LP/MIP interfaces (cbc.cc, clp.cc, cplex.cc, glpk.cc,
lp_base.cc, lp_skeleton.cc)
* Windows compatibility - bits/windows.cc/h is a wrapper around
some WIN32 system calls related to proc. time queries and
threading.
* random.cc just declares a global instance of lemon::Random
* color.cc defines a color palette for lemon::graphToEps()
* Rounding problems of floating point arithmetic is handled
through Tolerance classes. They are again have some static
members defined in base.cc
But what I would suggest is that if you do not want to depend on the
CMAKE build environment, then:
* Create config.h from config.h.in either by CMAKE or by hand.
* Copy all .h and .cc files into your project
* Compile and link the (necessary) .cc files along with your own
code.
> 2) Looks like you re-invented the Boost Graph Library. Was there a
> reason not to use it?
When we started working on LEMON, we examined BGL. (It was actually
quite in az early stage at that time.) But we found we want something
different.
* Firstly, we try to follow a more pragmatic approach. We
implement the generic approach, but only to the extent that it
doesn't hurt the overall usability.
* Secondly, we focus much more on efficient implementation and
fine tuning of the data structures and algorithms. Just look at
the performance of the matching, flow and circulation
algorithms.
* Thirdly, we wanted something more compact packages that is easy
to embed into other projects just by copying some related files.
BGL highly depends on the whole Boost ecosystem, thus it is very
difficult the cut it out and use separately.
Regards,
Alpár
More information about the Lemon-user
mailing list