21 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 22 #include <boost/version.hpp> 23 #if BOOST_VERSION >= 107400 24 #include <boost/serialization/library_version_type.hpp> 26 #include <boost/serialization/nvp.hpp> 27 #include <boost/serialization/set.hpp> 36 namespace serialization {
50 template<
typename VALUE>
51 class FastSet:
public std::set<VALUE, std::less<VALUE>,
52 typename internal::FastDefaultAllocator<VALUE>::type> {
58 typedef std::set<VALUE, std::less<VALUE>,
59 typename internal::FastDefaultAllocator<VALUE>::type> Base;
66 template<
typename INPUTCONTAINER>
67 explicit FastSet(
const INPUTCONTAINER& container) :
68 Base(container.begin(), container.end()) {
81 #ifdef GTSAM_ALLOCATOR_BOOSTPOOL 83 FastSet(
const std::set<VALUE>& x) {
88 Base::insert(x.begin(), x.end());
93 operator std::set<VALUE>()
const {
94 return std::set<VALUE>(this->begin(), this->end());
99 return this->find(e) != this->end();
103 void print(
const std::string& str =
"")
const {
104 for (
typename Base::const_iterator it = this->begin(); it != this->end(); ++it)
110 typename Base::const_iterator it1 = this->begin(), it2 = other.begin();
111 while (it1 != this->end()) {
122 Base::insert(other.begin(), other.end());
126 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 128 friend class boost::serialization::access;
129 template<
class ARCHIVE>
130 void serialize(ARCHIVE & ar,
const unsigned int ) {
131 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
Concept check for values that can be used in unit tests.
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:113
FastSet(const Base &x)
Definition: FastSet.h:77
bool exists(const VALUE &e) const
Definition: FastSet.h:98
void merge(const FastSet &other)
Definition: FastSet.h:121
void print(const std::string &str="") const
Definition: FastSet.h:103
Definition: Testable.h:59
FastSet(const INPUTCONTAINER &container)
Definition: FastSet.h:67
Definition: chartTesting.h:28
bool equals(const FastSet< VALUE > &other, double tol=1e-9) const
Definition: FastSet.h:109
An easy way to control which allocator is used for Fast* collections.
FastSet(const FastSet< VALUE > &x)
Definition: FastSet.h:72