35 using namespace gtsam;
51 EXPECT(equalityBinary(list));
57 map.insert(make_pair(1,
v1));
58 map.insert(make_pair(2,
v2));
59 map.insert(make_pair(3,
v3));
63 EXPECT(equalityBinary(map));
75 EXPECT(equalityBinary(
set));
86 EXPECT(equalityXML(vector));
87 EXPECT(equalityBinary(vector));
91 TEST (Serialization, matrix_vector) {
92 EXPECT(equality<Vector>((
Vector(4) << 1.0, 2.0, 3.0, 4.0).finished()));
95 EXPECT(equality<Vector6>((Vector6() << 1.0, 2.0, 3.0, 4.0, 5.0, 6.0).finished()));
96 EXPECT(equality<Matrix>((
Matrix(2, 2) << 1.0, 2.0, 3.0, 4.0).finished()));
98 EXPECT(equalityXML<Vector>((
Vector(4) << 1.0, 2.0, 3.0, 4.0).finished()));
101 EXPECT(equalityXML<Vector6>((Vector6() << 1.0, 2.0, 3.0, 4.0, 5.0, 6.0).finished()));
102 EXPECT(equalityXML<Matrix>((
Matrix(2, 2) << 1.0, 2.0, 3.0, 4.0).finished()));
104 EXPECT(equalityBinary<Vector>((
Vector(4) << 1.0, 2.0, 3.0, 4.0).finished()));
107 EXPECT(equalityBinary<Vector6>((Vector6() << 1.0, 2.0, 3.0, 4.0, 5.0, 6.0).finished()));
108 EXPECT(equalityBinary<Matrix>((
Matrix(2, 2) << 1.0, 2.0, 3.0, 4.0).finished()));
116 map.insert(make_pair(1,
"apple"));
117 map.insert(make_pair(2,
"banana"));
119 std::string binaryPath =
"saved_map.dat";
121 std::ofstream outputStream(binaryPath);
122 boost::archive::binary_oarchive outputArchive(outputStream);
123 outputArchive << map;
130 mapFromDisk.insert(make_pair(3,
"clam"));
133 std::ifstream ifs(binaryPath);
134 boost::archive::binary_iarchive inputArchive(ifs);
135 inputArchive >> mapFromDisk;
A thin wrapper around std::list that uses boost's fast_pool_allocator.
static int runAllTests(TestResult &result)
std::vector< T, typename internal::FastDefaultVectorAllocator< T >::type > FastVector
bool exists(const KEY &e) const
TEST(Serialization, FastList)
#define EXPECT(condition)
Serialization for matrices.
A thin wrapper around std::vector that uses a custom allocator.
typedef and functions to augment Eigen's VectorXd
A thin wrapper around std::map that uses boost's fast_pool_allocator.
bool equality(const Errors &actual, const Errors &expected, double tol)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A thin wrapper around std::set that uses boost's fast_pool_allocator.