#include <Ordering.h>
Public Types | |
enum | OrderingType { COLAMD, METIS, NATURAL, CUSTOM } |
Type of ordering to use. More... | |
typedef std::shared_ptr< This > | shared_ptr |
shared_ptr to this class More... | |
typedef Ordering | This |
Typedef to this class. More... | |
Public Member Functions | |
bool | contains (const Key &key) const |
Check if key exists in ordering. More... | |
FastMap< Key, size_t > | invert () const |
Invert (not reverse) the ordering - returns a map from key to order position. More... | |
This & | operator+= (Key key) |
This & | operator+= (KeyVector &keys) |
Append new keys to the ordering as ordering += keys . More... | |
This & | operator, (Key key) |
Overloading the comma operator allows for chaining appends. More... | |
Ordering () | |
Create an empty ordering More... | |
template<typename KEYS > | |
Ordering (const KEYS &keys) | |
Create from a container. More... | |
Testable | |
void | print (const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
bool | equals (const Ordering &other, double tol=1e-9) const |
Static Public Member Functions | |
Fill-reducing Orderings | |
template<class FACTOR_GRAPH > | |
static Ordering | Colamd (const FACTOR_GRAPH &graph) |
static Ordering | Colamd (const VariableIndex &variableIndex) |
Compute a fill-reducing ordering using COLAMD from a VariableIndex. More... | |
template<class FACTOR_GRAPH > | |
static Ordering | ColamdConstrainedLast (const FACTOR_GRAPH &graph, const KeyVector &constrainLast, bool forceOrder=false) |
static Ordering | ColamdConstrainedLast (const VariableIndex &variableIndex, const KeyVector &constrainLast, bool forceOrder=false) |
template<class FACTOR_GRAPH > | |
static Ordering | ColamdConstrainedFirst (const FACTOR_GRAPH &graph, const KeyVector &constrainFirst, bool forceOrder=false) |
static Ordering | ColamdConstrainedFirst (const VariableIndex &variableIndex, const KeyVector &constrainFirst, bool forceOrder=false) |
template<class FACTOR_GRAPH > | |
static Ordering | ColamdConstrained (const FACTOR_GRAPH &graph, const FastMap< Key, int > &groups) |
static Ordering | ColamdConstrained (const VariableIndex &variableIndex, const FastMap< Key, int > &groups) |
template<class FACTOR_GRAPH > | |
static Ordering | Natural (const FACTOR_GRAPH &fg) |
Return a natural Ordering. Typically used by iterative solvers. More... | |
template<class FACTOR_GRAPH > | |
static void | CSRFormat (std::vector< int > &xadj, std::vector< int > &adj, const FACTOR_GRAPH &graph) |
METIS Formatting function. More... | |
static Ordering | Metis (const MetisIndex &met) |
Compute an ordering determined by METIS from a VariableIndex. More... | |
template<class FACTOR_GRAPH > | |
static Ordering | Metis (const FACTOR_GRAPH &graph) |
Named Constructors | |
template<class FACTOR_GRAPH > | |
static Ordering | Create (OrderingType orderingType, const FACTOR_GRAPH &graph) |
Protected Types | |
typedef KeyVector | Base |
Static Private Member Functions | |
static Ordering | ColamdConstrained (const VariableIndex &variableIndex, std::vector< int > &cmember) |
Internal COLAMD function. More... | |
Definition at line 33 of file inference/Ordering.h.
|
protected |
Definition at line 35 of file inference/Ordering.h.
typedef std::shared_ptr<This> gtsam::Ordering::shared_ptr |
shared_ptr to this class
Definition at line 45 of file inference/Ordering.h.
typedef Ordering gtsam::Ordering::This |
Typedef to this class.
Definition at line 44 of file inference/Ordering.h.
Type of ordering to use.
Enumerator | |
---|---|
COLAMD | |
METIS | |
NATURAL | |
CUSTOM |
Definition at line 40 of file inference/Ordering.h.
|
inline |
Create an empty ordering
Definition at line 48 of file inference/Ordering.h.
|
inlineexplicit |
Create from a container.
Definition at line 55 of file inference/Ordering.h.
|
inlinestatic |
Compute a fill-reducing ordering using COLAMD from a factor graph (see details for note on performance). This internally builds a VariableIndex so if you already have a VariableIndex, it is faster to use COLAMD(const VariableIndex&)
Definition at line 93 of file inference/Ordering.h.
|
static |
Compute a fill-reducing ordering using COLAMD from a VariableIndex.
Definition at line 43 of file Ordering.cpp.
|
inlinestatic |
Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note on performance). This internally builds a VariableIndex so if you already have a VariableIndex, it is faster to use COLAMD(const VariableIndex&). In this function, a group for each variable should be specified in groups
, and each group of variables will appear in the ordering in group index order. groups
should be a map from Key to group index. The group indices used should be consecutive starting at 0, but may appear in groups
in arbitrary order. Any variables not present in groups
will be assigned to group 0. This function simply fills the cmember
argument to CCOLAMD with the supplied indices, see the CCOLAMD documentation for more information.
Definition at line 168 of file inference/Ordering.h.
|
static |
Compute a fill-reducing ordering using constrained COLAMD from a VariableIndex. In this function, a group for each variable should be specified in groups
, and each group of variables will appear in the ordering in group index order. groups
should be a map from Key to group index. The group indices used should be consecutive starting at 0, but may appear in groups
in arbitrary order. Any variables not present in groups
will be assigned to group 0. This function simply fills the cmember
argument to CCOLAMD with the supplied indices, see the CCOLAMD documentation for more information.
Definition at line 188 of file Ordering.cpp.
|
staticprivate |
Internal COLAMD function.
Definition at line 50 of file Ordering.cpp.
|
inlinestatic |
Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note on performance). This internally builds a VariableIndex so if you already have a VariableIndex, it is faster to use COLAMD(const VariableIndex&). This function constrains the variables in constrainLast
to the end of the ordering, and orders all other variables before in a fill-reducing ordering. If forceOrder
is true, the variables in constrainFirst
will be ordered in the same order specified in the KeyVector constrainFirst
. If forceOrder
is false, the variables in constrainFirst
will be ordered before all the others, but will be rearranged by CCOLAMD to reduce fill-in as well.
Definition at line 139 of file inference/Ordering.h.
|
static |
Compute a fill-reducing ordering using constrained COLAMD from a VariableIndex. This function constrains the variables in constrainFirst
to the front of the ordering, and orders all other variables after in a fill-reducing ordering. If forceOrder
is true, the variables in constrainFirst
will be ordered in the same order specified in the KeyVector constrainFirst
. If forceOrder
is false, the variables in constrainFirst
will be ordered before all the others, but will be rearranged by CCOLAMD to reduce fill-in as well.
Definition at line 155 of file Ordering.cpp.
|
inlinestatic |
Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note on performance). This internally builds a VariableIndex so if you already have a VariableIndex, it is faster to use COLAMD(const VariableIndex&). This function constrains the variables in constrainLast
to the end of the ordering, and orders all other variables before in a fill-reducing ordering. If forceOrder
is true, the variables in constrainLast
will be ordered in the same order specified in the KeyVector constrainLast
. If forceOrder
is false, the variables in constrainLast
will be ordered after all the others, but will be rearranged by CCOLAMD to reduce fill-in as well.
Definition at line 112 of file inference/Ordering.h.
|
static |
Compute a fill-reducing ordering using constrained COLAMD from a VariableIndex. This function constrains the variables in constrainLast
to the end of the ordering, and orders all other variables before in a fill-reducing ordering. If forceOrder
is true, the variables in constrainLast
will be ordered in the same order specified in the KeyVector constrainLast
. If forceOrder
is false, the variables in constrainLast
will be ordered after all the others, but will be rearranged by CCOLAMD to reduce fill-in as well.
Definition at line 128 of file Ordering.cpp.
bool gtsam::Ordering::contains | ( | const Key & | key | ) | const |
Check if key exists in ordering.
Definition at line 304 of file Ordering.cpp.
|
inlinestatic |
Definition at line 217 of file inference/Ordering.h.
|
static |
METIS Formatting function.
Definition at line 309 of file Ordering.cpp.
Invert (not reverse) the ordering - returns a map from key to order position.
Definition at line 35 of file Ordering.cpp.
|
inlinestatic |
Definition at line 204 of file inference/Ordering.h.
|
static |
Compute an ordering determined by METIS from a VariableIndex.
Definition at line 211 of file Ordering.cpp.
|
inlinestatic |
Return a natural Ordering. Typically used by iterative solvers.
Definition at line 188 of file inference/Ordering.h.
Ordering::This & gtsam::Ordering::operator+= | ( | Key | key | ) |
Add new variables to the ordering as ordering += key1, key2, ...
.
Definition at line 286 of file Ordering.cpp.
Ordering::This & gtsam::Ordering::operator+= | ( | KeyVector & | keys | ) |
Append new keys to the ordering as ordering += keys
.
keys | The key vector to append to this ordering. |
Definition at line 298 of file Ordering.cpp.
Ordering::This & gtsam::Ordering::operator, | ( | Key | key | ) |
Overloading the comma operator allows for chaining appends.
Definition at line 292 of file Ordering.cpp.
void gtsam::Ordering::print | ( | const std::string & | str = "" , |
const KeyFormatter & | keyFormatter = DefaultKeyFormatter |
||
) | const |
Definition at line 259 of file Ordering.cpp.