41 COLAMD, METIS, NATURAL, CUSTOM
51 using KeyVector::KeyVector;
54 template<
typename KEYS>
56 Base(keys.begin(), keys.end()) {
61 This& operator+=(
Key key);
65 This& operator,(
Key key);
76 bool contains(
const Key& key)
const;
92 template<
class FACTOR_GRAPH>
111 template<
class FACTOR_GRAPH>
113 const KeyVector& constrainLast,
bool forceOrder =
false) {
126 static Ordering ColamdConstrainedLast(
128 bool forceOrder =
false);
138 template<
class FACTOR_GRAPH>
140 const KeyVector& constrainFirst,
bool forceOrder =
false) {
154 static Ordering ColamdConstrainedFirst(
156 const KeyVector& constrainFirst,
bool forceOrder =
false);
167 template<
class FACTOR_GRAPH>
187 template<
class FACTOR_GRAPH>
189 KeySet src = fg.keys();
191 std::stable_sort(keys.begin(), keys.end());
192 return Ordering(keys.begin(), keys.end());
196 template<
class FACTOR_GRAPH>
198 std::vector<int>& adj,
const FACTOR_GRAPH& graph);
209 template<
class FACTOR_GRAPH>
210 static Ordering Metis(
const FACTOR_GRAPH& graph,
int seed = 4321) {
222 template<
class FACTOR_GRAPH>
223 static Ordering Create(OrderingType orderingType,
224 const FACTOR_GRAPH& graph) {
228 switch (orderingType) {
230 return Colamd(graph);
234 return Natural(graph);
236 throw std::runtime_error(
237 "Ordering::Create error: called with CUSTOM ordering type.");
239 throw std::runtime_error(
240 "Ordering::Create error: called with unknown ordering type.");
249 void print(
const std::string& str =
"",
const KeyFormatter& keyFormatter =
250 DefaultKeyFormatter)
const;
252 bool equals(
const Ordering& other,
double tol = 1e-9)
const;
258 static Ordering ColamdConstrained(
259 const VariableIndex& variableIndex, std::vector<int>& cmember);
261#if GTSAM_ENABLE_BOOST_SERIALIZATION
263 friend class boost::serialization::access;
264 template<
class ARCHIVE>
265 void serialize(ARCHIVE & ar,
const unsigned int version) {
266 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
A thin wrapper around std::set that uses boost's fast_pool_allocator.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition Key.h:91
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
FastMap is a thin wrapper around std::map that uses the boost fast_pool_allocator instead of the defa...
Definition FastMap.h:40
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
The MetisIndex class converts a factor graph into the Compressed Sparse Row format for use in METIS a...
Definition MetisIndex.h:37
static Ordering Natural(const FACTOR_GRAPH &fg)
Return a natural Ordering. Typically used by iterative solvers.
Definition Ordering.h:188
static Ordering ColamdConstrained(const FACTOR_GRAPH &graph, const FastMap< Key, int > &groups)
Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note o...
Definition Ordering.h:168
Ordering(const KEYS &keys)
Create from a container.
Definition Ordering.h:55
static Ordering Colamd(const FACTOR_GRAPH &graph)
Compute a fill-reducing ordering using COLAMD from a factor graph (see details for note on performanc...
Definition Ordering.h:93
OrderingType
Type of ordering to use.
Definition Ordering.h:40
static Ordering ColamdConstrainedLast(const FACTOR_GRAPH &graph, const KeyVector &constrainLast, bool forceOrder=false)
Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note o...
Definition Ordering.h:112
static Ordering Metis(const MetisIndex &met, int seed=4321)
Compute an ordering determined by METIS from a VariableIndex.
Definition Ordering.cpp:256
std::shared_ptr< This > shared_ptr
shared_ptr to this class
Definition Ordering.h:45
static void CSRFormat(std::vector< int > &xadj, std::vector< int > &adj, const FACTOR_GRAPH &graph)
METIS Formatting function.
static Ordering ColamdConstrainedFirst(const FACTOR_GRAPH &graph, const KeyVector &constrainFirst, bool forceOrder=false)
Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note o...
Definition Ordering.h:139
Ordering()
Create an empty ordering.
Definition Ordering.h:48
Ordering This
Typedef to this class.
Definition Ordering.h:44
The VariableIndex class computes and stores the block column structure of a factor graph.
Definition VariableIndex.h:41