|
template<typename Graph > |
std::shared_ptr< HDFGroup > | Utopia::DataIO::create_graph_group (const Graph &g, const std::shared_ptr< HDFGroup > &parent_grp, const std::string &name) |
|
template<typename Graph > |
void | Utopia::DataIO::save_graph (const Graph &g, const std::shared_ptr< HDFGroup > &grp) |
| Write function for a boost::Graph. More...
|
|
template<typename Graph , typename PropertyMap > |
void | Utopia::DataIO::save_graph (const Graph &g, const std::shared_ptr< HDFGroup > &grp, const PropertyMap vertex_ids) |
| Write function for a boost::Graph. More...
|
|
template<IterateOver iterate_over, typename Graph , typename... Adaptors> |
void | Utopia::DataIO::save_graph_entity_properties (const Graph &g, const std::shared_ptr< HDFGroup > &nw_grp, const std::string &label, const std::tuple< Adaptors... > &adaptor_tuple) |
|
template<typename Graph , typename... Adaptors> |
void | Utopia::DataIO::save_vertex_properties (Graph &&g, const std::shared_ptr< HDFGroup > &nw_grp, const std::string &label, const std::tuple< Adaptors... > &adaptor_tuple) |
|
template<typename Graph , typename... Adaptors> |
void | Utopia::DataIO::save_edge_properties (Graph &&g, const std::shared_ptr< HDFGroup > &nw_grp, const std::string &label, const std::tuple< Adaptors... > &adaptor_tuple) |
|
Provides functions which wrap common tasks for writing out data from graphs.
Overview
This module implements functions which wrap common tasks people face when they wish to extract data from boost::graph objects.
Implementation
The provided functions can be separated into two groups, one which saves the entire graph, i.e., its edge-vertex structure, and a second one which allows to extract data associated with either edges or vertices via user supplied functions.
template<IterateOver iterate_over, typename Graph , typename... Adaptors>
void Utopia::DataIO::save_graph_entity_properties |
( |
const Graph & |
g, |
|
|
const std::shared_ptr< HDFGroup > & |
nw_grp, |
|
|
const std::string & |
label, |
|
|
const std::tuple< Adaptors... > & |
adaptor_tuple |
|
) |
| |
This function writes the results of all functions in a named tuple, applied to all vertices/edges of a boost::graph into a HDFGroup.
For each adaptor, the data written by this function is available at the path nw_grp/adaptor_name/label
, where label is a dataset of size {num_edges/vertices}
in the 1d case or {num_adaptors, num_edges/vertices}
if data from more than one adaptor is to be written.
Attributes are added to the datasets that determine the dimension names and the coordinates. The name of dimension -1 is set to vertex_idx
/edge_idx
. The respective coordinates are the trivial ones. In the case of 2d data custom dimension name and coordinates for dimension need to be given. Note that the former has to be string-like and the latter have to be of the same type.
- Warning
- The coordinate type is deduced from the first coordinate. All other coordinates have to be of the same type.
- Template Parameters
-
- Parameters
-
g | The graph from which to save vertex or edge properties. |
nw_grp | The HDFGroup the data should be written to. This should be the previously created network group. For each tuple entry, a new group will be created, which has the name specified as first element of that tuple. |
label | Under which label the results of the adaptors should be stored. This will be the name of the dataset to which the adaptors write data. If time-varying data is to be written, this can be used to specify the time step. |
adaptor_tuple | Which vertex- or edge-associated properties to write. This should be a tuple of tuples, where the latter are of one of the following forms: If (adaptor_name, adaptor) then 1d data is written. If (adaptor_name, dim0_name, (coord1, adaptor1), (coord2, adaptor2), ...) then 2d data is written. |
- Returns
- void