testVerticalBlockMatrix.cpp
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
21 
22 #include<list>
23 #include<vector>
24 
25 using namespace gtsam;
26 
27 const std::vector<size_t> dimensions{3, 2, 1};
28 
29 //*****************************************************************************
30 TEST(VerticalBlockMatrix, Constructor1) {
32  EXPECT_LONGS_EQUAL(6,actual.rows());
33  EXPECT_LONGS_EQUAL(6,actual.cols());
34  EXPECT_LONGS_EQUAL(3,actual.nBlocks());
35 }
36 
37 //*****************************************************************************
38 TEST(VerticalBlockMatrix, Constructor2) {
40  (Matrix(6, 6) << 1, 2, 3, 4, 5, 6, //
41  2, 8, 9, 10, 11, 12, //
42  3, 9, 15, 16, 17, 18, //
43  4, 10, 16, 22, 23, 24, //
44  5, 11, 17, 23, 29, 30, //
45  6, 12, 18, 24, 30, 36).finished());
46  EXPECT_LONGS_EQUAL(6,actual.rows());
47  EXPECT_LONGS_EQUAL(6,actual.cols());
48  EXPECT_LONGS_EQUAL(3,actual.nBlocks());
49 }
50 
51 //*****************************************************************************
52 TEST(VerticalBlockMatrix, Constructor3) {
53  VerticalBlockMatrix actual(dimensions.begin(),dimensions.end(),6);
54  EXPECT_LONGS_EQUAL(6,actual.rows());
55  EXPECT_LONGS_EQUAL(6,actual.cols());
56  EXPECT_LONGS_EQUAL(3,actual.nBlocks());
57 }
58 
59 //*****************************************************************************
60 int main() {
61  TestResult tr;
62  return TestRegistry::runAllTests(tr);
63 }
64 //*****************************************************************************
65 
TestRegistry::runAllTests
static int runAllTests(TestResult &result)
Definition: TestRegistry.cpp:27
dimensions
const std::vector< size_t > dimensions
Definition: testVerticalBlockMatrix.cpp:27
EXPECT_LONGS_EQUAL
#define EXPECT_LONGS_EQUAL(expected, actual)
Definition: Test.h:154
TestHarness.h
gtsam::Matrix
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:39
main
int main()
Definition: testVerticalBlockMatrix.cpp:60
gtsam::VerticalBlockMatrix
Definition: VerticalBlockMatrix.h:42
VerticalBlockMatrix.h
A matrix with column blocks of pre-defined sizes. Used in JacobianFactor and GaussianConditional.
gtsam::VerticalBlockMatrix::nBlocks
DenseIndex nBlocks() const
Block count.
Definition: VerticalBlockMatrix.h:121
TestResult
Definition: TestResult.h:26
gtsam
traits
Definition: SFMdata.h:40
gtsam::TEST
TEST(SmartFactorBase, Pinhole)
Definition: testSmartFactorBase.cpp:38
gtsam::VerticalBlockMatrix::cols
DenseIndex cols() const
Column size.
Definition: VerticalBlockMatrix.h:118
gtsam::VerticalBlockMatrix::rows
DenseIndex rows() const
Row size.
Definition: VerticalBlockMatrix.h:115


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:08:56