diff --git a/.cproject b/.cproject index ac9b166ec..5d8469baa 100644 --- a/.cproject +++ b/.cproject @@ -1309,6 +1309,7 @@ make + testSimulated2DOriented.run true false @@ -1348,6 +1349,7 @@ make + testSimulated2D.run true false @@ -1355,6 +1357,7 @@ make + testSimulated3D.run true false @@ -1458,7 +1461,6 @@ make - testErrors.run true false @@ -1769,7 +1771,6 @@ cpack - -G DEB true false @@ -1777,7 +1778,6 @@ cpack - -G RPM true false @@ -1785,7 +1785,6 @@ cpack - -G TGZ true false @@ -1793,7 +1792,6 @@ cpack - --config CPackSourceConfig.cmake true false @@ -1985,6 +1983,7 @@ make + tests/testGaussianISAM2 true false @@ -2120,7 +2119,6 @@ make - tests/testBayesTree.run true false @@ -2128,7 +2126,6 @@ make - testBinaryBayesNet.run true false @@ -2176,7 +2173,6 @@ make - testSymbolicBayesNet.run true false @@ -2184,7 +2180,6 @@ make - tests/testSymbolicFactor.run true false @@ -2192,7 +2187,6 @@ make - testSymbolicFactorGraph.run true false @@ -2208,7 +2202,6 @@ make - tests/testBayesTree true false @@ -2902,6 +2895,14 @@ true true + + make + -j4 + timeSchurFactors.run + true + true + true + make -j5 @@ -3344,7 +3345,6 @@ make - testGraph.run true false @@ -3352,7 +3352,6 @@ make - testJunctionTree.run true false @@ -3360,7 +3359,6 @@ make - testSymbolicBayesNetB.run true false diff --git a/timing/DummyFactor.h b/timing/DummyFactor.h index ff9732909..08e9d8f4b 100644 --- a/timing/DummyFactor.h +++ b/timing/DummyFactor.h @@ -13,20 +13,20 @@ namespace gtsam { /** * DummyFactor */ -template // -class DummyFactor: public RegularImplicitSchurFactor { +template // +class DummyFactor: public RegularImplicitSchurFactor { public: - typedef Eigen::Matrix Matrix2D; + typedef Eigen::Matrix Matrix2D; typedef std::pair KeyMatrix2D; DummyFactor() { } DummyFactor(const std::vector& Fblocks, const Matrix& E, - const Matrix3& P, const Vector& b) :RegularImplicitSchurFactor(Fblocks,E,P,b) - { + const Matrix3& P, const Vector& b) : + RegularImplicitSchurFactor(Fblocks, E, P, b) { } virtual ~DummyFactor() { diff --git a/timing/timeSchurFactors.cpp b/timing/timeSchurFactors.cpp index 06a526567..e08924400 100644 --- a/timing/timeSchurFactors.cpp +++ b/timing/timeSchurFactors.cpp @@ -11,6 +11,8 @@ #include #include "gtsam/slam/JacobianFactorQR.h" #include +#include +#include #include #include @@ -29,17 +31,20 @@ using namespace gtsam; ofstream os("timeSchurFactors.csv"); /*************************************************************************************/ -template +template void timeAll(size_t m, size_t N) { cout << m << endl; // create F + static const int D = CAMERA::dimension; typedef Eigen::Matrix Matrix2D; - typedef pair KeyMatrix2D; - vector < pair > Fblocks; - for (size_t i = 0; i < m; i++) - Fblocks.push_back(KeyMatrix2D(i, (i + 1) * Matrix::Ones(2, D))); + FastVector keys; + vector Fblocks; + for (size_t i = 0; i < m; i++) { + keys.push_back(i); + Fblocks.push_back((i + 1) * Matrix::Ones(2, D)); + } // create E Matrix E(2 * m, 3); @@ -60,11 +65,11 @@ void timeAll(size_t m, size_t N) { xvalues.insert(i, gtsam::repeat(D, 2)); // Implicit - RegularImplicitSchurFactor implicitFactor(Fblocks, E, P, b); + RegularImplicitSchurFactor implicitFactor(keys, Fblocks, E, P, b); // JacobianFactor with same error - JacobianFactorQ jf(Fblocks, E, P, b, model); + JacobianFactorQ jf(keys, Fblocks, E, P, b, model); // JacobianFactorQR with same error - JacobianFactorQR jqr(Fblocks, E, P, b, model); + JacobianFactorQR jqr(keys, Fblocks, E, P, b, model); // Hessian HessianFactor hessianFactor(jqr); @@ -146,7 +151,7 @@ int main(void) { //for (size_t m=10;m<=100;m+=10) ms += m; // loop over number of images BOOST_FOREACH(size_t m,ms) - timeAll<6>(m, NUM_ITERATIONS); + timeAll >(m, NUM_ITERATIONS); } //*************************************************************************************