Public Types | Public Member Functions | Protected Types | Private Member Functions | Static Private Member Functions | Friends | List of all members
gtsam::Ordering Class Reference

#include <Ordering.h>

Inheritance diagram for gtsam::Ordering:
Inheritance graph
[legend]

Public Types

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

Public Member Functions

FastMap< Key, size_tinvert () const
 Invert (not reverse) the ordering - returns a map from key to order position. More...
 
boost::assign::list_inserter< boost::assign_detail::call_push_back< This > > operator+= (Key key)
 
GTSAM_EXPORT Ordering ()
 Create an empty ordering. More...
 
template<typename KEYS >
 Ordering (const KEYS &keys)
 Create from a container. More...
 
template<typename ITERATOR >
 Ordering (ITERATOR firstKey, ITERATOR lastKey)
 Create an ordering using iterators over keys. More...
 
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_GRAPH >
static Ordering Colamd (const FACTOR_GRAPH &graph)
 
static GTSAM_EXPORT 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 GTSAM_EXPORT 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 GTSAM_EXPORT 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 GTSAM_EXPORT 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 GTSAM_EXPORT void CSRFormat (std::vector< int > &xadj, std::vector< int > &adj, const FACTOR_GRAPH &graph)
 METIS Formatting function. More...
 
static GTSAM_EXPORT 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
 

Private Member Functions

template<class ARCHIVE >
void serialize (ARCHIVE &ar, const unsigned int version)
 

Static Private Member Functions

static GTSAM_EXPORT Ordering ColamdConstrained (const VariableIndex &variableIndex, std::vector< int > &cmember)
 Internal COLAMD function. More...
 

Friends

class boost::serialization::access
 

Detailed Description

Definition at line 34 of file inference/Ordering.h.

Member Typedef Documentation

typedef KeyVector gtsam::Ordering::Base
protected

Definition at line 36 of file inference/Ordering.h.

typedef boost::shared_ptr<This> gtsam::Ordering::shared_ptr

shared_ptr to this class

Definition at line 46 of file inference/Ordering.h.

Typedef to this class.

Definition at line 45 of file inference/Ordering.h.

Member Enumeration Documentation

Type of ordering to use.

Enumerator
COLAMD 
METIS 
NATURAL 
CUSTOM 

Definition at line 41 of file inference/Ordering.h.

Constructor & Destructor Documentation

GTSAM_EXPORT gtsam::Ordering::Ordering ( )
inline

Create an empty ordering.

Definition at line 50 of file inference/Ordering.h.

template<typename KEYS >
gtsam::Ordering::Ordering ( const KEYS &  keys)
inlineexplicit

Create from a container.

Definition at line 55 of file inference/Ordering.h.

template<typename ITERATOR >
gtsam::Ordering::Ordering ( ITERATOR  firstKey,
ITERATOR  lastKey 
)
inline

Create an ordering using iterators over keys.

Definition at line 61 of file inference/Ordering.h.

Member Function Documentation

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

Definition at line 82 of file inference/Ordering.h.

Ordering gtsam::Ordering::Colamd ( const VariableIndex variableIndex)
static

Compute a fill-reducing ordering using COLAMD from a VariableIndex.

Definition at line 44 of file Ordering.cpp.

template<class FACTOR_GRAPH >
static Ordering gtsam::Ordering::ColamdConstrained ( const FACTOR_GRAPH &  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.

Definition at line 157 of file inference/Ordering.h.

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.

Definition at line 189 of file Ordering.cpp.

Ordering gtsam::Ordering::ColamdConstrained ( const VariableIndex variableIndex,
std::vector< int > &  cmember 
)
staticprivate

Internal COLAMD function.

Definition at line 51 of file Ordering.cpp.

template<class FACTOR_GRAPH >
static Ordering gtsam::Ordering::ColamdConstrainedFirst ( const FACTOR_GRAPH &  graph,
const KeyVector 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 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 128 of file inference/Ordering.h.

Ordering gtsam::Ordering::ColamdConstrainedFirst ( const VariableIndex variableIndex,
const KeyVector 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 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 156 of file Ordering.cpp.

template<class FACTOR_GRAPH >
static Ordering gtsam::Ordering::ColamdConstrainedLast ( const FACTOR_GRAPH &  graph,
const KeyVector 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 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 101 of file inference/Ordering.h.

Ordering gtsam::Ordering::ColamdConstrainedLast ( const VariableIndex variableIndex,
const KeyVector 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 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 129 of file Ordering.cpp.

template<class FACTOR_GRAPH >
static Ordering gtsam::Ordering::Create ( OrderingType  orderingType,
const FACTOR_GRAPH &  graph 
)
inlinestatic

Definition at line 205 of file inference/Ordering.h.

template<class FACTOR_GRAPH >
static GTSAM_EXPORT void gtsam::Ordering::CSRFormat ( std::vector< int > &  xadj,
std::vector< int > &  adj,
const FACTOR_GRAPH &  graph 
)
static

METIS Formatting function.

bool gtsam::Ordering::equals ( const Ordering other,
double  tol = 1e-9 
) const

Definition at line 287 of file Ordering.cpp.

FastMap< Key, size_t > gtsam::Ordering::invert ( ) const

Invert (not reverse) the ordering - returns a map from key to order position.

Definition at line 36 of file Ordering.cpp.

Ordering gtsam::Ordering::Metis ( const MetisIndex met)
static

Compute an ordering determined by METIS from a VariableIndex.

Definition at line 212 of file Ordering.cpp.

template<class FACTOR_GRAPH >
static Ordering gtsam::Ordering::Metis ( const FACTOR_GRAPH &  graph)
inlinestatic

Definition at line 193 of file inference/Ordering.h.

template<class FACTOR_GRAPH >
static Ordering gtsam::Ordering::Natural ( const FACTOR_GRAPH &  fg)
inlinestatic

Return a natural Ordering. Typically used by iterative solvers.

Definition at line 177 of file inference/Ordering.h.

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.

Definition at line 67 of file inference/Ordering.h.

void gtsam::Ordering::print ( const std::string &  str = "",
const KeyFormatter keyFormatter = DefaultKeyFormatter 
) const

Definition at line 260 of file Ordering.cpp.

template<class ARCHIVE >
void gtsam::Ordering::serialize ( ARCHIVE &  ar,
const unsigned int  version 
)
inlineprivate

Definition at line 247 of file inference/Ordering.h.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Serialization function

Definition at line 245 of file inference/Ordering.h.


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


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:58:19