Changeset 6:da96f28684f7 in lemon-tutorial
- Timestamp:
- 10/23/08 14:07:30 (16 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
getting_started.dox
r3 r6 18 18 19 19 /** 20 \page getting_started How to Start Using LEMON20 \page getting_started Getting Started 21 21 22 22 In this page we detail how to start using LEMON, from downloading it to … … 25 25 have a basic knowledge of your operating system and C++ programming 26 26 language. The procedure is pretty straightforward, but if you have any 27 difficulties do n't hesitate to27 difficulties do not hesitate to 28 28 <a href="mailto:lemon-user@lemon.cs.elte.hu"><b>ask</b></a>. 29 29 … … 32 32 In LEMON we use C++ templates heavily, thus compilation takes a 33 33 considerable amount of time and memory. So some decent box would be 34 advantageous . But otherwise there are no special hardware requirements.34 advantageousm, but otherwise there are no special hardware requirements. 35 35 36 36 You will need a recent C++ compiler. Our primary target is the GNU C++ 37 37 Compiler (g++), from version 3.3 upwards. We also checked the Intel C++ 38 Compiler (icc) and Microsoft Visual C++ .NET 2003, 2005.39 If you want to develop with LEMON under Windows you could consider40 using Cygwin.38 Compiler (icc) and Microsoft Visual C++ (on Windows). 39 If you want to develop with LEMON under Windows, you can use a Windows 40 installer or you can consider using Cygwin. 41 41 42 42 In this description we will suppose a Linux environment and GNU C++ Compiler. 43 If you would like to develop under Windows and use a Windows installer, 44 you could skip the following sections and continue reading \ref hello_lemon. 45 However keep in mind that you have to make appropriate steps instead of 46 the instructions detailed here to be able to compile the example code 47 with your compiler. 43 48 44 49 \subsection requirements_lp LP Solver Requirements 45 50 46 51 The LEMON LP solver interface can use the GLPK (GNU Linear Programming 47 Kit), CPLEX (was tested with CPLEX 7.5) and SoPlex solver. If you want48 to use it you will need at least one of these. See \ref configure_flags 49 how to enable these at compile time.52 Kit), CPLEX and SoPlex solver. If you want to use it, you will need at 53 least one of these. 54 See the <b><tt>INSTALL</tt></b> file how to enable these at compile time. 50 55 51 56 \section download_lemon How to Download LEMON 52 57 53 You can download LEMON from the LEMON web site: 54 <a href="http://lemon.cs.elte.hu/">https://lemon.cs.elte.hu/</a>. 55 There you will find released versions in form of <tt>.tar.gz</tt> files. 58 You can download LEMON from our web site: 59 <a href="http://lemon.cs.elte.hu/">http://lemon.cs.elte.hu/</a>. 60 There you will find released versions in form of <tt>.tar.gz</tt> files 61 (and Windows installers). 56 62 If you want a developer version (for example you want to contribute in 57 developing the library LEMON) then you might want to use our Mercurial58 repository. This case is detailed later, so from now on we suppose that 59 you downloaded a <tt>.tar.gz</tt> file.63 developing LEMON) then you might want to use our Mercurial repository. 64 This case is detailed \ref hg_checkout "later", so from now on we 65 suppose that you downloaded a <tt>.tar.gz</tt> file. 60 66 61 67 \section install_lemon How to Install LEMON … … 118 124 \endverbatim 119 125 This step is optional, but recommended. It runs the test programs that 120 wedeveloped for LEMON to check whether the library works properly on126 have been developed for LEMON to check whether the library works properly on 121 127 your platform. 122 128 … … 131 137 132 138 Several other configure flags can be passed to <tt>./configure</tt>. 133 For more information see <tt>./configure --help</tt> and the INSTALL 134 file in the install directory. 139 For more information see the <b><tt>INSTALL</tt></b> file. 135 140 136 141 \section hg_checkout How to Checkout LEMON from our Mercurial Repository 137 142 138 You can obtain the latest version of LEMON from our Mercurial repository.139 To do this issue the following command: 140 \verbatim 141 hg clone http://lemon.cs.elte.hu/hg/lemon lemon-src143 You can obtain the latest (developer) version of LEMON from our Mercurial 144 repository. To do this issue the following command. 145 \verbatim 146 hg clone http://lemon.cs.elte.hu/hg/lemon-main lemon-src 142 147 \endverbatim 143 148 … … 145 150 146 151 You can compile the code from the repository similarly to the packaged 147 version, but you will need to run <b><tt>autoreconf -vif</tt></b> or148 <b><tt>./bootstrap</tt></b> in some older environmentbefore152 version, but you will need to run <b><tt>autoreconf -vif</tt></b> 153 (or <b><tt>./bootstrap</tt></b> in some older environment) before 149 154 <tt>./configure</tt>. See <tt>./configure --help</tt> for options. 150 155 For bootstrapping you will need the following tools: … … 158 163 You will need <a href="http://www.doxygen.org/">Doxygen</a> for this. 159 164 165 \section hello_lemon Compile Your First Code 166 167 If you have installed LEMON on your system you can paste the following 168 code segment into a file called <tt>hello_lemon.cc</tt> to have a first 169 working program that uses LEMON. 170 171 \dontinclude hello_lemon.cc 172 \skip #include 173 \until } 174 175 First let us briefly explain how this example program works. 176 (The used notions will be discussed in detail in the following chapter.) 177 178 After some convenience typedefs we create a directed graph (\e digraph) 179 and add some nodes and arcs to it. 180 ListDigraph is one of the digraph classes implemented in LEMON. 181 It is based on linked lists, therefore iterating through its nodes and 182 arcs is fast. 183 184 Then we iterate through all nodes of the digraph and print their unique 185 IDs. We use a constructor of the node iterator to initialize it to the 186 first node. 187 The <tt>operator++</tt> is used to step to the next node. After the last 188 node the iterator becomes invalid (i.e. it is set to \c INVALID). 189 This is what we exploit in the stop condition. 190 We iterate through all arcs of the digraph very similarly and print the 191 IDs of their source (tail) and target (head) nodes using the \c source() 192 and \c target() member functions. 193 194 After that we create an arc map, which is actually a mapping that assigns 195 an \c int value (length) to each arc, and we set this value for each arc. 196 Finally we iterate through all arcs again and print their lengths. 197 198 Now let's compile this simple example program. 199 200 \subsection hello_lemon_system If LEMON is Installed System-Wide 201 202 If your installation of LEMON into directory \c /usr/local was 203 successful, then it is very easy to compile this program with the 204 following command (the argument <tt>-lemon</tt> tells the compiler 205 that we are using the installed LEMON): 206 207 \verbatim 208 g++ hello_lemon.cc -o hello_lemon -lemon 209 \endverbatim 210 211 As a result you will get the exacutable \c hello_lemon in the current 212 directory, which you can run by the following command. 213 214 \verbatim 215 ./hello_lemon 216 \endverbatim 217 218 \subsection hello_lemon_user If LEMON is Installed User-Local 219 220 Compiling the code is a bit more difficult if you installed LEMON 221 user-local into a directory (e.g. <tt>~/lemon</tt>) or if you just 222 skipped the step <tt>make install</tt>. 223 You have to issue a command like this. 224 225 \verbatim 226 g++ -I ~/lemon hello_lemon.cc -o hello_lemon -lemon -L ~/lemon/lemon/.libs 227 \endverbatim 228 229 \subsubsection hello_lemon_pkg_config Use pkg-config 230 231 \todo Write this sub-subsection (\ref hello_lemon_pkg_config). 232 233 If everything has gone well, then our program prints out the followings. 234 235 \verbatim 236 Hello World! 237 This is LEMON library here. We have a direceted graph. 238 239 Nodes: 3 2 1 0 240 Arcs: (2,3) (1,3) (1,2) (0,2) (0,1) 241 242 There is a map on the arcs (length): 243 244 length(2,3)=10 245 length(1,3)=25 246 length(1,2)=5 247 length(0,2)=20 248 length(0,1)=10 249 \endverbatim 250 251 You may note that iterating through the nodes and arcs is done in the 252 reverse order compared to the creating order (the IDs are in decreasing 253 order). 254 This is due to implementation aspects, that may differ at other graph 255 types, moreover it may be changed in the next releases. 256 Thus you should not exploit this method in any way, you should not 257 suppose anything about the iteration order. 258 259 If you managed to compile and run this example code without any problems, 260 you can go on reading this tutorial to get to know more features and tools 261 of LEMON. 262 Otherwise if you encountered problems that you did not manage to solve, 263 do not hesitate to 264 <a href="mailto:lemon-user@lemon.cs.elte.hu"><b>contact us</b></a>. 265 160 266 */ -
intro.dox
r3 r6 22 22 \section intro_lemon What is LEMON 23 23 24 LEMONstands for <b>L</b>ibrary of <b>E</b>fficient <b>M</b>odels and24 <b>LEMON</b> stands for <b>L</b>ibrary of <b>E</b>fficient <b>M</b>odels and 25 25 <b>O</b>ptimization in <b>N</b>etworks. It is a C++ template 26 library aimed at combinatorial optimization tasks which often involve27 in working with graphs.26 library aimed at combinatorial optimization tasks, especially those 27 working with graphs and networks. 28 28 29 29 <b>LEMON is an <a class="el" href="http://opensource.org/">open source</a> 30 30 project. 31 31 You are free to use it in your commercial or non-commercial applications 32 under very permissive \ref license "license terms". 33 </b> 32 under very permissive \ref license "license terms".</b> 33 34 This library helps to write programs that solve optimization problems 35 that arise frequently when designing and testing certain networks, 36 for example in telecommunication, computer networks, logistics, scheduling, 37 and other areas. 38 A very natural way of modelling these networks is by means of a graph. 39 Generally if you want to write any program that works with graphs, 40 then you might find it useful and convenient to use LEMON. 41 42 For more information visit the LEMON web site: 43 <a href="http://lemon.cs.elte.hu/"><b>http://lemon.cs.elte.hu/</b></a>. 34 44 35 45 \section intro_tutorial LEMON Tutorial 36 46 37 47 This tutorial introduces the reader to the basic concepts and features of 38 LEMON, and there are some sections about advanced topics showing the power39 of thevarious tools implemented in the library.48 LEMON, and there are also some sections about advanced topics showing the 49 power of various tools implemented in the library. 40 50 41 After getting familiar with the basic concepts you may start using LEMON42 with the help of the detailed documentation (that can also be used as a 43 reference manual).51 After getting familiar with the basics of the library, you may start using 52 LEMON with the help of the detailed documentation (that can also be used 53 as a reference manual). 44 54 45 55 */
Note: See TracChangeset
for help on using the changeset viewer.