gtsam  4.0.0
gtsam
gtsam::Ordering Class Reference
+ Inheritance diagram for gtsam::Ordering:

Public Member Functions

GTSAM_EXPORT Ordering ()
 Create an empty ordering.
 
template<typename KEYS >
 Ordering (const KEYS &keys)
 Create from a container.
 
template<typename ITERATOR >
 Ordering (ITERATOR firstKey, ITERATOR lastKey)
 Create an ordering using iterators over keys.
 
boost::assign::list_inserter< boost::assign_detail::call_push_back< This > > operator+= (Key key)
 Add new variables to the ordering as ordering += key1, key2, ... More...
 
FastMap< Key, size_t > invert () const
 Invert (not reverse) the ordering - returns a map from key to order position.
 
Testable @{
GTSAM_EXPORT void print (const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 
GTSAM_EXPORT bool equals (const Ordering &other, double tol=1e-9) const
 

Static Public Member Functions

Fill-reducing Orderings @{
template<class FACTOR >
static Ordering Colamd (const FactorGraph< FACTOR > &graph)
 Compute a fill-reducing ordering using COLAMD from a factor graph (see details for note on performance). More...
 
static GTSAM_EXPORT Ordering Colamd (const VariableIndex &variableIndex)
 Compute a fill-reducing ordering using COLAMD from a VariableIndex.
 
template<class FACTOR >
static Ordering ColamdConstrainedLast (const FactorGraph< FACTOR > &graph, const std::vector< Key > &constrainLast, bool forceOrder=false)
 Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note on performance). More...
 
static GTSAM_EXPORT Ordering ColamdConstrainedLast (const VariableIndex &variableIndex, const std::vector< Key > &constrainLast, bool forceOrder=false)
 Compute a fill-reducing ordering using constrained COLAMD from a VariableIndex. More...
 
template<class FACTOR >
static Ordering ColamdConstrainedFirst (const FactorGraph< FACTOR > &graph, const std::vector< Key > &constrainFirst, bool forceOrder=false)
 Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note on performance). More...
 
static GTSAM_EXPORT Ordering ColamdConstrainedFirst (const VariableIndex &variableIndex, const std::vector< Key > &constrainFirst, bool forceOrder=false)
 Compute a fill-reducing ordering using constrained COLAMD from a VariableIndex. More...
 
template<class FACTOR >
static Ordering ColamdConstrained (const FactorGraph< FACTOR > &graph, const FastMap< Key, int > &groups)
 Compute a fill-reducing ordering using constrained COLAMD from a factor graph (see details for note on performance). More...
 
static GTSAM_EXPORT Ordering ColamdConstrained (const VariableIndex &variableIndex, const FastMap< Key, int > &groups)
 Compute a fill-reducing ordering using constrained COLAMD from a VariableIndex. More...
 
template<class FACTOR >
static Ordering Natural (const FactorGraph< FACTOR > &fg)
 Return a natural Ordering. Typically used by iterative solvers.
 
template<class FACTOR >
static GTSAM_EXPORT void CSRFormat (std::vector< int > &xadj, std::vector< int > &adj, const FactorGraph< FACTOR > &graph)
 METIS Formatting function.
 
static GTSAM_EXPORT Ordering Metis (const MetisIndex &met)
 Compute an ordering determined by METIS from a VariableIndex.
 
template<class FACTOR >
static Ordering Metis (const FactorGraph< FACTOR > &graph)
 
Named Constructors @{
template<class FACTOR >
static Ordering Create (OrderingType orderingType, const FactorGraph< FACTOR > &graph)
 

Public Types

enum  OrderingType { COLAMD, METIS, NATURAL, CUSTOM }
 Type of ordering to use.
 
typedef Ordering This
 Typedef to this class.
 
typedef boost::shared_ptr< Thisshared_ptr
 shared_ptr to this class
 

Protected Types

typedef std::vector< KeyBase
 

Friends

class boost::serialization::access
 Serialization function.
 

Member Function Documentation

template<class FACTOR >
static Ordering gtsam::Ordering::Colamd ( const FactorGraph< FACTOR > &  graph)
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&)

template<class FACTOR >
static Ordering gtsam::Ordering::ColamdConstrained ( const FactorGraph< FACTOR > &  graph,
const FastMap< Key, int > &  groups 
)
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.

Ordering gtsam::Ordering::ColamdConstrained ( const VariableIndex variableIndex,
const FastMap< Key, int > &  groups 
)
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.

template<class FACTOR >
static Ordering gtsam::Ordering::ColamdConstrainedFirst ( const FactorGraph< FACTOR > &  graph,
const std::vector< Key > &  constrainFirst,
bool  forceOrder = false 
)
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 vector<Key> 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.

Ordering gtsam::Ordering::ColamdConstrainedFirst ( const VariableIndex variableIndex,
const std::vector< Key > &  constrainFirst,
bool  forceOrder = false 
)
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 vector<Key> 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.

template<class FACTOR >
static Ordering gtsam::Ordering::ColamdConstrainedLast ( const FactorGraph< FACTOR > &  graph,
const std::vector< Key > &  constrainLast,
bool  forceOrder = false 
)
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 vector<Key> 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.

Ordering gtsam::Ordering::ColamdConstrainedLast ( const VariableIndex variableIndex,
const std::vector< Key > &  constrainLast,
bool  forceOrder = false 
)
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 vector<Key> 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.

boost::assign::list_inserter<boost::assign_detail::call_push_back<This> > gtsam::Ordering::operator+= ( Key  key)
inline

Add new variables to the ordering as ordering += key1, key2, ...

Equivalent to calling push_back.


The documentation for this class was generated from the following files: