GEDLIB  1.0
Functions
ged::util Namespace Reference

Contains miscellaneous utility functions. More...

Functions

template<class Solver >
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::LSAPSolver object. More...
 
void counting_sort (std::vector< LabelID >::iterator first, std::vector< LabelID >::iterator last)
 Implementation of counting sort. More...
 
void init_adj_matrix (const GEDGraph &graph, DMatrix &adj_matrix)
 Initalizes the adjacency matrix of a graph. More...
 
void parse_config_file (const std::string &filename, std::map< std::string, std::string > &options)
 Parses a configuration file. More...
 
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(). More...
 

Detailed Description

Contains miscellaneous utility functions.

Function Documentation

◆ construct_node_map_from_solver()

template<class Solver >
void ged::util::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::LSAPSolver object.

Template Parameters
SolverMust be either ged::LSAPESolver or ged::LSAPSolver.
Parameters
[in]solverSolver object that has been solved by call to ged::LSAPESolver::solve() or ged::LSAPSolver::solve(), respectively.
[out]node_mapThe constructed node map.
[in]solution_idThe ID of the solution stored in solver from which the matching should be constructed.

Definition at line 86 of file misc.ipp.

◆ counting_sort()

void ged::util::counting_sort ( std::vector< LabelID >::iterator  first,
std::vector< LabelID >::iterator  last 
)

Implementation of counting sort.

Parameters
[in]firstIterator to first element in subvector that should be sorted.
[in]lastIterator to last element in subvector that should be sorted.
See also
https://en.wikipedia.org/wiki/Counting_sort

Definition at line 111 of file misc.ipp.

◆ init_adj_matrix()

void ged::util::init_adj_matrix ( const GEDGraph graph,
DMatrix adj_matrix 
)

Initalizes the adjacency matrix of a graph.

Parameters
[in]graphThe graph whose adjacency matrix should be constructed.
[out]adj_matrixThe constructed adjacency matrix.

Definition at line 35 of file misc.ipp.

◆ parse_config_file()

void ged::util::parse_config_file ( const std::string &  filename,
std::map< std::string, std::string > &  options 
)

Parses a configuration file.

Parameters
[in]filenameName of a file whose lines are of the form <key>=<value>.
[out]optionsString map that contains the file's keys as keys and the file's values as values.

Definition at line 49 of file misc.ipp.

◆ save_as_config_file()

void ged::util::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().

Parameters
[in]filenameName of the configuration file that should be created.
[in]optionsString map that should be saved as a configuration file.

Definition at line 76 of file misc.ipp.