GEDLIB  1.0
misc.hpp
Go to the documentation of this file.
1 /***************************************************************************
2 * *
3 * Copyright (C) 2018 by David B. Blumenthal *
4 * *
5 * This file is part of GEDLIB. *
6 * *
7 * GEDLIB is free software: you can redistribute it and/or modify it *
8 * under the terms of the GNU Lesser General Public License as published *
9 * by the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * GEDLIB is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU Lesser General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License along with GEDLIB. If not, see <http://www.gnu.org/licenses/>. *
19 * *
20 ***************************************************************************/
21 
27 #ifndef SRC_UTIL_MISC_HPP_
28 #define SRC_UTIL_MISC_HPP_
29 
30 #include "../env/ged_graph.hpp"
31 #include "../env/node_map.hpp"
32 #include "../util/lsap_solver.hpp"
33 #include "../util/lsape_solver.hpp"
34 
35 namespace ged {
36 
41 namespace util {
42 
50 template<class Solver>
51 void construct_node_map_from_solver(const Solver & solver, NodeMap & node_map, std::size_t solution_id = 0);
52 
59 void counting_sort(std::vector<LabelID>::iterator first, std::vector<LabelID>::iterator last);
60 
66 void init_adj_matrix(const GEDGraph & graph, DMatrix & adj_matrix);
67 
73 void parse_config_file(const std::string & filename, std::map<std::string, std::string> & options);
74 
80 void save_as_config_file(const std::string & filename, const std::map<std::string, std::string> & options);
81 
82 }
83 
84 }
85 
86 #include "misc.ipp"
87 
88 #endif /* SRC_UTIL_MISC_HPP_ */
Definition: util.hpp:37
Matrix< double > DMatrix
Matrix with double entries.
Definition: matrix.hpp:199
void counting_sort(std::vector< LabelID >::iterator first, std::vector< LabelID >::iterator last)
Implementation of counting sort.
Definition: misc.ipp:111
void parse_config_file(const std::string &filename, std::map< std::string, std::string > &options)
Parses a configuration file.
Definition: misc.ipp:49
Global namespace for GEDLIB.
void save_as_config_file(const std::string &filename, const std::map< std::string, std::string > &options)
Saves a string map as a configuration file as expected by parse_config_file().
Definition: misc.ipp:76
void construct_node_map_from_solver(const Solver &solver, NodeMap &node_map, std::size_t solution_id=0)
Constructs a node map from a solution to LSAPE or LSAPE stored in a ged::LSAPESolver or a ged::LSAPSo...
Definition: misc.ipp:86
void init_adj_matrix(const GEDGraph &graph, DMatrix &adj_matrix)
Initalizes the adjacency matrix of a graph.
Definition: misc.ipp:35
Definition of miscellaneous utility functions.