Upgrade gettext infrastructure.
3 * This file is a part of LEMON, a generic C++ optimization library
5 * Copyright (C) 2003-2006
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
19 #include <lemon/kruskal.h>
21 #include <mapstorage.h>
22 #include <mapselector.h>
24 #include <kruskalbox.h>
26 enum {INPUT, OUTPUT, MAP_NUM};
28 KruskalBox::KruskalBox(std::vector<std::string> t):AlgoBox()
33 void KruskalBox::run()
36 tabcbt.get_active_text()!="" &&
37 (arcmapcbts[INPUT])->get_active_text()!="" &&
38 (arcmapcbts[OUTPUT])->get_active_text()!=""
42 const Digraph &g=mapstorage->getDigraph();
43 std::string input_map_name = arcmapcbts[INPUT]->get_active_text();
44 Digraph::ArcMap<bool> outputmap(g);
45 const MapStorage::NumericArcMap& inputmap=
46 mapstorage->getNumericArcMap(input_map_name);
47 double res=kruskal(g, inputmap, outputmap);
49 for (ArcIt i(g); i!=INVALID; ++i)
53 mapstorage->set(arcmapcbts[OUTPUT]->get_active_text(), i, 1.0);
57 mapstorage->set(arcmapcbts[OUTPUT]->get_active_text(), i, 0.0);
62 o << "Result: " << res;
63 resultlabel.set_text(o.str());
65 mapstorage->mapChanged(true, (arcmapcbts[OUTPUT])->get_active_text());
66 // mapstorage->changeActiveMap(true, E_COLOR,
67 // (arcmapcbts[OUTPUT])->get_active_text());
68 // mapstorage->changeActiveMap(true, E_TEXT,
69 // (arcmapcbts[INPUT])->get_active_text());
74 void KruskalBox::build_box()
76 std::vector<std::string> empty_vector;
78 addMapSelector("Arccosts: ", true, NUM);
79 addMapSelector("Arcs of tree here: ", true, NUM);
81 resultlabel.set_text("Result: algorithm is not run yet.");
82 pack_start(resultlabel);