gtsam/cpp/Ordering.h

52 lines
932 B
C
Raw Normal View History

2009-08-22 06:23:24 +08:00
/**
* @file Ordering.h
* @brief Ordering of indices for eliminating a factor graph
* @author Frank Dellaert
*/
#pragma once
2009-10-31 23:24:22 +08:00
#include <list>
2009-08-22 06:23:24 +08:00
#include <string>
2009-10-31 23:24:22 +08:00
#include "Testable.h"
2009-08-22 06:23:24 +08:00
namespace gtsam {
/**
2009-10-07 02:01:40 +08:00
* @class Ordering
* @brief ordering of indices for eliminating a factor graph
2009-08-22 06:23:24 +08:00
*/
2009-10-31 23:24:22 +08:00
class Ordering: public std::list<std::string>, public Testable<Ordering> {
2009-10-07 02:01:40 +08:00
public:
/**
* Default constructor creates empty ordering
*/
Ordering() {
}
2009-11-09 06:51:29 +08:00
/**
* Create from a single string
*/
Ordering(std::string key) {
push_back(key);
}
2009-10-07 02:01:40 +08:00
/**
* Copy constructor from string vector
*/
2009-10-31 23:24:22 +08:00
Ordering(const std::list<std::string>& strings_in) :
std::list<std::string>(strings_in) {
2009-10-07 02:01:40 +08:00
}
2009-10-31 23:24:22 +08:00
void print(const std::string& s = "Ordering") const;
2009-10-07 02:01:40 +08:00
/**
* check if two orderings are the same
* @param ordering
* @return bool
*/
2009-10-31 23:24:22 +08:00
bool equals(const Ordering &ord, double tol=0) const;
2009-10-07 02:01:40 +08:00
};
2009-08-22 06:23:24 +08:00
}