22 #include <gtsam/dllexport.h> 24 #include <boost/serialization/version.hpp> 25 #include <boost/serialization/nvp.hpp> 26 #include <boost/shared_ptr.hpp> 31 namespace serialization {
39 class GaussianFactorGraph;
40 struct PreconditionerParameters;
52 friend class boost::serialization::access;
53 template <
class Archive>
55 ar &BOOST_SERIALIZATION_NVP(index);
56 ar &BOOST_SERIALIZATION_NVP(weight);
60 typedef std::vector<Edge>
Edges;
72 Subgraph(
const std::vector<size_t> &indices);
74 inline const Edges &
edges()
const {
return edges_; }
75 inline size_t size()
const {
return edges_.size(); }
76 EdgeIndices edgeIndices()
const;
78 iterator
begin() {
return edges_.begin(); }
79 const_iterator
begin()
const {
return edges_.begin(); }
80 iterator
end() {
return edges_.end(); }
81 const_iterator
end()
const {
return edges_.end(); }
83 void save(
const std::string &fn)
const;
88 friend class boost::serialization::access;
89 template <
class Archive>
91 ar &BOOST_SERIALIZATION_NVP(edges_);
97 typedef boost::shared_ptr<SubgraphBuilderParameters>
shared_ptr;
120 } augmentationWeight;
126 : skeletonType(KRUSKAL),
127 skeletonWeight(RANDOM),
128 augmentationWeight(SKELETON),
129 augmentationFactor(1.0) {}
134 virtual void print(std::ostream &
os)
const;
135 friend std::ostream &
operator<<(std::ostream &os,
138 static Skeleton skeletonTranslator(
const std::string &
s);
139 static std::string skeletonTranslator(
Skeleton s);
140 static SkeletonWeight skeletonWeightTranslator(
const std::string &s);
161 const std::vector<double> &weights)
const;
167 const std::vector<double> &weights)
const;
168 std::vector<size_t> sample(
const std::vector<double> &weights,
169 const size_t t)
const;
180 std::pair<boost::shared_ptr<GaussianFactorGraph>, boost::shared_ptr<GaussianFactorGraph> >
void print(const Matrix &A, const string &s, ostream &stream)
GaussianFactorGraph::shared_ptr buildFactorSubgraph(const GaussianFactorGraph &gfg, const Subgraph &subgraph, const bool clone)
vector< MFAS::KeyPair > edges
void save(Archive &ar, const Eigen::Matrix< Scalar_, Rows_, Cols_, Ops_, MaxRows_, MaxCols_ > &m, const unsigned int)
Typedefs for easier changing of types.
bool isUnitWeight() const
static enum @843 ordering
const_iterator begin() const
virtual ~SubgraphBuilder()
std::pair< GaussianFactorGraph::shared_ptr, GaussianFactorGraph::shared_ptr > splitFactorGraph(const GaussianFactorGraph &factorGraph, const Subgraph &subgraph)
Subgraph(const Edges &edges)
std::vector< Edge > Edges
std::vector< size_t > EdgeIndices
std::ostream & operator<<(std::ostream &s, const Jet< T, N > &z)
double augmentationFactor
factor multiplied with n, yields number of extra edges.
std::vector< double > Weights
SubgraphBuilder(const SubgraphBuilderParameters &p=SubgraphBuilderParameters())
Subgraph(const Subgraph &subgraph)
boost::shared_ptr< SubgraphBuilderParameters > shared_ptr
const_iterator end() const
Edges::const_iterator const_iterator
const Edges & edges() const
SubgraphBuilderParameters()
A thin wrapper around std::map that uses boost's fast_pool_allocator.
ofstream os("timeSchurFactors.csv")
SubgraphBuilderParameters parameters_
void load(Archive &ar, Eigen::Matrix< Scalar_, Rows_, Cols_, Ops_, MaxRows_, MaxCols_ > &m, const unsigned int)
virtual ~SubgraphBuilderParameters()
void serialize(Archive &ar, const unsigned int)
void serialize(Archive &ar, const unsigned int)