gtsam/cpp/Ordering.cpp

41 lines
1019 B
C++
Raw Normal View History

2009-08-22 06:23:24 +08:00
/**
* @file Ordering.cpp
* @brief Ordering
* @author Christian Potthast
*/
#include <iostream>
#include <boost/assign/std/list.hpp> // for operator +=
2009-10-31 23:24:22 +08:00
#include <boost/foreach.hpp>
2009-08-22 06:23:24 +08:00
#include "Ordering.h"
using namespace std;
using namespace gtsam;
using namespace boost::assign;
/* ************************************************************************* */
Ordering Ordering::subtract(const Ordering& keys) const {
Ordering newOrdering = *this;
BOOST_FOREACH(string key, keys) {
newOrdering.remove(key);
}
return newOrdering;
}
2009-08-22 06:23:24 +08:00
/* ************************************************************************* */
2009-10-31 23:24:22 +08:00
void Ordering::print(const string& s) const {
cout << s;
BOOST_FOREACH(string key, *this)
cout << " " << key;
2009-08-22 06:23:24 +08:00
cout << endl;
}
/* ************************************************************************* */
2009-10-31 23:24:22 +08:00
bool Ordering::equals(const Ordering &other, double tol) const {
return *this == other;
2009-08-22 06:23:24 +08:00
}
/* ************************************************************************* */