gtsam 4.1.1
gtsam
serialization.h
Go to the documentation of this file.
1
10#pragma once
11
13
14namespace gtsam {
15
16// Serialize/Deserialize a NonlinearFactorGraph
17std::string serializeGraph(const NonlinearFactorGraph& graph);
18
19NonlinearFactorGraph::shared_ptr deserializeGraph(const std::string& serialized_graph);
20
21std::string serializeGraphXML(const NonlinearFactorGraph& graph,
22 const std::string& name = "graph");
23
24NonlinearFactorGraph::shared_ptr deserializeGraphXML(const std::string& serialized_graph,
25 const std::string& name = "graph");
26
27
28// Serialize/Deserialize a Values
29std::string serializeValues(const Values& values);
30
31Values::shared_ptr deserializeValues(const std::string& serialized_values);
32
33std::string serializeValuesXML(const Values& values, const std::string& name = "values");
34
35Values::shared_ptr deserializeValuesXML(const std::string& serialized_values,
36 const std::string& name = "values");
37
38// Serialize to/from files
39// serialize functions return true if successful
40// Filename arguments include path
41
42// Serialize
43bool serializeGraphToFile(const NonlinearFactorGraph& graph, const std::string& fname);
44bool serializeGraphToXMLFile(const NonlinearFactorGraph& graph,
45 const std::string& fname, const std::string& name = "graph");
46
47bool serializeValuesToFile(const Values& values, const std::string& fname);
48bool serializeValuesToXMLFile(const Values& values,
49 const std::string& fname, const std::string& name = "values");
50
51// Deserialize
52NonlinearFactorGraph::shared_ptr deserializeGraphFromFile(const std::string& fname);
53NonlinearFactorGraph::shared_ptr deserializeGraphFromXMLFile(const std::string& fname,
54 const std::string& name = "graph");
55
56Values::shared_ptr deserializeValuesFromFile(const std::string& fname);
57Values::shared_ptr deserializeValuesFromXMLFile(const std::string& fname,
58 const std::string& name = "values");
59
60} // \namespace gtsam
61
62
Factor Graph consisting of non-linear factors.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
boost::shared_ptr< Values > shared_ptr
A shared_ptr to this class.
Definition: Values.h:89