27 using namespace gtsam;
118 Vector expSubVector = (
Vector(5) << 1, 4, 5, 6, 7).finished();
138 double dotExpected = test1.
vector().dot(test2.
vector());
139 double dotActual = test1.
dot(test2);
143 double normExpected = test1.
vector().norm();
144 double normActual = test1.
norm();
148 double sqNormExpected = test1.
vector().norm();
149 double sqNormActual = test1.
norm();
187 x << 1, 2, 3, 4, 5, 6, 7;
195 std::map<Key,size_t> dims;
196 dims.insert(make_pair(0,1));
197 dims.insert(make_pair(1,2));
198 dims.insert(make_pair(2,2));
199 dims.insert(make_pair(5,2));
204 scatter.emplace_back(0,1);
205 scatter.emplace_back(1,2);
206 scatter.emplace_back(2,2);
207 scatter.emplace_back(5,2);
229 std::map<Key,size_t> dims;
230 dims.insert(make_pair(0,1));
231 dims.insert(make_pair(5,2));
255 " 0: 1\n 1: 2 3\n 2: 4 5\n 5: 6 7\n 7: 8 9\n";
258 EXPECT(expected == actual.str());
272 "<table class='VectorValues'>\n" 274 " <tr><th>Variable</th><th>value</th></tr>\n" 277 " <tr><th>x1</th><td> 2 3.1</td></tr>\n" 278 " <tr><th>x2</th><td> 4 5.2</td></tr>\n" 279 " <tr><th>x5</th><td> 6 7.3</td></tr>\n" 280 " <tr><th>x7</th><td> 8 9.4</td></tr>\n" 284 string actual = vv.
html();
285 EXPECT(actual == expected);
bool hasSameStructure(const VectorValues other) const
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
#define DOUBLES_EQUAL(expected, actual, threshold)
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
iterator insert(const std::pair< Key, Vector > &key_value)
EIGEN_STRONG_INLINE Packet4f print(const Packet4f &a)
VectorValues & addInPlace_(const VectorValues &c)
#define CHECK_EXCEPTION(condition, exception_name)
void test2(OptionalJacobian<-1,-1 > H={})
static const VectorValues vv
string html(const DiscreteValues &values, const KeyFormatter &keyFormatter, const DiscreteValues::Names &names)
Free version of html.
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
TEST(VectorValues, basics)
#define LONGS_EQUAL(expected, actual)
double dot(const VectorValues &v) const
detail::initimpl::constructor< Args... > init()
Binds an existing constructor taking arguments Args...
std::string html(const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Output as a html table.
VectorValues & update(const VectorValues &values)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
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
static const VectorValues kExample
static BinaryMeasurement< Rot3 > convert(const BetweenFactor< Pose3 >::shared_ptr &f)