24 #include <boost/assign/std/vector.hpp> 25 #include <boost/assign/list_of.hpp> 26 #include <boost/range/adaptor/map.hpp> 32 using boost::adaptors::map_keys;
33 using namespace gtsam;
108 Vector expSubVector = (
Vector(5) << 1, 4, 5, 6, 7).finished();
128 double dotExpected = test1.
vector().dot(test2.
vector());
129 double dotActual = test1.
dot(test2);
133 double normExpected = test1.
vector().norm();
134 double normActual = test1.
norm();
138 double sqNormExpected = test1.
vector().norm();
139 double sqNormActual = test1.
norm();
177 x << 1, 2, 3, 4, 5, 6, 7;
185 std::map<Key,size_t> dims;
186 dims.insert(make_pair(0,1));
187 dims.insert(make_pair(1,2));
188 dims.insert(make_pair(2,2));
189 dims.insert(make_pair(5,2));
194 scatter.emplace_back(0,1);
195 scatter.emplace_back(1,2);
196 scatter.emplace_back(2,2);
197 scatter.emplace_back(5,2);
219 std::map<Key,size_t> dims;
220 dims.insert(make_pair(0,1));
221 dims.insert(make_pair(5,2));
245 " 0: 1\n 1: 2 3\n 2: 4 5\n 5: 6 7\n 7: 8 9\n";
248 EXPECT(expected == actual.str());
void print(const Matrix &A, const string &s, ostream &stream)
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
#define DOUBLES_EQUAL(expected, actual, threshold)
VectorValues & addInPlace_(const VectorValues &c)
#define CHECK_EXCEPTION(condition, exception_name)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
constexpr int first(int i)
Implementation details for constexpr functions.
bool hasSameStructure(const VectorValues other) const
bool convert(const int &y)
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double dot(const VectorValues &v) const
TEST(VectorValues, basics)
#define LONGS_EQUAL(expected, actual)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
detail::initimpl::constructor< Args... > init()
Binds an existing constructor taking arguments Args...
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
iterator insert(const std::pair< Key, Vector > &key_value)
void test2(OptionalJacobian<-1,-1 > H=boost::none)