├── doc ├── COPYING └── CMakeLists.txt ├── tests └── CMakeLists.txt ├── version_prefix.txt ├── 3rdparty ├── eigen3 │ ├── Eigen │ │ ├── Eigen │ │ ├── src │ │ │ ├── Core │ │ │ │ ├── util │ │ │ │ │ ├── NonMPL2.h │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── ReenableStupidWarnings.h │ │ │ │ │ └── DisableStupidWarnings.h │ │ │ │ ├── arch │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── NEON │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── SSE │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ ├── AltiVec │ │ │ │ │ │ └── CMakeLists.txt │ │ │ │ │ └── Default │ │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ │ └── Settings.h │ │ │ │ ├── products │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── CoreIterators.h │ │ │ ├── QR │ │ │ │ └── CMakeLists.txt │ │ │ ├── SVD │ │ │ │ └── CMakeLists.txt │ │ │ ├── misc │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── Solve.h │ │ │ ├── Jacobi │ │ │ │ └── CMakeLists.txt │ │ │ ├── LU │ │ │ │ ├── arch │ │ │ │ │ └── CMakeLists.txt │ │ │ │ └── CMakeLists.txt │ │ │ ├── plugins │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── CommonCwiseBinaryOps.h │ │ │ │ └── MatrixCwiseUnaryOps.h │ │ │ ├── Cholesky │ │ │ │ └── CMakeLists.txt │ │ │ ├── SparseLU │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── SparseLU_Utils.h │ │ │ ├── SparseQR │ │ │ │ └── CMakeLists.txt │ │ │ ├── Eigenvalues │ │ │ │ └── CMakeLists.txt │ │ │ ├── Householder │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── BlockHouseholder.h │ │ │ ├── SparseCore │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── SparseFuzzy.h │ │ │ │ ├── SparseRedux.h │ │ │ │ └── SparseTranspose.h │ │ │ ├── StlSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── MetisSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── SPQRSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── Geometry │ │ │ │ ├── arch │ │ │ │ │ └── CMakeLists.txt │ │ │ │ └── CMakeLists.txt │ │ │ ├── PaStiXSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── CholmodSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── PardisoSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── SparseCholesky │ │ │ │ └── CMakeLists.txt │ │ │ ├── SuperLUSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── UmfPackSupport │ │ │ │ └── CMakeLists.txt │ │ │ ├── OrderingMethods │ │ │ │ └── CMakeLists.txt │ │ │ ├── Eigen2Support │ │ │ │ ├── Geometry │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Macros.h │ │ │ │ ├── TriangularSolver.h │ │ │ │ ├── Memory.h │ │ │ │ ├── QR.h │ │ │ │ ├── Lazy.h │ │ │ │ └── MathFunctions.h │ │ │ ├── IterativeLinearSolvers │ │ │ │ └── CMakeLists.txt │ │ │ └── CMakeLists.txt │ │ ├── Dense │ │ ├── Array │ │ ├── Householder │ │ ├── CMakeLists.txt │ │ ├── Sparse │ │ ├── Jacobi │ │ ├── StdList │ │ ├── QtAlignedMalloc │ │ ├── MetisSupport │ │ ├── LeastSquares │ │ ├── StdDeque │ │ ├── StdVector │ │ ├── Cholesky │ │ ├── PardisoSupport │ │ ├── SVD │ │ ├── SPQRSupport │ │ ├── QR │ │ ├── SparseQR │ │ ├── LU │ │ ├── UmfPackSupport │ │ ├── Eigenvalues │ │ ├── SparseCholesky │ │ ├── PaStiXSupport │ │ ├── IterativeLinearSolvers │ │ ├── Geometry │ │ ├── CholmodSupport │ │ ├── SparseLU │ │ ├── SparseCore │ │ ├── SuperLUSupport │ │ └── OrderingMethods │ ├── unsupported │ │ ├── test │ │ │ ├── FFT.cpp │ │ │ ├── matrix_square_root.cpp │ │ │ ├── gmres.cpp │ │ │ ├── dgmres.cpp │ │ │ ├── minres.cpp │ │ │ ├── matrix_functions.h │ │ │ ├── alignedvector3.cpp │ │ │ └── mpreal_support.cpp │ │ ├── doc │ │ │ ├── CMakeLists.txt │ │ │ ├── examples │ │ │ │ ├── MatrixExponential.cpp │ │ │ │ ├── MatrixPower.cpp │ │ │ │ ├── MatrixLogarithm.cpp │ │ │ │ ├── MatrixPower_optimal.cpp │ │ │ │ ├── MatrixSquareRoot.cpp │ │ │ │ ├── MatrixFunction.cpp │ │ │ │ ├── MatrixSine.cpp │ │ │ │ ├── MatrixSinh.cpp │ │ │ │ ├── PolynomialUtils1.cpp │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── BVH_Example.cpp │ │ │ │ └── PolynomialSolver1.cpp │ │ │ ├── Overview.dox │ │ │ └── snippets │ │ │ │ └── CMakeLists.txt │ │ ├── Eigen │ │ │ ├── src │ │ │ │ ├── BVH │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── FFT │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── SVD │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── doneInBDCSVD.txt │ │ │ │ │ └── TODOBdcsvd.txt │ │ │ │ ├── Skyline │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── Splines │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── AutoDiff │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── AutoDiffJacobian.h │ │ │ │ ├── Polynomials │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── SparseExtra │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── NumericalDiff │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── LevenbergMarquardt │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── CopyrightMINPACK.txt │ │ │ │ │ └── LMcovar.h │ │ │ │ ├── MatrixFunctions │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ └── StemFunction.h │ │ │ │ ├── IterativeSolvers │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── KroneckerProduct │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── MoreVectorization │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── NonLinearOptimization │ │ │ │ │ ├── CMakeLists.txt │ │ │ │ │ ├── r1mpyq.h │ │ │ │ │ ├── rwupdt.h │ │ │ │ │ ├── chkder.h │ │ │ │ │ ├── covar.h │ │ │ │ │ └── fdjac1.h │ │ │ │ └── CMakeLists.txt │ │ │ ├── CMakeLists.txt │ │ │ ├── MoreVectorization │ │ │ ├── Splines │ │ │ ├── ArpackSupport │ │ │ ├── KroneckerProduct │ │ │ ├── Skyline │ │ │ ├── SVD │ │ │ ├── AutoDiff │ │ │ ├── LevenbergMarquardt │ │ │ ├── IterativeSolvers │ │ │ ├── SparseExtra │ │ │ └── NumericalDiff │ │ ├── CMakeLists.txt │ │ └── README.txt │ └── readme.txt ├── CMakeLists.txt ├── fast │ ├── CMakeLists.txt │ └── include │ │ └── fast │ │ ├── fast.h │ │ └── faster_corner_utilities.h └── sophus │ └── CMakeLists.txt ├── CMakeLists.txt ├── apps ├── CMakeLists.txt ├── pipeline │ ├── pipeline.cpp │ └── CMakeLists.txt ├── image_align │ ├── image_align.cpp │ └── CMakeLists.txt ├── reprojection │ ├── reprojection.cpp │ └── CMakeLists.txt ├── depth_filter_app │ ├── depth_filter_app.cpp │ └── CMakeLists.txt ├── feature_detector │ ├── feature_detector.cpp │ ├── feature_detector.cpp~ │ └── CMakeLists.txt ├── initial_position │ ├── initial_position.cpp │ └── CMakeLists.txt └── pose_and_structure │ ├── pose_and_structure.cpp │ └── CMakeLists.txt ├── libs ├── mvo │ ├── src │ │ ├── map.cpp │ │ ├── frame.cpp │ │ ├── matcher.cpp │ │ ├── point3d.cpp │ │ ├── homography.cpp │ │ ├── reprojector.cpp │ │ ├── depth_filter.cpp │ │ ├── fast_detector.cpp │ │ ├── initialization.cpp │ │ ├── pinhole_camera.cpp │ │ ├── pose_optimizer.cpp │ │ ├── abstract_detector.cpp │ │ ├── feature_alignment.cpp │ │ ├── structure_optimizer.cpp │ │ ├── config.cpp │ │ └── frame_handler_base.cpp │ ├── CMakeLists.txt │ └── include │ │ └── openmvo │ │ └── mvo │ │ ├── map.h │ │ ├── feature.h │ │ ├── matcher.h │ │ ├── point3d.h │ │ ├── homography.h │ │ ├── depth_filter.h │ │ ├── reprojector.h │ │ ├── abstract_camera.h │ │ ├── fast_detector.h │ │ ├── initialization.h │ │ ├── pinhole_camera.h │ │ ├── pose_optimizer.h │ │ ├── abstract_detector.h │ │ ├── feature_alignment.h │ │ ├── structure_optimizer.h │ │ ├── link_pragmas.h │ │ ├── frame_handler_mono.h │ │ ├── sparse_img_align.h │ │ └── frame_handler_base.h ├── base │ ├── CMakeLists.txt │ ├── src │ │ ├── utils │ │ │ └── math_utils.cpp │ │ └── base_precomp.cpp │ └── include │ │ ├── openmvo │ │ ├── utils │ │ │ ├── image_utils.h │ │ │ ├── boost_join.h │ │ │ ├── noncopyable.h │ │ │ ├── file_reader.h │ │ │ ├── math_utils.h │ │ │ └── timer.h │ │ ├── math │ │ │ └── nlls_solver_impl.hpp │ │ └── base │ │ │ └── link_pragmas.h │ │ └── base_precomp.h └── CMakeLists.txt ├── cmake ├── script_fast.cmake ├── AssureCMakeRootFile.cmake ├── DeclareOPENMVOLib.cmake ├── script_version_number.cmake ├── script_gtest.cmake ├── UtilsMacros.cmake ├── script_create_version_h.cmake ├── FilterFileLists.cmake └── script_create_config_h.cmake ├── parse-files ├── config.h.in └── version.h.in └── README.md /doc/COPYING: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /version_prefix.txt: -------------------------------------------------------------------------------- 1 | 0.1.0 2 | # 注意,这边给出版本号,文件不要删除,不要修改 3 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | //#include "Sparse" 3 | -------------------------------------------------------------------------------- /3rdparty/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(fast) 2 | ADD_SUBDIRECTORY(sophus) -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/CMakeLists.txt -------------------------------------------------------------------------------- /apps/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/CMakeLists.txt -------------------------------------------------------------------------------- /libs/mvo/src/map.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/map.cpp -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/FFT.cpp: -------------------------------------------------------------------------------- 1 | #define test_FFTW test_FFT 2 | #include "FFTW.cpp" 3 | -------------------------------------------------------------------------------- /cmake/script_fast.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/cmake/script_fast.cmake -------------------------------------------------------------------------------- /libs/mvo/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/CMakeLists.txt -------------------------------------------------------------------------------- /libs/mvo/src/frame.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/frame.cpp -------------------------------------------------------------------------------- /parse-files/config.h.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/parse-files/config.h.in -------------------------------------------------------------------------------- /3rdparty/eigen3/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/3rdparty/eigen3/readme.txt -------------------------------------------------------------------------------- /apps/pipeline/pipeline.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/pipeline/pipeline.cpp -------------------------------------------------------------------------------- /libs/base/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/base/CMakeLists.txt -------------------------------------------------------------------------------- /libs/mvo/src/matcher.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/matcher.cpp -------------------------------------------------------------------------------- /libs/mvo/src/point3d.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/point3d.cpp -------------------------------------------------------------------------------- /3rdparty/fast/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/3rdparty/fast/CMakeLists.txt -------------------------------------------------------------------------------- /libs/mvo/src/homography.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/homography.cpp -------------------------------------------------------------------------------- /libs/mvo/src/reprojector.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/reprojector.cpp -------------------------------------------------------------------------------- /3rdparty/sophus/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/3rdparty/sophus/CMakeLists.txt -------------------------------------------------------------------------------- /cmake/AssureCMakeRootFile.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/cmake/AssureCMakeRootFile.cmake -------------------------------------------------------------------------------- /cmake/DeclareOPENMVOLib.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/cmake/DeclareOPENMVOLib.cmake -------------------------------------------------------------------------------- /libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(ALL_OPENMVO_LIBS) 2 | 3 | ADD_SUBDIRECTORY(base) 4 | ADD_SUBDIRECTORY(mvo) 5 | 6 | -------------------------------------------------------------------------------- /libs/mvo/src/depth_filter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/depth_filter.cpp -------------------------------------------------------------------------------- /libs/mvo/src/fast_detector.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/fast_detector.cpp -------------------------------------------------------------------------------- /libs/mvo/src/initialization.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/initialization.cpp -------------------------------------------------------------------------------- /libs/mvo/src/pinhole_camera.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/pinhole_camera.cpp -------------------------------------------------------------------------------- /libs/mvo/src/pose_optimizer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/pose_optimizer.cpp -------------------------------------------------------------------------------- /apps/image_align/image_align.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/image_align/image_align.cpp -------------------------------------------------------------------------------- /cmake/script_version_number.cmake: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/cmake/script_version_number.cmake -------------------------------------------------------------------------------- /apps/reprojection/reprojection.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/reprojection/reprojection.cpp -------------------------------------------------------------------------------- /libs/base/src/utils/math_utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/base/src/utils/math_utils.cpp -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/map.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/map.h -------------------------------------------------------------------------------- /libs/mvo/src/abstract_detector.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/abstract_detector.cpp -------------------------------------------------------------------------------- /libs/mvo/src/feature_alignment.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/feature_alignment.cpp -------------------------------------------------------------------------------- /libs/mvo/src/structure_optimizer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/src/structure_optimizer.cpp -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/feature.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/feature.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/matcher.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/matcher.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/point3d.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/point3d.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/homography.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/homography.h -------------------------------------------------------------------------------- /apps/depth_filter_app/depth_filter_app.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/depth_filter_app/depth_filter_app.cpp -------------------------------------------------------------------------------- /apps/feature_detector/feature_detector.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/feature_detector/feature_detector.cpp -------------------------------------------------------------------------------- /apps/feature_detector/feature_detector.cpp~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/feature_detector/feature_detector.cpp~ -------------------------------------------------------------------------------- /apps/initial_position/initial_position.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/initial_position/initial_position.cpp -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/depth_filter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/depth_filter.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/reprojector.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/reprojector.h -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /apps/pose_and_structure/pose_and_structure.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/apps/pose_and_structure/pose_and_structure.cpp -------------------------------------------------------------------------------- /libs/base/include/openmvo/utils/image_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/base/include/openmvo/utils/image_utils.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/abstract_camera.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/abstract_camera.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/fast_detector.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/fast_detector.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/initialization.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/initialization.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/pinhole_camera.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/pinhole_camera.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/pose_optimizer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/pose_optimizer.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/abstract_detector.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/abstract_detector.h -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/feature_alignment.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/feature_alignment.h -------------------------------------------------------------------------------- /libs/base/include/openmvo/math/nlls_solver_impl.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/base/include/openmvo/math/nlls_solver_impl.hpp -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/structure_optimizer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yueying/OpenMVO/HEAD/libs/mvo/include/openmvo/mvo/structure_optimizer.h -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(SSE) 2 | ADD_SUBDIRECTORY(AltiVec) 3 | ADD_SUBDIRECTORY(NEON) 4 | ADD_SUBDIRECTORY(Default) 5 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE) 2 | 3 | add_subdirectory(examples) 4 | add_subdirectory(snippets) 5 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/QR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_QR_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_QR_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/QR COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SVD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SVD_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SVD_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SVD COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/misc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_misc_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_misc_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/misc COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Jacobi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Jacobi_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Jacobi_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Jacobi COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/LU/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LU_arch_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LU_arch_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU/arch COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_plugins_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_plugins_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/plugins COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Cholesky/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Cholesky_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Cholesky_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Cholesky COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SparseLU/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseLU_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseLU_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseLU COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SparseQR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseQR_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseQR_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseQR/ COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_util_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_util_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/util COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/BVH/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_BVH_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_BVH_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/BVH COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/FFT/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_FFT_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_FFT_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/FFT COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/SVD/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SVD_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SVD_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}unsupported/Eigen/src/SVD COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /cmake/script_gtest.cmake: -------------------------------------------------------------------------------- 1 | # By default, use embedded version of gtest: 2 | SET(CMAKE_FBLIB_HAS_GTEST 1) 3 | SET(CMAKE_FBLIB_HAS_GTEST_SYSTEM 0) 4 | SET(CMAKE_FBLIB_GTEST_SRC_DIR "${OPENMVO_SOURCE_DIR}/3rdparty/gtest") 5 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigenvalues/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_EIGENVALUES_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_EIGENVALUES_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigenvalues COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Householder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Householder_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Householder_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Householder COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/LU/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LU_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LU_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LU COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(arch) 9 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SparseCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseCore_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseCore_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCore COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/StlSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_StlSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_StlSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/StlSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/MetisSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_MetisSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_MetisSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/MetisSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SPQRSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SPQRSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SPQRSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SPQRSupport/ COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/arch/NEON/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_NEON_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_NEON_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/NEON COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/arch/SSE/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_SSE_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_SSE_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/SSE COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/products/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_Product_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_Product_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/products COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Geometry/arch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Geometry_arch_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Geometry_arch_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry/arch COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/PaStiXSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_PastixSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_PastixSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PaStiXSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/Skyline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Skyline_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Skyline_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/Skyline COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/Splines/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Splines_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Splines_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/Splines COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/CholmodSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_CholmodSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_CholmodSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/CholmodSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/PardisoSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_PardisoSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_PardisoSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/PardisoSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SparseCholesky/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseCholesky_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseCholesky_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCholesky COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SuperLUSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SuperLUSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SuperLUSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SuperLUSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/UmfPackSupport/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_UmfPackSupport_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_UmfPackSupport_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/UmfPackSupport COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/AutoDiff/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_AutoDiff_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_AutoDiff_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/AutoDiff COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Geometry_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Geometry_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Geometry COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(arch) 9 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/OrderingMethods/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_OrderingMethods_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_OrderingMethods_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/OrderingMethods COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/arch/AltiVec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_AltiVec_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_AltiVec_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/AltiVec COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/arch/Default/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_arch_Default_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_arch_Default_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core/arch/Default COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/Polynomials/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Polynomials_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Polynomials_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/Polynomials COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/SparseExtra/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_SparseExtra_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_SparseExtra_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/SparseExtra COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/Geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Eigen2Support_Geometry_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Eigen2Support_Geometry_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support/Geometry 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/NumericalDiff/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_NumericalDiff_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_NumericalDiff_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/NumericalDiff COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Eigen2Support_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Eigen2Support_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Eigen2Support COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(Geometry) -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/LevenbergMarquardt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_LevenbergMarquardt_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_LevenbergMarquardt_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/LevenbergMarquardt COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/MatrixFunctions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_MatrixFunctions_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_MatrixFunctions_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/MatrixFunctions COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/IterativeLinearSolvers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_IterativeLinearSolvers_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_IterativeLinearSolvers_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/IterativeLinearSolvers COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/IterativeSolvers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_IterativeSolvers_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_IterativeSolvers_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/IterativeSolvers COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/KroneckerProduct/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_KroneckerProduct_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_KroneckerProduct_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/KroneckerProduct COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #openmvo 2 | 主要是学习[rpg_svo](https://github.com/uzh-rpg/rpg_svo) 根据代码和论文进行一步步的分析。 3 | 具体见博客[fengbing.net](http://www.fengbing.net) 4 | 5 | ##环境 6 | 测试环境:windows8.1下vs2013以及ubuntu14.04 g++4.8.4 7 | 运行前请先安装[g2o](https://github.com/RainerKuemmerle/g2o.git),具体参考其README 8 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/MoreVectorization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_MoreVectorization_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_MoreVectorization_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/MoreVectorization COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Eigen) 2 | add_subdirectory(doc EXCLUDE_FROM_ALL) 3 | if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) 4 | add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest 5 | else() 6 | add_subdirectory(test EXCLUDE_FROM_ALL) 7 | endif() 8 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/NonLinearOptimization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_NonLinearOptimization_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_NonLinearOptimization_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/NonLinearOptimization COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_Core_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_Core_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/Core COMPONENT Devel 6 | ) 7 | 8 | ADD_SUBDIRECTORY(products) 9 | ADD_SUBDIRECTORY(util) 10 | ADD_SUBDIRECTORY(arch) 11 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB Eigen_src_subdirectories "*") 2 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 3 | foreach(f ${Eigen_src_subdirectories}) 4 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" ) 5 | add_subdirectory(${f}) 6 | endif() 7 | endforeach() 8 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Array: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ARRAY_MODULE_H 2 | #define EIGEN_ARRAY_MODULE_H 3 | 4 | // include Core first to handle Eigen2 support macros 5 | #include "Core" 6 | 7 | #ifndef EIGEN2_SUPPORT 8 | #error The Eigen/Array header does no longer exist in Eigen3. All that functionality has moved to Eigen/Core. 9 | #endif 10 | 11 | #endif // EIGEN_ARRAY_MODULE_H 12 | -------------------------------------------------------------------------------- /libs/base/src/base_precomp.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 文件: base-precomp.cpp 3 | * 时间: 2014/11/21 20:26 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 7 | * 说明: 预编译头 8 | * 9 | ********************************************************************************/ 10 | #include "base_precomp.h" // 预编译头 11 | 12 | -------------------------------------------------------------------------------- /parse-files/version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef OPENMVO_VERSION_H 2 | #define OPENMVO_VERSION_H 3 | 4 | const char OPENMVO_version_str[] = "${CMAKE_OPENMVO_COMPLETE_NAME}"; 5 | 6 | /** Version number of package in hexadecimal: 7 | * A three digits version code, eg. 0.5.1 -> 0x051, 1.2.0 -> 0x120 8 | */ 9 | #define OPENMVO_VERSION ${CMAKE_OPENMVO_VERSION_CODE} 10 | 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_WARNINGS_DISABLED 2 | #undef EIGEN_WARNINGS_DISABLED 3 | 4 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 5 | #ifdef _MSC_VER 6 | #pragma warning( pop ) 7 | #elif defined __INTEL_COMPILER 8 | #pragma warning pop 9 | #elif defined __clang__ 10 | #pragma clang diagnostic pop 11 | #endif 12 | #endif 13 | 14 | #endif // EIGEN_WARNINGS_DISABLED 15 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixExponential.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(3,3); 11 | A << 0, -pi/4, 0, 12 | pi/4, 0, 0, 13 | 0, 0, 0; 14 | std::cout << "The matrix A is:\n" << A << "\n\n"; 15 | std::cout << "The matrix exponential of A is:\n" << A.exp() << "\n\n"; 16 | } 17 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixPower.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | Matrix3d A; 10 | A << cos(1), -sin(1), 0, 11 | sin(1), cos(1), 0, 12 | 0 , 0 , 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n" 14 | "The matrix power A^(pi/4) is:\n" << A.pow(pi/4) << std::endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(AutoDiff) 2 | ADD_SUBDIRECTORY(BVH) 3 | ADD_SUBDIRECTORY(FFT) 4 | ADD_SUBDIRECTORY(IterativeSolvers) 5 | ADD_SUBDIRECTORY(MatrixFunctions) 6 | ADD_SUBDIRECTORY(MoreVectorization) 7 | ADD_SUBDIRECTORY(NonLinearOptimization) 8 | ADD_SUBDIRECTORY(NumericalDiff) 9 | ADD_SUBDIRECTORY(Polynomials) 10 | ADD_SUBDIRECTORY(Skyline) 11 | ADD_SUBDIRECTORY(SparseExtra) 12 | ADD_SUBDIRECTORY(KroneckerProduct) 13 | ADD_SUBDIRECTORY(Splines) 14 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixLogarithm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | using std::sqrt; 9 | MatrixXd A(3,3); 10 | A << 0.5*sqrt(2), -0.5*sqrt(2), 0, 11 | 0.5*sqrt(2), 0.5*sqrt(2), 0, 12 | 0, 0, 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix logarithm of A is:\n" << A.log() << "\n"; 15 | } 16 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Eigen_HEADERS AdolcForward BVH IterativeSolvers MatrixFunctions MoreVectorization AutoDiff AlignedVector3 Polynomials 2 | FFT NonLinearOptimization SparseExtra IterativeSolvers 3 | NumericalDiff Skyline MPRealSupport OpenGLSupport KroneckerProduct Splines LevenbergMarquardt 4 | ) 5 | 6 | install(FILES 7 | ${Eigen_HEADERS} 8 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen COMPONENT Devel 9 | ) 10 | 11 | add_subdirectory(src) 12 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixPower_optimal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | Matrix4cd A = Matrix4cd::Random(); 9 | MatrixPower Apow(A); 10 | 11 | std::cout << "The matrix A is:\n" << A << "\n\n" 12 | "A^3.1 is:\n" << Apow(3.1) << "\n\n" 13 | "A^3.3 is:\n" << Apow(3.3) << "\n\n" 14 | "A^3.7 is:\n" << Apow(3.7) << "\n\n" 15 | "A^3.9 is:\n" << Apow(3.9) << std::endl; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixSquareRoot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(2,2); 11 | A << cos(pi/3), -sin(pi/3), 12 | sin(pi/3), cos(pi/3); 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix square root of A is:\n" << A.sqrt() << "\n\n"; 15 | std::cout << "The square of the last matrix is:\n" << A.sqrt() * A.sqrt() << "\n"; 16 | } 17 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | std::complex expfn(std::complex x, int) 7 | { 8 | return std::exp(x); 9 | } 10 | 11 | int main() 12 | { 13 | const double pi = std::acos(-1.0); 14 | 15 | MatrixXd A(3,3); 16 | A << 0, -pi/4, 0, 17 | pi/4, 0, 0, 18 | 0, 0, 0; 19 | 20 | std::cout << "The matrix A is:\n" << A << "\n\n"; 21 | std::cout << "The matrix exponential of A is:\n" 22 | << A.matrixFunction(expfn) << "\n\n"; 23 | } 24 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixSine.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXd A = MatrixXd::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXd sinA = A.sin(); 12 | std::cout << "sin(A) = \n" << sinA << "\n\n"; 13 | 14 | MatrixXd cosA = A.cos(); 15 | std::cout << "cos(A) = \n" << cosA << "\n\n"; 16 | 17 | // The matrix functions satisfy sin^2(A) + cos^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "sin^2(A) + cos^2(A) = \n" << sinA*sinA + cosA*cosA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/MatrixSinh.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXf A = MatrixXf::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXf sinhA = A.sinh(); 12 | std::cout << "sinh(A) = \n" << sinhA << "\n\n"; 13 | 14 | MatrixXf coshA = A.cosh(); 15 | std::cout << "cosh(A) = \n" << coshA << "\n\n"; 16 | 17 | // The matrix functions satisfy cosh^2(A) - sinh^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "cosh^2(A) - sinh^2(A) = \n" << coshA*coshA - sinhA*sinhA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /libs/base/include/openmvo/utils/boost_join.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 文件: boost_join.h 3 | * 时间: 2014/11/21 22:55 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 7 | * 说明: 构建类似boost的名称的dll 8 | * 9 | ********************************************************************************/ 10 | #ifndef OPENMVO_UTILS_BOOST_JOIN_H_ 11 | #define OPENMVO_UTILS_BOOST_JOIN_H_ 12 | 13 | #ifndef BOOST_JOIN 14 | #define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y ) 15 | #define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y) 16 | #define BOOST_DO_JOIN2( X, Y ) X##Y 17 | #endif 18 | 19 | #endif // OPENMVO_UTILS_BOOST_JOIN_H_ 20 | -------------------------------------------------------------------------------- /libs/base/include/base_precomp.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 文件: base_precomp.h 3 | * 时间: 2014/11/13 9:23 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 7 | * 说明: 基础模块的预编译头 8 | * 9 | ********************************************************************************/ 10 | 11 | #ifndef OPENMVO_BASE_BASE_PRECOMP_H_ 12 | #define OPENMVO_BASE_BASE_PRECOMP_H_ 13 | 14 | #include 15 | #include 16 | 17 | #if OPENMVO_ENABLE_PRECOMPILED_HEADERS //预编译头 18 | 19 | #include //TODO:测试的时候用一下,以后删除,下面有空整理一下debug的输出 20 | 21 | #endif 22 | 23 | #endif // OPENMVO_BASE_BASE_PRECOMP_H_ 24 | 25 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Householder: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_HOUSEHOLDER_MODULE_H 2 | #define EIGEN_HOUSEHOLDER_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Householder_Module Householder module 9 | * This module provides Householder transformations. 10 | * 11 | * \code 12 | * #include 13 | * \endcode 14 | */ 15 | 16 | #include "src/Householder/Householder.h" 17 | #include "src/Householder/HouseholderSequence.h" 18 | #include "src/Householder/BlockHouseholder.h" 19 | 20 | #include "src/Core/util/ReenableStupidWarnings.h" 21 | 22 | #endif // EIGEN_HOUSEHOLDER_MODULE_H 23 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 24 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | add_subdirectory(src) 20 | -------------------------------------------------------------------------------- /cmake/UtilsMacros.cmake: -------------------------------------------------------------------------------- 1 | # Based on: http://www.cmake.org/pipermail/cmake/2008-February/020114.html 2 | # Usage: list_subdirectories(the_list_is_returned_here C:/cwd) 3 | macro(list_subdirectories retval curdir) 4 | file(GLOB sub_dir RELATIVE ${curdir} *) 5 | set(list_of_dirs "") 6 | foreach(dir ${sub_dir}) 7 | string(SUBSTRING ${dir} 0 1 dir1st) 8 | if(IS_DIRECTORY ${curdir}/${dir} AND NOT ${dir1st} STREQUAL "." AND NOT ${dir} STREQUAL "CMakeFiles") 9 | set(list_of_dirs ${list_of_dirs} ${dir}) 10 | endif(IS_DIRECTORY ${curdir}/${dir} AND NOT ${dir1st} STREQUAL "." AND NOT ${dir} STREQUAL "CMakeFiles") 11 | endforeach(dir) 12 | set(${retval} ${list_of_dirs}) 13 | endmacro(list_subdirectories) 14 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Sparse: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSE_MODULE_H 2 | #define EIGEN_SPARSE_MODULE_H 3 | 4 | /** \defgroup Sparse_Module Sparse meta-module 5 | * 6 | * Meta-module including all related modules: 7 | * - \ref SparseCore_Module 8 | * - \ref OrderingMethods_Module 9 | * - \ref SparseCholesky_Module 10 | * - \ref SparseLU_Module 11 | * - \ref SparseQR_Module 12 | * - \ref IterativeLinearSolvers_Module 13 | * 14 | * \code 15 | * #include 16 | * \endcode 17 | */ 18 | 19 | #include "SparseCore" 20 | #include "OrderingMethods" 21 | #include "SparseCholesky" 22 | #include "SparseLU" 23 | #include "SparseQR" 24 | #include "IterativeLinearSolvers" 25 | 26 | #endif // EIGEN_SPARSE_MODULE_H 27 | 28 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/MoreVectorization: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_MOREVECTORIZATION_MODULE_H 10 | #define EIGEN_MOREVECTORIZATION_MODULE_H 11 | 12 | #include 13 | 14 | namespace Eigen { 15 | 16 | /** 17 | * \defgroup MoreVectorization More vectorization module 18 | */ 19 | 20 | } 21 | 22 | #include "src/MoreVectorization/MathFunctions.h" 23 | 24 | #endif // EIGEN_MOREVECTORIZATION_MODULE_H 25 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/Macros.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_MACROS_H 11 | #define EIGEN2_MACROS_H 12 | 13 | #define ei_assert eigen_assert 14 | #define ei_internal_assert eigen_internal_assert 15 | 16 | #define EIGEN_ALIGN_128 EIGEN_ALIGN16 17 | 18 | #define EIGEN_ARCH_WANTS_ALIGNMENT EIGEN_ALIGN_STATICALLY 19 | 20 | #endif // EIGEN2_MACROS_H 21 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/PolynomialUtils1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | Vector4d roots = Vector4d::Random(); 10 | cout << "Roots: " << roots.transpose() << endl; 11 | Eigen::Matrix polynomial; 12 | roots_to_monicPolynomial( roots, polynomial ); 13 | cout << "Polynomial: "; 14 | for( int i=0; i<4; ++i ){ cout << polynomial[i] << ".x^" << i << "+ "; } 15 | cout << polynomial[4] << ".x^4" << endl; 16 | Vector4d evaluation; 17 | for( int i=0; i<4; ++i ){ 18 | evaluation[i] = poly_eval( polynomial, roots[i] ); } 19 | cout << "Evaluation of the polynomial at the roots: " << evaluation.transpose(); 20 | } 21 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Jacobi: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_JACOBI_MODULE_H 2 | #define EIGEN_JACOBI_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Jacobi_Module Jacobi module 9 | * This module provides Jacobi and Givens rotations. 10 | * 11 | * \code 12 | * #include 13 | * \endcode 14 | * 15 | * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: 16 | * - MatrixBase::applyOnTheLeft() 17 | * - MatrixBase::applyOnTheRight(). 18 | */ 19 | 20 | #include "src/Jacobi/Jacobi.h" 21 | 22 | #include "src/Core/util/ReenableStupidWarnings.h" 23 | 24 | #endif // EIGEN_JACOBI_MODULE_H 25 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 26 | 27 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/Overview.dox: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | /** \mainpage Eigen's unsupported modules 4 | 5 | This is the API documentation for Eigen's unsupported modules. 6 | 7 | These modules are contributions from various users. They are provided "as is", without any support. 8 | 9 | Click on the \e Modules tab at the top of this page to get a list of all unsupported modules. 10 | 11 | Don't miss the official Eigen documentation. 12 | 13 | */ 14 | 15 | /* 16 | 17 | \defgroup Unsupported_modules Unsupported modules 18 | 19 | The unsupported modules are contributions from various users. They are 20 | provided "as is", without any support. Nevertheless, some of them are 21 | subject to be included in Eigen in the future. 22 | 23 | */ 24 | 25 | } 26 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/QtAlignedMalloc: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EIGEN_QTMALLOC_MODULE_H 3 | #define EIGEN_QTMALLOC_MODULE_H 4 | 5 | #include "Core" 6 | 7 | #if (!EIGEN_MALLOC_ALREADY_ALIGNED) 8 | 9 | #include "src/Core/util/DisableStupidWarnings.h" 10 | 11 | void *qMalloc(size_t size) 12 | { 13 | return Eigen::internal::aligned_malloc(size); 14 | } 15 | 16 | void qFree(void *ptr) 17 | { 18 | Eigen::internal::aligned_free(ptr); 19 | } 20 | 21 | void *qRealloc(void *ptr, size_t size) 22 | { 23 | void* newPtr = Eigen::internal::aligned_malloc(size); 24 | memcpy(newPtr, ptr, size); 25 | Eigen::internal::aligned_free(ptr); 26 | return newPtr; 27 | } 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif 32 | 33 | #endif // EIGEN_QTMALLOC_MODULE_H 34 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 35 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/MetisSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_METISSUPPORT_MODULE_H 2 | #define EIGEN_METISSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | extern "C" { 9 | #include 10 | } 11 | 12 | 13 | /** \ingroup Support_modules 14 | * \defgroup MetisSupport_Module MetisSupport module 15 | * 16 | * \code 17 | * #include 18 | * \endcode 19 | * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). 20 | * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink 21 | */ 22 | 23 | 24 | #include "src/MetisSupport/MetisSupport.h" 25 | 26 | #include "src/Core/util/ReenableStupidWarnings.h" 27 | 28 | #endif // EIGEN_METISSUPPORT_MODULE_H 29 | -------------------------------------------------------------------------------- /apps/pipeline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(../../cmake/AssureCMakeRootFile.cmake) # 确保在根目录的cmake中添加 2 | 3 | PROJECT(pipeline) 4 | 5 | ADD_EXECUTABLE(pipeline 6 | pipeline.cpp) 7 | 8 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/base/include) 9 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/mvo/include) 10 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/3rdparty/sophus/include) 11 | 12 | SET(OPENMVO_LINKER_LIBS 13 | openmvo_base 14 | openmvo_mvo 15 | fast 16 | sophus) 17 | 18 | TARGET_LINK_LIBRARIES(pipeline ${OPENMVO_LINKER_LIBS} ${OpenCV_LIBS}) 19 | 20 | 21 | 22 | # 设置将项目添加到包中 23 | if(ENABLE_SOLUTION_FOLDERS) 24 | set_target_properties(pipeline PROPERTIES FOLDER "app") 25 | else(ENABLE_SOLUTION_FOLDERS) 26 | SET_TARGET_PROPERTIES(pipeline PROPERTIES PROJECT_LABEL "(app) pipeline") 27 | endif(ENABLE_SOLUTION_FOLDERS) 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /cmake/script_create_version_h.cmake: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- 2 | # Update the library version header file 3 | # FILE_TO_PARSE="SRC/include/openmvo/OPENMVO_version.h.in" 4 | # TARGET_FILE ="OPENMVO_version.h" 5 | # ---------------------------------------------------------------------------- 6 | SET(CMAKE_OPENMVO_COMPLETE_NAME "OPENMVO ${CMAKE_OPENMVO_VERSION_NUMBER_MAJOR}.${CMAKE_OPENMVO_VERSION_NUMBER_MINOR}.${CMAKE_OPENMVO_VERSION_NUMBER_PATCH}") 7 | # Build a three digits version code, eg. 0.5.1 -> 051, 1.2.0 -> 120 8 | SET(CMAKE_OPENMVO_VERSION_CODE "0x${CMAKE_OPENMVO_VERSION_NUMBER_MAJOR}${CMAKE_OPENMVO_VERSION_NUMBER_MINOR}${CMAKE_OPENMVO_VERSION_NUMBER_PATCH}") 9 | 10 | CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/parse-files/version.h.in" "${OPENMVO_CONFIG_FILE_INCLUDE_DIR}/openmvo/version.h") 11 | 12 | -------------------------------------------------------------------------------- /cmake/FilterFileLists.cmake: -------------------------------------------------------------------------------- 1 | # Example of usage: 2 | # REMOVE_MATCHING_FILES_FROM_LIST(".*_LIN.cpp" my_srcs) 3 | # 4 | 5 | MACRO(REMOVE_MATCHING_FILES_FROM_LIST match_expr lst_files) 6 | SET(lst_files_aux "") 7 | FOREACH(FIL ${${lst_files}}) 8 | IF(NOT ${FIL} MATCHES "${match_expr}") 9 | SET(lst_files_aux "${lst_files_aux}" "${FIL}") 10 | ENDIF(NOT ${FIL} MATCHES "${match_expr}") 11 | ENDFOREACH(FIL) 12 | SET(${lst_files} ${lst_files_aux}) 13 | ENDMACRO(REMOVE_MATCHING_FILES_FROM_LIST) 14 | 15 | MACRO(KEEP_MATCHING_FILES_FROM_LIST match_expr lst_files) 16 | SET(lst_files_aux "") 17 | FOREACH(FIL ${${lst_files}}) 18 | IF(${FIL} MATCHES "${match_expr}") 19 | SET(lst_files_aux "${lst_files_aux}" "${FIL}") 20 | ENDIF(${FIL} MATCHES "${match_expr}") 21 | ENDFOREACH(FIL) 22 | SET(${lst_files} ${lst_files_aux}) 23 | ENDMACRO(KEEP_MATCHING_FILES_FROM_LIST) 24 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/LeastSquares: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_REGRESSION_MODULE_H 2 | #define EIGEN_REGRESSION_MODULE_H 3 | 4 | #ifndef EIGEN2_SUPPORT 5 | #error LeastSquares is only available in Eigen2 support mode (define EIGEN2_SUPPORT) 6 | #endif 7 | 8 | // exclude from normal eigen3-only documentation 9 | #ifdef EIGEN2_SUPPORT 10 | 11 | #include "Core" 12 | 13 | #include "src/Core/util/DisableStupidWarnings.h" 14 | 15 | #include "Eigenvalues" 16 | #include "Geometry" 17 | 18 | /** \defgroup LeastSquares_Module LeastSquares module 19 | * This module provides linear regression and related features. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | 26 | #include "src/Eigen2Support/LeastSquares.h" 27 | 28 | #include "src/Core/util/ReenableStupidWarnings.h" 29 | 30 | #endif // EIGEN2_SUPPORT 31 | 32 | #endif // EIGEN_REGRESSION_MODULE_H 33 | -------------------------------------------------------------------------------- /apps/depth_filter_app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(../../cmake/AssureCMakeRootFile.cmake) 2 | PROJECT(depth_filter_app) 3 | 4 | ADD_EXECUTABLE(depth_filter_app 5 | depth_filter_app.cpp) 6 | 7 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/base/include) 8 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/mvo/include) 9 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/3rdparty/sophus/include) 10 | 11 | SET(OPENMVO_LINKER_LIBS 12 | openmvo_base 13 | openmvo_mvo 14 | fast 15 | sophus) 16 | 17 | TARGET_LINK_LIBRARIES(depth_filter_app ${OPENMVO_LINKER_LIBS} ${OpenCV_LIBS}) 18 | 19 | 20 | if(ENABLE_SOLUTION_FOLDERS) 21 | set_target_properties(depth_filter_app PROPERTIES FOLDER "app") 22 | else(ENABLE_SOLUTION_FOLDERS) 23 | SET_TARGET_PROPERTIES(depth_filter_app PROPERTIES PROJECT_LABEL "(app) depth_filter_app") 24 | endif(ENABLE_SOLUTION_FOLDERS) 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /apps/image_align/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(../../cmake/AssureCMakeRootFile.cmake) # 确保在根目录的cmake中添加 2 | 3 | PROJECT(image_align) 4 | 5 | ADD_EXECUTABLE(image_align 6 | image_align.cpp) 7 | 8 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/base/include) 9 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/mvo/include) 10 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/3rdparty/sophus/include) 11 | 12 | SET(OPENMVO_LINKER_LIBS 13 | openmvo_base 14 | openmvo_mvo 15 | fast 16 | sophus) 17 | 18 | TARGET_LINK_LIBRARIES(image_align ${OPENMVO_LINKER_LIBS} ${OpenCV_LIBS}) 19 | 20 | 21 | 22 | # 设置将项目添加到包中 23 | if(ENABLE_SOLUTION_FOLDERS) 24 | set_target_properties(image_align PROPERTIES FOLDER "app") 25 | else(ENABLE_SOLUTION_FOLDERS) 26 | SET_TARGET_PROPERTIES(image_align PROPERTIES PROJECT_LABEL "(app) image_align") 27 | endif(ENABLE_SOLUTION_FOLDERS) 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/StdDeque: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDDEQUE_MODULE_H 12 | #define EIGEN_STDDEQUE_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdDeque.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDDEQUE_MODULE_H 28 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/StdVector: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // Copyright (C) 2009 Hauke Heibel 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_STDVECTOR_MODULE_H 12 | #define EIGEN_STDVECTOR_MODULE_H 13 | 14 | #include "Core" 15 | #include 16 | 17 | #if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ 18 | 19 | #define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) 20 | 21 | #else 22 | 23 | #include "src/StlSupport/StdVector.h" 24 | 25 | #endif 26 | 27 | #endif // EIGEN_STDVECTOR_MODULE_H 28 | -------------------------------------------------------------------------------- /apps/pose_and_structure/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(../../cmake/AssureCMakeRootFile.cmake) 2 | PROJECT(pose_and_structure) 3 | 4 | ADD_EXECUTABLE(pose_and_structure 5 | pose_and_structure.cpp) 6 | 7 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/base/include) 8 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/mvo/include) 9 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/3rdparty/sophus/include) 10 | 11 | SET(OPENMVO_LINKER_LIBS 12 | openmvo_base 13 | openmvo_mvo 14 | fast 15 | sophus) 16 | 17 | TARGET_LINK_LIBRARIES(pose_and_structure ${OPENMVO_LINKER_LIBS} ${OpenCV_LIBS}) 18 | 19 | 20 | if(ENABLE_SOLUTION_FOLDERS) 21 | set_target_properties(pose_and_structure PROPERTIES FOLDER "app") 22 | else(ENABLE_SOLUTION_FOLDERS) 23 | SET_TARGET_PROPERTIES(pose_and_structure PROPERTIES PROJECT_LABEL "(app) pose_and_structure") 24 | endif(ENABLE_SOLUTION_FOLDERS) 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /apps/reprojection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(../../cmake/AssureCMakeRootFile.cmake) # 确保在根目录的cmake中添加 2 | 3 | PROJECT(reprojection) 4 | 5 | ADD_EXECUTABLE(reprojection 6 | reprojection.cpp) 7 | 8 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/base/include) 9 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/mvo/include) 10 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/3rdparty/sophus/include) 11 | 12 | SET(OPENMVO_LINKER_LIBS 13 | openmvo_base 14 | openmvo_mvo 15 | fast 16 | sophus) 17 | 18 | TARGET_LINK_LIBRARIES(reprojection ${OPENMVO_LINKER_LIBS} ${OpenCV_LIBS}) 19 | 20 | 21 | 22 | # 设置将项目添加到包中 23 | if(ENABLE_SOLUTION_FOLDERS) 24 | set_target_properties(reprojection PROPERTIES FOLDER "app") 25 | else(ENABLE_SOLUTION_FOLDERS) 26 | SET_TARGET_PROPERTIES(reprojection PROPERTIES PROJECT_LABEL "(app) reprojection") 27 | endif(ENABLE_SOLUTION_FOLDERS) 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB examples_SRCS "*.cpp") 2 | 3 | ADD_CUSTOM_TARGET(unsupported_examples) 4 | 5 | INCLUDE_DIRECTORIES(../../../unsupported ../../../unsupported/test) 6 | 7 | FOREACH(example_src ${examples_SRCS}) 8 | GET_FILENAME_COMPONENT(example ${example_src} NAME_WE) 9 | ADD_EXECUTABLE(example_${example} ${example_src}) 10 | if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) 11 | target_link_libraries(example_${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 12 | endif() 13 | GET_TARGET_PROPERTY(example_executable 14 | example_${example} LOCATION) 15 | ADD_CUSTOM_COMMAND( 16 | TARGET example_${example} 17 | POST_BUILD 18 | COMMAND ${example_executable} 19 | ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out 20 | ) 21 | ADD_DEPENDENCIES(unsupported_examples example_${example}) 22 | ENDFOREACH(example_src) 23 | -------------------------------------------------------------------------------- /apps/feature_detector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(../../cmake/AssureCMakeRootFile.cmake) # 确保在根目录的cmake中添加 2 | 3 | PROJECT(feature_detector) 4 | 5 | ADD_EXECUTABLE(feature_detector 6 | feature_detector.cpp) 7 | 8 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/base/include) 9 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/mvo/include) 10 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/3rdparty/sophus/include) 11 | 12 | SET(OPENMVO_LINKER_LIBS 13 | openmvo_base 14 | openmvo_mvo 15 | fast 16 | sophus) 17 | 18 | TARGET_LINK_LIBRARIES(feature_detector ${OPENMVO_LINKER_LIBS} ${OpenCV_LIBS}) 19 | 20 | 21 | 22 | # 设置将项目添加到包中 23 | if(ENABLE_SOLUTION_FOLDERS) 24 | set_target_properties(feature_detector PROPERTIES FOLDER "app") 25 | else(ENABLE_SOLUTION_FOLDERS) 26 | SET_TARGET_PROPERTIES(feature_detector PROPERTIES PROJECT_LABEL "(app) feature_detector") 27 | endif(ENABLE_SOLUTION_FOLDERS) 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /apps/initial_position/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE(../../cmake/AssureCMakeRootFile.cmake) # 确保在根目录的cmake中添加 2 | 3 | PROJECT(initial_position) 4 | 5 | ADD_EXECUTABLE(initial_position 6 | initial_position.cpp) 7 | 8 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/base/include) 9 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/libs/mvo/include) 10 | INCLUDE_DIRECTORIES(${OPENMVO_INCLUDE_DIR}/3rdparty/sophus/include) 11 | 12 | SET(OPENMVO_LINKER_LIBS 13 | openmvo_base 14 | openmvo_mvo 15 | fast 16 | sophus) 17 | 18 | TARGET_LINK_LIBRARIES(initial_position ${OPENMVO_LINKER_LIBS} ${OpenCV_LIBS}) 19 | 20 | 21 | 22 | # 设置将项目添加到包中 23 | if(ENABLE_SOLUTION_FOLDERS) 24 | set_target_properties(initial_position PROPERTIES FOLDER "app") 25 | else(ENABLE_SOLUTION_FOLDERS) 26 | SET_TARGET_PROPERTIES(initial_position PROPERTIES PROJECT_LABEL "(app) initial_position") 27 | endif(ENABLE_SOLUTION_FOLDERS) 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLESKY_MODULE_H 2 | #define EIGEN_CHOLESKY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup Cholesky_Module Cholesky module 9 | * 10 | * 11 | * 12 | * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. 13 | * Those decompositions are accessible via the following MatrixBase methods: 14 | * - MatrixBase::llt(), 15 | * - MatrixBase::ldlt() 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | */ 21 | 22 | #include "src/misc/Solve.h" 23 | #include "src/Cholesky/LLT.h" 24 | #include "src/Cholesky/LDLT.h" 25 | #ifdef EIGEN_USE_LAPACKE 26 | #include "src/Cholesky/LLT_MKL.h" 27 | #endif 28 | 29 | #include "src/Core/util/ReenableStupidWarnings.h" 30 | 31 | #endif // EIGEN_CHOLESKY_MODULE_H 32 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 33 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/PardisoSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_PARDISOSUPPORT_MODULE_H 2 | #define EIGEN_PARDISOSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include 9 | 10 | #include 11 | 12 | /** \ingroup Support_modules 13 | * \defgroup PardisoSupport_Module PardisoSupport module 14 | * 15 | * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | * 21 | * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. 22 | * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. 23 | * 24 | */ 25 | 26 | #include "src/PardisoSupport/PardisoSupport.h" 27 | 28 | #include "src/Core/util/ReenableStupidWarnings.h" 29 | 30 | #endif // EIGEN_PARDISOSUPPORT_MODULE_H 31 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/Splines: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 20010-2011 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPLINES_MODULE_H 11 | #define EIGEN_SPLINES_MODULE_H 12 | 13 | namespace Eigen 14 | { 15 | /** 16 | * \defgroup Splines_Module Spline and spline fitting module 17 | * 18 | * This module provides a simple multi-dimensional spline class while 19 | * offering most basic functionality to fit a spline to point sets. 20 | * 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | } 26 | 27 | #include "src/Splines/SplineFwd.h" 28 | #include "src/Splines/Spline.h" 29 | #include "src/Splines/SplineFitting.h" 30 | 31 | #endif // EIGEN_SPLINES_MODULE_H 32 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/SVD: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SVD_MODULE_H 2 | #define EIGEN_SVD_MODULE_H 3 | 4 | #include "QR" 5 | #include "Householder" 6 | #include "Jacobi" 7 | 8 | #include "src/Core/util/DisableStupidWarnings.h" 9 | 10 | /** \defgroup SVD_Module SVD module 11 | * 12 | * 13 | * 14 | * This module provides SVD decomposition for matrices (both real and complex). 15 | * This decomposition is accessible via the following MatrixBase method: 16 | * - MatrixBase::jacobiSvd() 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "src/misc/Solve.h" 24 | #include "src/SVD/JacobiSVD.h" 25 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 26 | #include "src/SVD/JacobiSVD_MKL.h" 27 | #endif 28 | #include "src/SVD/UpperBidiagonalization.h" 29 | 30 | #ifdef EIGEN2_SUPPORT 31 | #include "src/Eigen2Support/SVD.h" 32 | #endif 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_SVD_MODULE_H 37 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 38 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/ArpackSupport: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_ARPACKSUPPORT_MODULE_H 10 | #define EIGEN_ARPACKSUPPORT_MODULE_H 11 | 12 | #include 13 | 14 | #include 15 | 16 | /** \defgroup ArpackSupport_Module Arpack support module 17 | * 18 | * This module provides a wrapper to Arpack, a library for sparse eigenvalue decomposition. 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | */ 24 | 25 | #include 26 | #include "src/Eigenvalues/ArpackSelfAdjointEigenSolver.h" 27 | 28 | #include 29 | 30 | #endif // EIGEN_ARPACKSUPPORT_MODULE_H 31 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 32 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/KroneckerProduct: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_KRONECKER_PRODUCT_MODULE_H 10 | #define EIGEN_KRONECKER_PRODUCT_MODULE_H 11 | 12 | #include "../../Eigen/Core" 13 | 14 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 15 | 16 | namespace Eigen { 17 | 18 | /** 19 | * \defgroup KroneckerProduct_Module KroneckerProduct module 20 | * 21 | * This module contains an experimental Kronecker product implementation. 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | */ 27 | 28 | } // namespace Eigen 29 | 30 | #include "src/KroneckerProduct/KroneckerTensorProduct.h" 31 | 32 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 33 | 34 | #endif // EIGEN_KRONECKER_PRODUCT_MODULE_H 35 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/SPQRSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPQRSUPPORT_MODULE_H 2 | #define EIGEN_SPQRSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "SuiteSparseQR.hpp" 9 | 10 | /** \ingroup Support_modules 11 | * \defgroup SPQRSupport_Module SuiteSparseQR module 12 | * 13 | * This module provides an interface to the SPQR library, which is part of the suitesparse package. 14 | * 15 | * \code 16 | * #include 17 | * \endcode 18 | * 19 | * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). 20 | * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules 21 | * 22 | */ 23 | 24 | #include "src/misc/Solve.h" 25 | #include "src/misc/SparseSolve.h" 26 | #include "src/CholmodSupport/CholmodSupport.h" 27 | #include "src/SPQRSupport/SuiteSparseQRSupport.h" 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/Skyline: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_SKYLINE_MODULE_H 10 | #define EIGEN_SKYLINE_MODULE_H 11 | 12 | 13 | #include "Eigen/Core" 14 | 15 | #include "Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | /** 23 | * \defgroup Skyline_Module Skyline module 24 | * 25 | * 26 | * 27 | * 28 | */ 29 | 30 | #include "src/Skyline/SkylineUtil.h" 31 | #include "src/Skyline/SkylineMatrixBase.h" 32 | #include "src/Skyline/SkylineStorage.h" 33 | #include "src/Skyline/SkylineMatrix.h" 34 | #include "src/Skyline/SkylineInplaceLU.h" 35 | #include "src/Skyline/SkylineProduct.h" 36 | 37 | #include "Eigen/src/Core/util/ReenableStupidWarnings.h" 38 | 39 | #endif // EIGEN_SKYLINE_MODULE_H 40 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SparseCore/SparseFuzzy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_FUZZY_H 11 | #define EIGEN_SPARSE_FUZZY_H 12 | 13 | // template 14 | // template 15 | // bool SparseMatrixBase::isApprox( 16 | // const OtherDerived& other, 17 | // typename NumTraits::Real prec 18 | // ) const 19 | // { 20 | // const typename internal::nested::type nested(derived()); 21 | // const typename internal::nested::type otherNested(other.derived()); 22 | // return (nested - otherNested).cwise().abs2().sum() 23 | // <= prec * prec * (std::min)(nested.cwise().abs2().sum(), otherNested.cwise().abs2().sum()); 24 | // } 25 | 26 | #endif // EIGEN_SPARSE_FUZZY_H 27 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/QR: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_QR_MODULE_H 2 | #define EIGEN_QR_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "Cholesky" 9 | #include "Jacobi" 10 | #include "Householder" 11 | 12 | /** \defgroup QR_Module QR module 13 | * 14 | * 15 | * 16 | * This module provides various QR decompositions 17 | * This module also provides some MatrixBase methods, including: 18 | * - MatrixBase::qr(), 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | */ 24 | 25 | #include "src/misc/Solve.h" 26 | #include "src/QR/HouseholderQR.h" 27 | #include "src/QR/FullPivHouseholderQR.h" 28 | #include "src/QR/ColPivHouseholderQR.h" 29 | #ifdef EIGEN_USE_LAPACKE 30 | #include "src/QR/HouseholderQR_MKL.h" 31 | #include "src/QR/ColPivHouseholderQR_MKL.h" 32 | #endif 33 | 34 | #ifdef EIGEN2_SUPPORT 35 | #include "src/Eigen2Support/QR.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #ifdef EIGEN2_SUPPORT 41 | #include "Eigenvalues" 42 | #endif 43 | 44 | #endif // EIGEN_QR_MODULE_H 45 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 46 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/SparseQR: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSEQR_MODULE_H 2 | #define EIGEN_SPARSEQR_MODULE_H 3 | 4 | #include "SparseCore" 5 | #include "OrderingMethods" 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup SparseQR_Module SparseQR module 9 | * \brief Provides QR decomposition for sparse matrices 10 | * 11 | * This module provides a simplicial version of the left-looking Sparse QR decomposition. 12 | * The columns of the input matrix should be reordered to limit the fill-in during the 13 | * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. 14 | * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list 15 | * of built-in and external ordering methods. 16 | * 17 | * \code 18 | * #include 19 | * \endcode 20 | * 21 | * 22 | */ 23 | 24 | #include "src/misc/Solve.h" 25 | #include "src/misc/SparseSolve.h" 26 | 27 | #include "OrderingMethods" 28 | #include "src/SparseCore/SparseColEtree.h" 29 | #include "src/SparseQR/SparseQR.h" 30 | 31 | #include "src/Core/util/ReenableStupidWarnings.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/LU: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_LU_MODULE_H 2 | #define EIGEN_LU_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** \defgroup LU_Module LU module 9 | * This module includes %LU decomposition and related notions such as matrix inversion and determinant. 10 | * This module defines the following MatrixBase methods: 11 | * - MatrixBase::inverse() 12 | * - MatrixBase::determinant() 13 | * 14 | * \code 15 | * #include 16 | * \endcode 17 | */ 18 | 19 | #include "src/misc/Solve.h" 20 | #include "src/misc/Kernel.h" 21 | #include "src/misc/Image.h" 22 | #include "src/LU/FullPivLU.h" 23 | #include "src/LU/PartialPivLU.h" 24 | #ifdef EIGEN_USE_LAPACKE 25 | #include "src/LU/PartialPivLU_MKL.h" 26 | #endif 27 | #include "src/LU/Determinant.h" 28 | #include "src/LU/Inverse.h" 29 | 30 | #if defined EIGEN_VECTORIZE_SSE 31 | #include "src/LU/arch/Inverse_SSE.h" 32 | #endif 33 | 34 | #ifdef EIGEN2_SUPPORT 35 | #include "src/Eigen2Support/LU.h" 36 | #endif 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_LU_MODULE_H 41 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 42 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/SVD/doneInBDCSVD.txt: -------------------------------------------------------------------------------- 1 | This unsupported package is about a divide and conquer algorithm to compute SVD. 2 | 3 | The implementation follows as closely as possible the following reference paper : 4 | http://www.cs.yale.edu/publications/techreports/tr933.pdf 5 | 6 | The code documentation uses the same names for variables as the reference paper. The code, deflation included, is 7 | working but there are a few things that could be optimised as explained in the TODOBdsvd. 8 | 9 | In the code comments were put at the line where would be the third step of the algorithm so one could simply add the call 10 | of a function doing the last part of the algorithm and that would not require any knowledge of the part we implemented. 11 | 12 | In the TODOBdcsvd we explain what is the main difficulty of the last part and suggest a reference paper to help solve it. 13 | 14 | The implemented has trouble with fixed size matrices. 15 | 16 | In the actual implementation, it returns matrices of zero when ask to do a svd on an int matrix. 17 | 18 | 19 | Paper for the third part: 20 | http://www.stat.uchicago.edu/~lekheng/courses/302/classics/greengard-rokhlin.pdf 21 | 22 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/SVD: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SVD_MODULE_H 2 | #define EIGEN_SVD_MODULE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 9 | 10 | /** \defgroup SVD_Module SVD module 11 | * 12 | * 13 | * 14 | * This module provides SVD decomposition for matrices (both real and complex). 15 | * This decomposition is accessible via the following MatrixBase method: 16 | * - MatrixBase::jacobiSvd() 17 | * 18 | * \code 19 | * #include 20 | * \endcode 21 | */ 22 | 23 | #include "../../Eigen/src/misc/Solve.h" 24 | #include "../../Eigen/src/SVD/UpperBidiagonalization.h" 25 | #include "src/SVD/SVDBase.h" 26 | #include "src/SVD/JacobiSVD.h" 27 | #include "src/SVD/BDCSVD.h" 28 | #if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) 29 | #include "../../Eigen/src/SVD/JacobiSVD_MKL.h" 30 | #endif 31 | 32 | #ifdef EIGEN2_SUPPORT 33 | #include "../../Eigen/src/Eigen2Support/SVD.h" 34 | #endif 35 | 36 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 37 | 38 | #endif // EIGEN_SVD_MODULE_H 39 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 40 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/matrix_square_root.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Jitse Niesen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "matrix_functions.h" 11 | 12 | template 13 | void testMatrixSqrt(const MatrixType& m) 14 | { 15 | MatrixType A; 16 | generateTestMatrix::run(A, m.rows()); 17 | MatrixType sqrtA = A.sqrt(); 18 | VERIFY_IS_APPROX(sqrtA * sqrtA, A); 19 | } 20 | 21 | void test_matrix_square_root() 22 | { 23 | for (int i = 0; i < g_repeat; i++) { 24 | CALL_SUBTEST_1(testMatrixSqrt(Matrix3cf())); 25 | CALL_SUBTEST_2(testMatrixSqrt(MatrixXcd(12,12))); 26 | CALL_SUBTEST_3(testMatrixSqrt(Matrix4f())); 27 | CALL_SUBTEST_4(testMatrixSqrt(Matrix(9, 9))); 28 | CALL_SUBTEST_5(testMatrixSqrt(Matrix())); 29 | CALL_SUBTEST_5(testMatrixSqrt(Matrix,1,1>())); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libs/base/include/openmvo/utils/noncopyable.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 文件: noncopyable.h 3 | * 时间: 2014/11/05 23:57 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 7 | * 说明: 不能复制类的基类,有任何的复制操作,编译器会报错.继承这个类就不能有复制操作 8 | * 主要用于单例等模式,具体可以参考boost::noncopyable 9 | * 10 | * 11 | ********************************************************************************/ 12 | #ifndef OPENMVO_BASE_NONCOPYABLE_H_ 13 | #define OPENMVO_BASE_NONCOPYABLE_H_ 14 | 15 | #include 16 | 17 | namespace mvo 18 | { 19 | /** 不能复制类的基类,有任何的复制操作,编译器会报错.将深浅复制都写入父类的私有方法中,这样派生的子类也无法实现深浅复制 20 | * 例子: 21 | * 22 | * \code 23 | * class MyFancyClass : public openmvo::utils::CNoncopyable 24 | * { 25 | * public: 26 | * ... 27 | * }; 28 | * \endcode 29 | * \ingroup openmvo_base_grp 30 | */ 31 | class BASE_IMPEXP Noncopyable 32 | { 33 | protected: 34 | Noncopyable() {} 35 | ~Noncopyable() {} 36 | private: 37 | Noncopyable(const Noncopyable &); // 这不需要再其它地方实现 38 | Noncopyable& operator =(const Noncopyable &); // 这不需要再其它地方实现 39 | }; // End of class def. 40 | 41 | } // end of namespace 42 | 43 | #endif // OPENMVO_BASE_NONCOPYABLE_H_ 44 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/AutoDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_AUTODIFF_MODULE 11 | #define EIGEN_AUTODIFF_MODULE 12 | 13 | namespace Eigen { 14 | 15 | /** 16 | * \defgroup AutoDiff_Module Auto Diff module 17 | * 18 | * This module features forward automatic differentation via a simple 19 | * templated scalar type wrapper AutoDiffScalar. 20 | * 21 | * Warning : this should NOT be confused with numerical differentiation, which 22 | * is a different method and has its own module in Eigen : \ref NumericalDiff_Module. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | */ 28 | //@{ 29 | 30 | } 31 | 32 | #include "src/AutoDiff/AutoDiffScalar.h" 33 | // #include "src/AutoDiff/AutoDiffVector.h" 34 | #include "src/AutoDiff/AutoDiffJacobian.h" 35 | 36 | namespace Eigen { 37 | //@} 38 | } 39 | 40 | #endif // EIGEN_AUTODIFF_MODULE 41 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | // TODO : move this to GivensQR once there's such a thing in Eigen 6 | 7 | template 8 | void r1mpyq(DenseIndex m, DenseIndex n, Scalar *a, const std::vector > &v_givens, const std::vector > &w_givens) 9 | { 10 | typedef DenseIndex Index; 11 | 12 | /* apply the first set of givens rotations to a. */ 13 | for (Index j = n-2; j>=0; --j) 14 | for (Index i = 0; i 5 | 6 | namespace fast 7 | { 8 | 9 | using ::std::vector; 10 | 11 | struct fast_xy 12 | { 13 | short x, y; 14 | fast_xy(short x_, short y_) : x(x_), y(y_) {} 15 | }; 16 | 17 | typedef unsigned char fast_byte; 18 | 19 | /// SSE2 optimized version of the corner 10 20 | void fast_corner_detect_10_sse2(const fast_byte* img, int imgWidth, int imgHeight, int widthStep, short barrier, vector& corners); 21 | 22 | /// plain C++ version of the corner 10 23 | void fast_corner_detect_10(const fast_byte* img, int imgWidth, int imgHeight, int widthStep, short barrier, vector& corners); 24 | 25 | /// corner score 10 26 | void fast_corner_score_10(const fast_byte* img, const int img_stride, const vector& corners, const int threshold, vector& scores); 27 | 28 | /// Nonmax Suppression on a 3x3 Window 29 | void fast_nonmax_3x3(const vector& corners, const vector& scores, vector& nonmax_corners); 30 | 31 | /// NEON optimized version of the corner 9 32 | void fast_corner_detect_9_neon(const fast_byte* img, int imgWidth, int imgHeight, int widthStep, short barrier, vector& corners); 33 | 34 | } // namespace fast 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /cmake/script_create_config_h.cmake: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------------------- 2 | # UPDATE CONFIG FILES & SCRIPTS: 3 | # 4 | # CONFIGURE_FILE(InputFile OutputFile [COPYONLY] [ESCAPE_QUOTES] [@ONLY]) 5 | # If @ONLY is specified, only variables of the form @VAR@ will be 6 | # replaces and ${VAR} will be ignored. 7 | # 8 | # A directory will be created for each platform so the "config.h" file is 9 | # not overwritten if cmake generates code in the same path. 10 | # ---------------------------------------------------------------------------- 11 | SET(OPENMVO_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/openmvo_config/" CACHE PATH "Where to create the platform-dependant config.h") 12 | IF(UNIX) 13 | SET(OPENMVO_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/openmvo_config/unix/" ) 14 | ENDIF(UNIX) 15 | IF (WIN32) 16 | SET(OPENMVO_CONFIG_FILE_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/openmvo_config/win32/") 17 | ENDIF(WIN32) 18 | 19 | FILE(MAKE_DIRECTORY "${OPENMVO_CONFIG_FILE_INCLUDE_DIR}") 20 | FILE(MAKE_DIRECTORY "${OPENMVO_CONFIG_FILE_INCLUDE_DIR}/openmvo") 21 | 22 | #MESSAGE(STATUS "Parsing 'config.h.in'") 23 | CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/parse-files/config.h.in" "${OPENMVO_CONFIG_FILE_INCLUDE_DIR}/openmvo/config.h") 24 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/LevenbergMarquardt: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_LEVENBERGMARQUARDT_MODULE 11 | #define EIGEN_LEVENBERGMARQUARDT_MODULE 12 | 13 | // #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include 21 | 22 | /** 23 | * \defgroup LevenbergMarquardt_Module Levenberg-Marquardt module 24 | * 25 | * \code 26 | * #include 27 | * \endcode 28 | * 29 | * 30 | */ 31 | 32 | #include "Eigen/SparseCore" 33 | #ifndef EIGEN_PARSED_BY_DOXYGEN 34 | 35 | #include "src/LevenbergMarquardt/LMqrsolv.h" 36 | #include "src/LevenbergMarquardt/LMcovar.h" 37 | #include "src/LevenbergMarquardt/LMpar.h" 38 | 39 | #endif 40 | 41 | #include "src/LevenbergMarquardt/LevenbergMarquardt.h" 42 | #include "src/LevenbergMarquardt/LMonestep.h" 43 | 44 | 45 | #endif // EIGEN_LEVENBERGMARQUARDT_MODULE 46 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/UmfPackSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_UMFPACKSUPPORT_MODULE_H 2 | #define EIGEN_UMFPACKSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | extern "C" { 9 | #include 10 | } 11 | 12 | /** \ingroup Support_modules 13 | * \defgroup UmfPackSupport_Module UmfPackSupport module 14 | * 15 | * This module provides an interface to the UmfPack library which is part of the suitesparse package. 16 | * It provides the following factorization class: 17 | * - class UmfPackLU: a multifrontal sequential LU factorization. 18 | * 19 | * \code 20 | * #include 21 | * \endcode 22 | * 23 | * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. 24 | * The dependencies depend on how umfpack has been compiled. 25 | * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. 26 | * 27 | */ 28 | 29 | #include "src/misc/Solve.h" 30 | #include "src/misc/SparseSolve.h" 31 | 32 | #include "src/UmfPackSupport/UmfPackSupport.h" 33 | 34 | #include "src/Core/util/ReenableStupidWarnings.h" 35 | 36 | #endif // EIGEN_UMFPACKSUPPORT_MODULE_H 37 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/gmres.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Gael Guennebaud 5 | // Copyright (C) 2012 Kolja Brix 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #include "../../test/sparse_solver.h" 12 | #include 13 | 14 | template void test_gmres_T() 15 | { 16 | GMRES, DiagonalPreconditioner > gmres_colmajor_diag; 17 | GMRES, IdentityPreconditioner > gmres_colmajor_I; 18 | GMRES, IncompleteLUT > gmres_colmajor_ilut; 19 | //GMRES, SSORPreconditioner > gmres_colmajor_ssor; 20 | 21 | CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_diag) ); 22 | // CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_I) ); 23 | CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ilut) ); 24 | //CALL_SUBTEST( check_sparse_square_solving(gmres_colmajor_ssor) ); 25 | } 26 | 27 | void test_gmres() 28 | { 29 | CALL_SUBTEST_1(test_gmres_T()); 30 | CALL_SUBTEST_2(test_gmres_T >()); 31 | } 32 | -------------------------------------------------------------------------------- /libs/mvo/src/config.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 文件名: config 3 | * 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 时间: 2015/8/14 7 | * 8 | * 说明: 所有参数设置参考rpg_svo(https://github.com/uzh-rpg/rpg_svo) 9 | *************************************************************************/ 10 | #include 11 | 12 | namespace mvo { 13 | 14 | Config::Config() : 15 | trace_name("mvo"), 16 | trace_dir("./tmp"), 17 | n_pyr_levels(3), 18 | use_imu(false), 19 | core_n_kfs(3), 20 | map_scale(1.0), 21 | grid_size(25), 22 | init_min_disparity(50.0), 23 | init_min_tracked(50), 24 | init_min_inliers(40), 25 | klt_max_level(4), 26 | klt_min_level(1), 27 | reproj_thresh(2.0), 28 | poseoptim_thresh(2.0), 29 | poseoptim_num_iter(10), 30 | structureoptim_max_pts(20), 31 | structureoptim_num_iter(5), 32 | loba_thresh(2.0), 33 | loba_robust_huber_width(1.0), 34 | loba_num_iter(0), 35 | kfselect_mindist(0.12), 36 | triang_min_corner_score(20.0), 37 | triang_half_patch_size(4), 38 | subpix_n_iter(10), 39 | max_n_kfs(0), 40 | img_imu_delay(0.0), 41 | max_fts(150), 42 | quality_min_fts(50), 43 | quality_max_drop_fts(40) 44 | {} 45 | 46 | Config& Config::getInstance() 47 | { 48 | static Config instance; // 第一次使用时初始化,并保证销毁 49 | return instance; 50 | } 51 | 52 | } // namespace mvo 53 | 54 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/snippets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB snippets_SRCS "*.cpp") 2 | 3 | ADD_CUSTOM_TARGET(unsupported_snippets) 4 | 5 | FOREACH(snippet_src ${snippets_SRCS}) 6 | GET_FILENAME_COMPONENT(snippet ${snippet_src} NAME_WE) 7 | SET(compile_snippet_target compile_${snippet}) 8 | SET(compile_snippet_src ${compile_snippet_target}.cpp) 9 | FILE(READ ${snippet_src} snippet_source_code) 10 | CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/snippets/compile_snippet.cpp.in 11 | ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}) 12 | ADD_EXECUTABLE(${compile_snippet_target} 13 | ${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}) 14 | if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) 15 | target_link_libraries(${compile_snippet_target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 16 | endif() 17 | GET_TARGET_PROPERTY(compile_snippet_executable 18 | ${compile_snippet_target} LOCATION) 19 | ADD_CUSTOM_COMMAND( 20 | TARGET ${compile_snippet_target} 21 | POST_BUILD 22 | COMMAND ${compile_snippet_executable} 23 | ARGS >${CMAKE_CURRENT_BINARY_DIR}/${snippet}.out 24 | ) 25 | ADD_DEPENDENCIES(unsupported_snippets ${compile_snippet_target}) 26 | set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src} 27 | PROPERTIES OBJECT_DEPENDS ${snippet_src}) 28 | ENDFOREACH(snippet_src) 29 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/dgmres.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Gael Guennebaud 5 | // Copyright (C) 2012 desire Nuentsa 13 | 14 | template void test_dgmres_T() 15 | { 16 | DGMRES, DiagonalPreconditioner > dgmres_colmajor_diag; 17 | DGMRES, IdentityPreconditioner > dgmres_colmajor_I; 18 | DGMRES, IncompleteLUT > dgmres_colmajor_ilut; 19 | //GMRES, SSORPreconditioner > dgmres_colmajor_ssor; 20 | 21 | CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_diag) ); 22 | // CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_I) ); 23 | CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ilut) ); 24 | //CALL_SUBTEST( check_sparse_square_solving(dgmres_colmajor_ssor) ); 25 | } 26 | 27 | void test_dgmres() 28 | { 29 | CALL_SUBTEST_1(test_dgmres_T()); 30 | CALL_SUBTEST_2(test_dgmres_T >()); 31 | } 32 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/minres.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Gael Guennebaud 5 | // Copyright (C) 2012 Giacomo Po 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | #include 11 | 12 | #include "../../test/sparse_solver.h" 13 | #include 14 | 15 | template void test_minres_T() 16 | { 17 | MINRES, Lower, DiagonalPreconditioner > minres_colmajor_diag; 18 | MINRES, Lower, IdentityPreconditioner > minres_colmajor_I; 19 | // MINRES, Lower, IncompleteLUT > minres_colmajor_ilut; 20 | //minres, SSORPreconditioner > minres_colmajor_ssor; 21 | 22 | CALL_SUBTEST( check_sparse_square_solving(minres_colmajor_diag) ); 23 | CALL_SUBTEST( check_sparse_spd_solving(minres_colmajor_I) ); 24 | // CALL_SUBTEST( check_sparse_square_solving(minres_colmajor_ilut) ); 25 | //CALL_SUBTEST( check_sparse_square_solving(minres_colmajor_ssor) ); 26 | } 27 | 28 | void test_minres() 29 | { 30 | CALL_SUBTEST_1(test_minres_T()); 31 | // CALL_SUBTEST_2(test_minres_T >()); 32 | } 33 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_EIGENVALUES_MODULE_H 2 | #define EIGEN_EIGENVALUES_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "Cholesky" 9 | #include "Jacobi" 10 | #include "Householder" 11 | #include "LU" 12 | #include "Geometry" 13 | 14 | /** \defgroup Eigenvalues_Module Eigenvalues module 15 | * 16 | * 17 | * 18 | * This module mainly provides various eigenvalue solvers. 19 | * This module also provides some MatrixBase methods, including: 20 | * - MatrixBase::eigenvalues(), 21 | * - MatrixBase::operatorNorm() 22 | * 23 | * \code 24 | * #include 25 | * \endcode 26 | */ 27 | 28 | #include "src/Eigenvalues/Tridiagonalization.h" 29 | #include "src/Eigenvalues/RealSchur.h" 30 | #include "src/Eigenvalues/EigenSolver.h" 31 | #include "src/Eigenvalues/SelfAdjointEigenSolver.h" 32 | #include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" 33 | #include "src/Eigenvalues/HessenbergDecomposition.h" 34 | #include "src/Eigenvalues/ComplexSchur.h" 35 | #include "src/Eigenvalues/ComplexEigenSolver.h" 36 | #include "src/Eigenvalues/RealQZ.h" 37 | #include "src/Eigenvalues/GeneralizedEigenSolver.h" 38 | #include "src/Eigenvalues/MatrixBaseEigenvalues.h" 39 | #ifdef EIGEN_USE_LAPACKE 40 | #include "src/Eigenvalues/RealSchur_MKL.h" 41 | #include "src/Eigenvalues/ComplexSchur_MKL.h" 42 | #include "src/Eigenvalues/SelfAdjointEigenSolver_MKL.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_EIGENVALUES_MODULE_H 48 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 49 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/IterativeSolvers: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_ITERATIVE_SOLVERS_MODULE_H 11 | #define EIGEN_ITERATIVE_SOLVERS_MODULE_H 12 | 13 | #include 14 | 15 | /** 16 | * \defgroup IterativeSolvers_Module Iterative solvers module 17 | * This module aims to provide various iterative linear and non linear solver algorithms. 18 | * It currently provides: 19 | * - a constrained conjugate gradient 20 | * - a Householder GMRES implementation 21 | * \code 22 | * #include 23 | * \endcode 24 | */ 25 | //@{ 26 | 27 | #include "../../Eigen/src/misc/Solve.h" 28 | #include "../../Eigen/src/misc/SparseSolve.h" 29 | 30 | #ifndef EIGEN_MPL2_ONLY 31 | #include "src/IterativeSolvers/IterationController.h" 32 | #include "src/IterativeSolvers/ConstrainedConjGrad.h" 33 | #endif 34 | 35 | #include "src/IterativeSolvers/IncompleteLU.h" 36 | #include "../../Eigen/Jacobi" 37 | #include "../../Eigen/Householder" 38 | #include "src/IterativeSolvers/GMRES.h" 39 | #include "src/IterativeSolvers/IncompleteCholesky.h" 40 | //#include "src/IterativeSolvers/SSORPreconditioner.h" 41 | #include "src/IterativeSolvers/MINRES.h" 42 | 43 | //@} 44 | 45 | #endif // EIGEN_ITERATIVE_SOLVERS_MODULE_H 46 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | template 6 | void rwupdt( 7 | Matrix< Scalar, Dynamic, Dynamic > &r, 8 | const Matrix< Scalar, Dynamic, 1> &w, 9 | Matrix< Scalar, Dynamic, 1> &b, 10 | Scalar alpha) 11 | { 12 | typedef DenseIndex Index; 13 | 14 | const Index n = r.cols(); 15 | eigen_assert(r.rows()>=n); 16 | std::vector > givens(n); 17 | 18 | /* Local variables */ 19 | Scalar temp, rowj; 20 | 21 | /* Function Body */ 22 | for (Index j = 0; j < n; ++j) { 23 | rowj = w[j]; 24 | 25 | /* apply the previous transformations to */ 26 | /* r(i,j), i=0,1,...,j-1, and to w(j). */ 27 | for (Index i = 0; i < j; ++i) { 28 | temp = givens[i].c() * r(i,j) + givens[i].s() * rowj; 29 | rowj = -givens[i].s() * r(i,j) + givens[i].c() * rowj; 30 | r(i,j) = temp; 31 | } 32 | 33 | /* determine a givens rotation which eliminates w(j). */ 34 | givens[j].makeGivens(-r(j,j), rowj); 35 | 36 | if (rowj == 0.) 37 | continue; // givens[j] is identity 38 | 39 | /* apply the current transformation to r(j,j), b(j), and alpha. */ 40 | r(j,j) = givens[j].c() * r(j,j) + givens[j].s() * rowj; 41 | temp = givens[j].c() * b[j] + givens[j].s() * alpha; 42 | alpha = -givens[j].s() * b[j] + givens[j].c() * alpha; 43 | b[j] = temp; 44 | } 45 | } 46 | 47 | } // end namespace internal 48 | 49 | } // end namespace Eigen 50 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2013 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSECHOLESKY_MODULE_H 11 | #define EIGEN_SPARSECHOLESKY_MODULE_H 12 | 13 | #include "SparseCore" 14 | #include "OrderingMethods" 15 | 16 | #include "src/Core/util/DisableStupidWarnings.h" 17 | 18 | /** 19 | * \defgroup SparseCholesky_Module SparseCholesky module 20 | * 21 | * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. 22 | * Those decompositions are accessible via the following classes: 23 | * - SimplicialLLt, 24 | * - SimplicialLDLt 25 | * 26 | * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #ifdef EIGEN_MPL2_ONLY 34 | #error The SparseCholesky module has nothing to offer in MPL2 only mode 35 | #endif 36 | 37 | #include "src/misc/Solve.h" 38 | #include "src/misc/SparseSolve.h" 39 | #include "src/SparseCholesky/SimplicialCholesky.h" 40 | 41 | #ifndef EIGEN_MPL2_ONLY 42 | #include "src/SparseCholesky/SimplicialCholesky_impl.h" 43 | #endif 44 | 45 | #include "src/Core/util/ReenableStupidWarnings.h" 46 | 47 | #endif // EIGEN_SPARSECHOLESKY_MODULE_H 48 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/PaStiXSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_PASTIXSUPPORT_MODULE_H 2 | #define EIGEN_PASTIXSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include 9 | extern "C" { 10 | #include 11 | #include 12 | } 13 | 14 | #ifdef complex 15 | #undef complex 16 | #endif 17 | 18 | /** \ingroup Support_modules 19 | * \defgroup PaStiXSupport_Module PaStiXSupport module 20 | * 21 | * This module provides an interface to the PaSTiX library. 22 | * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. 23 | * It provides the two following main factorization classes: 24 | * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. 25 | * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. 26 | * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | * 32 | * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. 33 | * The dependencies depend on how PaSTiX has been compiled. 34 | * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. 35 | * 36 | */ 37 | 38 | #include "src/misc/Solve.h" 39 | #include "src/misc/SparseSolve.h" 40 | 41 | #include "src/PaStiXSupport/PaStiXSupport.h" 42 | 43 | 44 | #include "src/Core/util/ReenableStupidWarnings.h" 45 | 46 | #endif // EIGEN_PASTIXSUPPORT_MODULE_H 47 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/SparseExtra: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSE_EXTRA_MODULE_H 11 | #define EIGEN_SPARSE_EXTRA_MODULE_H 12 | 13 | #include "../../Eigen/Sparse" 14 | 15 | #include "../../Eigen/src/Core/util/DisableStupidWarnings.h" 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #ifdef EIGEN_GOOGLEHASH_SUPPORT 26 | #include 27 | #endif 28 | 29 | /** 30 | * \defgroup SparseExtra_Module SparseExtra module 31 | * 32 | * This module contains some experimental features extending the sparse module. 33 | * 34 | * \code 35 | * #include 36 | * \endcode 37 | */ 38 | 39 | 40 | #include "../../Eigen/src/misc/Solve.h" 41 | #include "../../Eigen/src/misc/SparseSolve.h" 42 | 43 | #include "src/SparseExtra/DynamicSparseMatrix.h" 44 | #include "src/SparseExtra/BlockOfDynamicSparseMatrix.h" 45 | #include "src/SparseExtra/RandomSetter.h" 46 | 47 | #include "src/SparseExtra/MarketIO.h" 48 | 49 | #if !defined(_WIN32) 50 | #include 51 | #include "src/SparseExtra/MatrixMarketIterator.h" 52 | #endif 53 | 54 | #include "../../Eigen/src/Core/util/ReenableStupidWarnings.h" 55 | 56 | #endif // EIGEN_SPARSE_EXTRA_MODULE_H 57 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/TriangularSolver.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TRIANGULAR_SOLVER2_H 11 | #define EIGEN_TRIANGULAR_SOLVER2_H 12 | 13 | namespace Eigen { 14 | 15 | const unsigned int UnitDiagBit = UnitDiag; 16 | const unsigned int SelfAdjointBit = SelfAdjoint; 17 | const unsigned int UpperTriangularBit = Upper; 18 | const unsigned int LowerTriangularBit = Lower; 19 | 20 | const unsigned int UpperTriangular = Upper; 21 | const unsigned int LowerTriangular = Lower; 22 | const unsigned int UnitUpperTriangular = UnitUpper; 23 | const unsigned int UnitLowerTriangular = UnitLower; 24 | 25 | template 26 | template 27 | typename ExpressionType::PlainObject 28 | Flagged::solveTriangular(const MatrixBase& other) const 29 | { 30 | return m_matrix.template triangularView().solve(other.derived()); 31 | } 32 | 33 | template 34 | template 35 | void Flagged::solveTriangularInPlace(const MatrixBase& other) const 36 | { 37 | m_matrix.template triangularView().solveInPlace(other.derived()); 38 | } 39 | 40 | } // end namespace Eigen 41 | 42 | #endif // EIGEN_TRIANGULAR_SOLVER2_H 43 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SparseCore/SparseRedux.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSEREDUX_H 11 | #define EIGEN_SPARSEREDUX_H 12 | 13 | namespace Eigen { 14 | 15 | template 16 | typename internal::traits::Scalar 17 | SparseMatrixBase::sum() const 18 | { 19 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 20 | Scalar res(0); 21 | for (Index j=0; j 28 | typename internal::traits >::Scalar 29 | SparseMatrix<_Scalar,_Options,_Index>::sum() const 30 | { 31 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 32 | return Matrix::Map(&m_data.value(0), m_data.size()).sum(); 33 | } 34 | 35 | template 36 | typename internal::traits >::Scalar 37 | SparseVector<_Scalar,_Options,_Index>::sum() const 38 | { 39 | eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); 40 | return Matrix::Map(&m_data.value(0), m_data.size()).sum(); 41 | } 42 | 43 | } // end namespace Eigen 44 | 45 | #endif // EIGEN_SPARSEREDUX_H 46 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/IterativeLinearSolvers: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 2 | #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 3 | 4 | #include "SparseCore" 5 | #include "OrderingMethods" 6 | 7 | #include "src/Core/util/DisableStupidWarnings.h" 8 | 9 | /** 10 | * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module 11 | * 12 | * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse. 13 | * Those solvers are accessible via the following classes: 14 | * - ConjugateGradient for selfadjoint (hermitian) matrices, 15 | * - BiCGSTAB for general square matrices. 16 | * 17 | * These iterative solvers are associated with some preconditioners: 18 | * - IdentityPreconditioner - not really useful 19 | * - DiagonalPreconditioner - also called JAcobi preconditioner, work very well on diagonal dominant matrices. 20 | * - IncompleteILUT - incomplete LU factorization with dual thresholding 21 | * 22 | * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport. 23 | * 24 | * \code 25 | * #include 26 | * \endcode 27 | */ 28 | 29 | #include "src/misc/Solve.h" 30 | #include "src/misc/SparseSolve.h" 31 | 32 | #include "src/IterativeLinearSolvers/IterativeSolverBase.h" 33 | #include "src/IterativeLinearSolvers/BasicPreconditioners.h" 34 | #include "src/IterativeLinearSolvers/ConjugateGradient.h" 35 | #include "src/IterativeLinearSolvers/BiCGSTAB.h" 36 | #include "src/IterativeLinearSolvers/IncompleteLUT.h" 37 | 38 | #include "src/Core/util/ReenableStupidWarnings.h" 39 | 40 | #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H 41 | -------------------------------------------------------------------------------- /libs/base/include/openmvo/utils/file_reader.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENMVO_UTILS_FILE_READER_H_ 2 | #define OPENMVO_UTILS_FILE_READER_H_ 3 | 4 | #include 5 | #include 6 | 7 | namespace mvo 8 | { 9 | 10 | /** 11 | * 实体类的读取,实体类必须含有以下操作 12 | * std::istream& operator >>(std::istream&, Entry&); 13 | */ 14 | template 15 | class FileReader 16 | { 17 | public: 18 | FileReader(const std::string& file) : 19 | has_entry_(false), 20 | file_(file), 21 | file_stream_(file.c_str()) 22 | {} 23 | 24 | virtual ~FileReader() 25 | { 26 | file_stream_.close(); 27 | } 28 | 29 | void skip(int num_lines) 30 | { 31 | for (int idx = 0; idx < num_lines; ++idx) 32 | { 33 | if (!file_stream_.good()) continue; 34 | file_stream_.ignore(1024, '\n'); 35 | assert(file_stream_.gcount() < 1024); 36 | } 37 | } 38 | 39 | void skipComments() 40 | { 41 | while (file_stream_.good() && file_stream_.peek() == '#') 42 | skip(1); 43 | } 44 | 45 | /// 读取下一个实体类 46 | bool next() 47 | { 48 | if (file_stream_.good() && !file_stream_.eof()) 49 | { 50 | file_stream_ >> entry_; 51 | has_entry_ = true; 52 | return true; 53 | } 54 | return false; 55 | } 56 | 57 | /// 一次性读取所有的实体类 58 | void readAllEntries(std::vector& entries) 59 | { 60 | if (!hasEntry()) next(); 61 | do 62 | entries.push_back(entry()); 63 | while (next()); 64 | } 65 | 66 | /// 得到当前的实体类 67 | const Entry& entry() const { return entry_; } 68 | Entry& entry() { return entry_; } 69 | 70 | /// 确定第一个实体类是否已经被读取 71 | const bool& hasEntry() const { return has_entry_; } 72 | 73 | private: 74 | bool has_entry_; 75 | std::string file_; 76 | std::ifstream file_stream_; 77 | Entry entry_; 78 | }; 79 | 80 | } // end namespace mvo 81 | 82 | 83 | #endif // OPENMVO_UTILS_FILE_READER_H_ 84 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/Memory.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2011 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_MEMORY_H 11 | #define EIGEN2_MEMORY_H 12 | 13 | namespace Eigen { 14 | 15 | inline void* ei_aligned_malloc(size_t size) { return internal::aligned_malloc(size); } 16 | inline void ei_aligned_free(void *ptr) { internal::aligned_free(ptr); } 17 | inline void* ei_aligned_realloc(void *ptr, size_t new_size, size_t old_size) { return internal::aligned_realloc(ptr, new_size, old_size); } 18 | inline void* ei_handmade_aligned_malloc(size_t size) { return internal::handmade_aligned_malloc(size); } 19 | inline void ei_handmade_aligned_free(void *ptr) { internal::handmade_aligned_free(ptr); } 20 | 21 | template inline void* ei_conditional_aligned_malloc(size_t size) 22 | { 23 | return internal::conditional_aligned_malloc(size); 24 | } 25 | template inline void ei_conditional_aligned_free(void *ptr) 26 | { 27 | internal::conditional_aligned_free(ptr); 28 | } 29 | template inline void* ei_conditional_aligned_realloc(void* ptr, size_t new_size, size_t old_size) 30 | { 31 | return internal::conditional_aligned_realloc(ptr, new_size, old_size); 32 | } 33 | 34 | template inline T* ei_aligned_new(size_t size) 35 | { 36 | return internal::aligned_new(size); 37 | } 38 | template inline void ei_aligned_delete(T *ptr, size_t size) 39 | { 40 | return internal::aligned_delete(ptr, size); 41 | } 42 | 43 | } // end namespace Eigen 44 | 45 | #endif // EIGEN2_MACROS_H 46 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/Geometry: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_GEOMETRY_MODULE_H 2 | #define EIGEN_GEOMETRY_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include "SVD" 9 | #include "LU" 10 | #include 11 | 12 | #ifndef M_PI 13 | #define M_PI 3.14159265358979323846 14 | #endif 15 | 16 | /** \defgroup Geometry_Module Geometry module 17 | * 18 | * 19 | * 20 | * This module provides support for: 21 | * - fixed-size homogeneous transformations 22 | * - translation, scaling, 2D and 3D rotations 23 | * - quaternions 24 | * - \ref MatrixBase::cross() "cross product" 25 | * - \ref MatrixBase::unitOrthogonal() "orthognal vector generation" 26 | * - some linear components: parametrized-lines and hyperplanes 27 | * 28 | * \code 29 | * #include 30 | * \endcode 31 | */ 32 | 33 | #include "src/Geometry/OrthoMethods.h" 34 | #include "src/Geometry/EulerAngles.h" 35 | 36 | #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS 37 | #include "src/Geometry/Homogeneous.h" 38 | #include "src/Geometry/RotationBase.h" 39 | #include "src/Geometry/Rotation2D.h" 40 | #include "src/Geometry/Quaternion.h" 41 | #include "src/Geometry/AngleAxis.h" 42 | #include "src/Geometry/Transform.h" 43 | #include "src/Geometry/Translation.h" 44 | #include "src/Geometry/Scaling.h" 45 | #include "src/Geometry/Hyperplane.h" 46 | #include "src/Geometry/ParametrizedLine.h" 47 | #include "src/Geometry/AlignedBox.h" 48 | #include "src/Geometry/Umeyama.h" 49 | 50 | #if defined EIGEN_VECTORIZE_SSE 51 | #include "src/Geometry/arch/Geometry_SSE.h" 52 | #endif 53 | #endif 54 | 55 | #ifdef EIGEN2_SUPPORT 56 | #include "src/Eigen2Support/Geometry/All.h" 57 | #endif 58 | 59 | #include "src/Core/util/ReenableStupidWarnings.h" 60 | 61 | #endif // EIGEN_GEOMETRY_MODULE_H 62 | /* vim: set filetype=cpp et sw=2 ts=2 ai: */ 63 | 64 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/CholmodSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_CHOLMODSUPPORT_MODULE_H 2 | #define EIGEN_CHOLMODSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | extern "C" { 9 | #include 10 | } 11 | 12 | /** \ingroup Support_modules 13 | * \defgroup CholmodSupport_Module CholmodSupport module 14 | * 15 | * This module provides an interface to the Cholmod library which is part of the suitesparse package. 16 | * It provides the two following main factorization classes: 17 | * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. 18 | * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). 19 | * 20 | * For the sake of completeness, this module also propose the two following classes: 21 | * - class CholmodSimplicialLLT 22 | * - class CholmodSimplicialLDLT 23 | * Note that these classes does not bring any particular advantage compared to the built-in 24 | * SimplicialLLT and SimplicialLDLT factorization classes. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | * 30 | * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. 31 | * The dependencies depend on how cholmod has been compiled. 32 | * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. 33 | * 34 | */ 35 | 36 | #include "src/misc/Solve.h" 37 | #include "src/misc/SparseSolve.h" 38 | 39 | #include "src/CholmodSupport/CholmodSupport.h" 40 | 41 | 42 | #include "src/Core/util/ReenableStupidWarnings.h" 43 | 44 | #endif // EIGEN_CHOLMODSUPPORT_MODULE_H 45 | 46 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/matrix_functions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009-2011 Jitse Niesen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | #include 12 | 13 | template ::Scalar>::IsComplex> 14 | struct generateTestMatrix; 15 | 16 | // for real matrices, make sure none of the eigenvalues are negative 17 | template 18 | struct generateTestMatrix 19 | { 20 | static void run(MatrixType& result, typename MatrixType::Index size) 21 | { 22 | MatrixType mat = MatrixType::Random(size, size); 23 | EigenSolver es(mat); 24 | typename EigenSolver::EigenvalueType eivals = es.eigenvalues(); 25 | for (typename MatrixType::Index i = 0; i < size; ++i) { 26 | if (eivals(i).imag() == 0 && eivals(i).real() < 0) 27 | eivals(i) = -eivals(i); 28 | } 29 | result = (es.eigenvectors() * eivals.asDiagonal() * es.eigenvectors().inverse()).real(); 30 | } 31 | }; 32 | 33 | // for complex matrices, any matrix is fine 34 | template 35 | struct generateTestMatrix 36 | { 37 | static void run(MatrixType& result, typename MatrixType::Index size) 38 | { 39 | result = MatrixType::Random(size, size); 40 | } 41 | }; 42 | 43 | template 44 | double relerr(const MatrixBase& A, const MatrixBase& B) 45 | { 46 | return std::sqrt((A - B).cwiseAbs2().sum() / (std::min)(A.cwiseAbs2().sum(), B.cwiseAbs2().sum())); 47 | } 48 | -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/link_pragmas.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 文件: link_pragmas.h 3 | * 时间: 2014/11/13 21:55 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 7 | * 说明: 用于定义库的导入导出 8 | * 9 | ********************************************************************************/ 10 | #ifndef OPENMVO_MVO_LINK_PRAGMAS_H_ 11 | #define OPENMVO_MVO_LINK_PRAGMAS_H_ 12 | 13 | #include 14 | #include 15 | 16 | // ** 这边很重要! ** 17 | // 在每一个OPENMVO库中,我们要找到下列进行替换为当前项目: 18 | // OPENMVO_XXX_EXPORT, OPENMVO_XXX_IMPORT 19 | // MVO_IMPEXP, OPENMVO_xxx_EXPORTS 20 | 21 | // 通过下面宏的定义,我们可以对编译好的lib直接引用,不需要在链接器中添加名称: 22 | #if !defined(OPENMVO_MVO_EXPORTS) && (defined(_MSC_VER)) 23 | # if defined(_DEBUG) 24 | # pragma comment (lib, BOOST_JOIN( BOOST_JOIN("openmvo_mvo",OPENMVO_VERSION_POSTFIX),"d.lib")) 25 | # else 26 | # pragma comment (lib, BOOST_JOIN( BOOST_JOIN("openmvo_mvo",OPENMVO_VERSION_POSTFIX),".lib")) 27 | # endif 28 | #endif 29 | 30 | /* 定义dll的导入导出 31 | */ 32 | #if defined(OPENMVO_OS_WINDOWS) 33 | 34 | # if defined(_MSC_VER) 35 | # define OPENMVO_MVO_EXPORT __declspec(dllexport) 36 | # define OPENMVO_MVO_IMPORT __declspec(dllimport) 37 | # else /* 编译器不支持__declspec() */ 38 | # define OPENMVO_MVO_EXPORT 39 | # define OPENMVO_MVO_IMPORT 40 | # endif 41 | # endif 42 | 43 | /* 如果没有定义导出,则不管这个宏命令 */ 44 | #ifndef OPENMVO_MVO_EXPORT 45 | # define OPENMVO_MVO_EXPORT 46 | # define OPENMVO_MVO_IMPORT 47 | #endif 48 | 49 | /* 通过宏MVO_IMPEXP 确定编译成dll,以及使用dll,或者不标识 */ 50 | #if defined(OPENMVO_BUILT_AS_DLL) 51 | # if defined(OPENMVO_MVO_EXPORTS) /* 编译成dll */ 52 | # define MVO_IMPEXP OPENMVO_MVO_EXPORT 53 | # else /* 使用dll */ 54 | # define MVO_IMPEXP OPENMVO_MVO_IMPORT 55 | # endif 56 | #else /* 没有定义 */ 57 | # define MVO_IMPEXP 58 | #endif 59 | 60 | 61 | #endif // OPENMVO_MVO_LINK_PRAGMAS_H_ -------------------------------------------------------------------------------- /libs/base/include/openmvo/base/link_pragmas.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 文件: link_pragmas.h 3 | * 时间: 2014/11/13 21:55 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 7 | * 说明: 用于定义库的导入导出 8 | * 9 | ********************************************************************************/ 10 | #ifndef OPENMVO_BASE_LINK_PRAGMAS_H_ 11 | #define OPENMVO_BASE_LINK_PRAGMAS_H_ 12 | 13 | #include 14 | #include 15 | 16 | // ** 这边很重要! ** 17 | // 在每一个OPENMVO库中,我们要找到下列进行替换为当前项目: 18 | // OPENMVO_XXX_EXPORT, OPENMVO_XXX_IMPORT 19 | // BASE_IMPEXP, OPENMVO_xxx_EXPORTS 20 | 21 | // 通过下面宏的定义,我们可以对编译好的lib直接引用,不需要在链接器中添加名称: 22 | #if !defined(OPENMVO_BASE_EXPORTS) && (defined(_MSC_VER)) 23 | # if defined(_DEBUG) 24 | # pragma comment (lib, BOOST_JOIN( BOOST_JOIN("openmvo_base",OPENMVO_VERSION_POSTFIX),"d.lib")) 25 | # else 26 | # pragma comment (lib, BOOST_JOIN( BOOST_JOIN("openmvo_base",OPENMVO_VERSION_POSTFIX),".lib")) 27 | # endif 28 | #endif 29 | 30 | /* 定义dll的导入导出 31 | */ 32 | #if defined(OPENMVO_OS_WINDOWS) 33 | 34 | # if defined(_MSC_VER) 35 | # define OPENMVO_BASE_EXPORT __declspec(dllexport) 36 | # define OPENMVO_BASE_IMPORT __declspec(dllimport) 37 | # else /* 编译器不支持__declspec() */ 38 | # define OPENMVO_BASE_EXPORT 39 | # define OPENMVO_BASE_IMPORT 40 | # endif 41 | # endif 42 | 43 | /* 如果没有定义导出,则不管这个宏命令 */ 44 | #ifndef OPENMVO_BASE_EXPORT 45 | # define OPENMVO_BASE_EXPORT 46 | # define OPENMVO_BASE_IMPORT 47 | #endif 48 | 49 | /* 通过宏BASE_IMPEXP 确定编译成dll,以及使用dll,或者不标识 */ 50 | #if defined(OPENMVO_BUILT_AS_DLL) 51 | # if defined(OPENMVO_BASE_EXPORTS) /* 编译成dll */ 52 | # define BASE_IMPEXP OPENMVO_BASE_EXPORT 53 | # else /* 使用dll */ 54 | # define BASE_IMPEXP OPENMVO_BASE_IMPORT 55 | # endif 56 | #else /* 没有定义 */ 57 | # define BASE_IMPEXP 58 | #endif 59 | 60 | 61 | #endif // OPENMVO_BASE_LINK_PRAGMAS_H_ -------------------------------------------------------------------------------- /3rdparty/fast/include/fast/faster_corner_utilities.h: -------------------------------------------------------------------------------- 1 | #ifndef FAST_CORNER_UTILITIES_H 2 | #define FAST_CORNER_UTILITIES_H 3 | 4 | #if __ARM_NEON__ 5 | #include 6 | #elif __SSE2__ 7 | #include 8 | #endif 9 | 10 | namespace fast 11 | { 12 | 13 | /// Check if the pointer is aligned to the specified byte granularity 14 | template bool is_aligned(const void* ptr); 15 | template<> inline bool is_aligned<8>(const void* ptr) { return ((reinterpret_cast(ptr)) & 0x7) == 0; } 16 | template<> inline bool is_aligned<16>(const void* ptr) { return ((reinterpret_cast(ptr)) & 0xF) == 0; } 17 | 18 | 19 | struct Less 20 | { 21 | template static bool eval(const T1 a, const T2 b) 22 | { 23 | return a < b; 24 | } 25 | static short prep_t(short pixel_val, short barrier) 26 | { 27 | return pixel_val - barrier; 28 | } 29 | }; 30 | 31 | struct Greater 32 | { 33 | template static bool eval(const T1 a, const T2 b) 34 | { 35 | return a > b; 36 | } 37 | static short prep_t(short pixel_val, short barrier) 38 | { 39 | return pixel_val + barrier; 40 | } 41 | }; 42 | 43 | #if __SSE2__ 44 | 45 | #define CHECK_BARRIER(lo, hi, other, flags) \ 46 | { \ 47 | __m128i diff = _mm_subs_epu8(lo, other); \ 48 | __m128i diff2 = _mm_subs_epu8(other, hi); \ 49 | __m128i z = _mm_setzero_si128(); \ 50 | diff = _mm_cmpeq_epi8(diff, z); \ 51 | diff2 = _mm_cmpeq_epi8(diff2, z); \ 52 | flags = ~(_mm_movemask_epi8(diff) | (_mm_movemask_epi8(diff2) << 16)); \ 53 | } 54 | 55 | template inline __m128i load_si128(const void* addr) { return _mm_loadu_si128((const __m128i*)addr); } 56 | template <> inline __m128i load_si128(const void* addr) { return _mm_load_si128((const __m128i*)addr); } 57 | 58 | #endif 59 | 60 | } // namespace fast 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/arch/Default/Settings.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | 12 | /* All the parameters defined in this file can be specialized in the 13 | * architecture specific files, and/or by the user. 14 | * More to come... */ 15 | 16 | #ifndef EIGEN_DEFAULT_SETTINGS_H 17 | #define EIGEN_DEFAULT_SETTINGS_H 18 | 19 | /** Defines the maximal loop size to enable meta unrolling of loops. 20 | * Note that the value here is expressed in Eigen's own notion of "number of FLOPS", 21 | * it does not correspond to the number of iterations or the number of instructions 22 | */ 23 | #ifndef EIGEN_UNROLLING_LIMIT 24 | #define EIGEN_UNROLLING_LIMIT 100 25 | #endif 26 | 27 | /** Defines the threshold between a "small" and a "large" matrix. 28 | * This threshold is mainly used to select the proper product implementation. 29 | */ 30 | #ifndef EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 31 | #define EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD 8 32 | #endif 33 | 34 | /** Defines the maximal width of the blocks used in the triangular product and solver 35 | * for vectors (level 2 blas xTRMV and xTRSV). The default is 8. 36 | */ 37 | #ifndef EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 38 | #define EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH 8 39 | #endif 40 | 41 | 42 | /** Defines the default number of registers available for that architecture. 43 | * Currently it must be 8 or 16. Other values will fail. 44 | */ 45 | #ifndef EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 46 | #define EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS 8 47 | #endif 48 | 49 | #endif // EIGEN_DEFAULT_SETTINGS_H 50 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/SparseLU: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // Copyright (C) 2012 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_SPARSELU_MODULE_H 12 | #define EIGEN_SPARSELU_MODULE_H 13 | 14 | #include "SparseCore" 15 | 16 | /** 17 | * \defgroup SparseLU_Module SparseLU module 18 | * This module defines a supernodal factorization of general sparse matrices. 19 | * The code is fully optimized for supernode-panel updates with specialized kernels. 20 | * Please, see the documentation of the SparseLU class for more details. 21 | */ 22 | 23 | #include "src/misc/Solve.h" 24 | #include "src/misc/SparseSolve.h" 25 | 26 | // Ordering interface 27 | #include "OrderingMethods" 28 | 29 | #include "src/SparseLU/SparseLU_gemm_kernel.h" 30 | 31 | #include "src/SparseLU/SparseLU_Structs.h" 32 | #include "src/SparseLU/SparseLU_SupernodalMatrix.h" 33 | #include "src/SparseLU/SparseLUImpl.h" 34 | #include "src/SparseCore/SparseColEtree.h" 35 | #include "src/SparseLU/SparseLU_Memory.h" 36 | #include "src/SparseLU/SparseLU_heap_relax_snode.h" 37 | #include "src/SparseLU/SparseLU_relax_snode.h" 38 | #include "src/SparseLU/SparseLU_pivotL.h" 39 | #include "src/SparseLU/SparseLU_panel_dfs.h" 40 | #include "src/SparseLU/SparseLU_kernel_bmod.h" 41 | #include "src/SparseLU/SparseLU_panel_bmod.h" 42 | #include "src/SparseLU/SparseLU_column_dfs.h" 43 | #include "src/SparseLU/SparseLU_column_bmod.h" 44 | #include "src/SparseLU/SparseLU_copy_to_ucol.h" 45 | #include "src/SparseLU/SparseLU_pruneL.h" 46 | #include "src/SparseLU/SparseLU_Utils.h" 47 | #include "src/SparseLU/SparseLU.h" 48 | 49 | #endif // EIGEN_SPARSELU_MODULE_H 50 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/SVD/TODOBdcsvd.txt: -------------------------------------------------------------------------------- 1 | TO DO LIST 2 | 3 | 4 | 5 | (optional optimization) - do all the allocations in the allocate part 6 | - support static matrices 7 | - return a error at compilation time when using integer matrices (int, long, std::complex, ...) 8 | 9 | to finish the algorithm : 10 | -implement the last part of the algorithm as described on the reference paper. 11 | You may find more information on that part on this paper 12 | 13 | -to replace the call to JacobiSVD at the end of the divide algorithm, just after the call to 14 | deflation. 15 | 16 | (suggested step by step resolution) 17 | 0) comment the call to Jacobi in the last part of the divide method and everything right after 18 | until the end of the method. What is commented can be a guideline to steps 3) 4) and 6) 19 | 1) solve the secular equation (Characteristic equation) on the values that are not null (zi!=0 and di!=0), after the deflation 20 | wich should be uncommented in the divide method 21 | 2) remember the values of the singular values that are already computed (zi=0) 22 | 3) assign the singular values found in m_computed at the right places (with the ones found in step 2) ) 23 | in decreasing order 24 | 4) set the firstcol to zero (except the first element) in m_computed 25 | 5) compute all the singular vectors when CompV is set to true and only the left vectors when 26 | CompV is set to false 27 | 6) multiply naiveU and naiveV to the right by the matrices found, only naiveU when CompV is set to 28 | false, /!\ if CompU is false NaiveU has only 2 rows 29 | 7) delete everything commented in step 0) 30 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/NumericalDiff: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Thomas Capricelli 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_NUMERICALDIFF_MODULE 11 | #define EIGEN_NUMERICALDIFF_MODULE 12 | 13 | #include 14 | 15 | namespace Eigen { 16 | 17 | /** 18 | * \defgroup NumericalDiff_Module Numerical differentiation module 19 | * 20 | * \code 21 | * #include 22 | * \endcode 23 | * 24 | * See http://en.wikipedia.org/wiki/Numerical_differentiation 25 | * 26 | * Warning : this should NOT be confused with automatic differentiation, which 27 | * is a different method and has its own module in Eigen : \ref 28 | * AutoDiff_Module. 29 | * 30 | * Currently only "Forward" and "Central" schemes are implemented. Those 31 | * are basic methods, and there exist some more elaborated way of 32 | * computing such approximates. They are implemented using both 33 | * proprietary and free software, and usually requires linking to an 34 | * external library. It is very easy for you to write a functor 35 | * using such software, and the purpose is quite orthogonal to what we 36 | * want to achieve with Eigen. 37 | * 38 | * This is why we will not provide wrappers for every great numerical 39 | * differentiation software that exist, but should rather stick with those 40 | * basic ones, that still are useful for testing. 41 | * 42 | * Also, the \ref NonLinearOptimization_Module needs this in order to 43 | * provide full features compatibility with the original (c)minpack 44 | * package. 45 | * 46 | */ 47 | } 48 | 49 | //@{ 50 | 51 | #include "src/NumericalDiff/NumericalDiff.h" 52 | 53 | //@} 54 | 55 | 56 | #endif // EIGEN_NUMERICALDIFF_MODULE 57 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/QR.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Gael Guennebaud 5 | // Copyright (C) 2011 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN2_QR_H 12 | #define EIGEN2_QR_H 13 | 14 | namespace Eigen { 15 | 16 | template 17 | class QR : public HouseholderQR 18 | { 19 | public: 20 | 21 | typedef HouseholderQR Base; 22 | typedef Block MatrixRBlockType; 23 | 24 | QR() : Base() {} 25 | 26 | template 27 | explicit QR(const T& t) : Base(t) {} 28 | 29 | template 30 | bool solve(const MatrixBase& b, ResultType *result) const 31 | { 32 | *result = static_cast(this)->solve(b); 33 | return true; 34 | } 35 | 36 | MatrixType matrixQ(void) const { 37 | MatrixType ret = MatrixType::Identity(this->rows(), this->cols()); 38 | ret = this->householderQ() * ret; 39 | return ret; 40 | } 41 | 42 | bool isFullRank() const { 43 | return true; 44 | } 45 | 46 | const TriangularView 47 | matrixR(void) const 48 | { 49 | int cols = this->cols(); 50 | return MatrixRBlockType(this->matrixQR(), 0, 0, cols, cols).template triangularView(); 51 | } 52 | }; 53 | 54 | /** \return the QR decomposition of \c *this. 55 | * 56 | * \sa class QR 57 | */ 58 | template 59 | const QR::PlainObject> 60 | MatrixBase::qr() const 61 | { 62 | return QR(eval()); 63 | } 64 | 65 | } // end namespace Eigen 66 | 67 | #endif // EIGEN2_QR_H 68 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/alignedvector3.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #include "main.h" 11 | #include 12 | 13 | template 14 | void alignedvector3() 15 | { 16 | Scalar s1 = internal::random(); 17 | Scalar s2 = internal::random(); 18 | typedef Matrix RefType; 19 | typedef Matrix Mat33; 20 | typedef AlignedVector3 FastType; 21 | RefType r1(RefType::Random()), r2(RefType::Random()), r3(RefType::Random()), 22 | r4(RefType::Random()), r5(RefType::Random()), r6(RefType::Random()); 23 | FastType f1(r1), f2(r2), f3(r3), f4(r4), f5(r5), f6(r6); 24 | Mat33 m1(Mat33::Random()); 25 | 26 | VERIFY_IS_APPROX(f1,r1); 27 | VERIFY_IS_APPROX(f4,r4); 28 | 29 | VERIFY_IS_APPROX(f4+f1,r4+r1); 30 | VERIFY_IS_APPROX(f4-f1,r4-r1); 31 | VERIFY_IS_APPROX(f4+f1-f2,r4+r1-r2); 32 | VERIFY_IS_APPROX(f4+=f3,r4+=r3); 33 | VERIFY_IS_APPROX(f4-=f5,r4-=r5); 34 | VERIFY_IS_APPROX(f4-=f5+f1,r4-=r5+r1); 35 | VERIFY_IS_APPROX(f5+f1-s1*f2,r5+r1-s1*r2); 36 | VERIFY_IS_APPROX(f5+f1/s2-s1*f2,r5+r1/s2-s1*r2); 37 | 38 | VERIFY_IS_APPROX(m1*f4,m1*r4); 39 | VERIFY_IS_APPROX(f4.transpose()*m1,r4.transpose()*m1); 40 | 41 | VERIFY_IS_APPROX(f2.dot(f3),r2.dot(r3)); 42 | VERIFY_IS_APPROX(f2.cross(f3),r2.cross(r3)); 43 | VERIFY_IS_APPROX(f2.norm(),r2.norm()); 44 | 45 | VERIFY_IS_APPROX(f2.normalized(),r2.normalized()); 46 | 47 | VERIFY_IS_APPROX((f2+f1).normalized(),(r2+r1).normalized()); 48 | 49 | f2.normalize(); 50 | r2.normalize(); 51 | VERIFY_IS_APPROX(f2,r2); 52 | } 53 | 54 | void test_alignedvector3() 55 | { 56 | for(int i = 0; i < g_repeat; i++) { 57 | CALL_SUBTEST( alignedvector3() ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/README.txt: -------------------------------------------------------------------------------- 1 | This directory contains contributions from various users. 2 | They are provided "as is", without any support. Nevertheless, 3 | most of them are subject to be included in Eigen in the future. 4 | 5 | In order to use an unsupported module you have to do either: 6 | 7 | - add the path_to_eigen/unsupported directory to your include path and do: 8 | #include 9 | 10 | - or directly do: 11 | #include 12 | 13 | 14 | If you are interested in contributing to one of them, or have other stuff 15 | you would like to share, feel free to contact us: 16 | http://eigen.tuxfamily.org/index.php?title=Main_Page#Mailing_list 17 | 18 | Any kind of contributions are much appreciated, even very preliminary ones. 19 | However, it: 20 | - must rely on Eigen, 21 | - must be highly related to math, 22 | - should have some general purpose in the sense that it could 23 | potentially become an offical Eigen module (or be merged into another one). 24 | 25 | In doubt feel free to contact us. For instance, if your addons is very too specific 26 | but it shows an interesting way of using Eigen, then it could be a nice demo. 27 | 28 | 29 | This directory is organized as follow: 30 | 31 | unsupported/Eigen/ModuleHeader1 32 | unsupported/Eigen/ModuleHeader2 33 | unsupported/Eigen/... 34 | unsupported/Eigen/src/Module1/SourceFile1.h 35 | unsupported/Eigen/src/Module1/SourceFile2.h 36 | unsupported/Eigen/src/Module1/... 37 | unsupported/Eigen/src/Module2/SourceFile1.h 38 | unsupported/Eigen/src/Module2/SourceFile2.h 39 | unsupported/Eigen/src/Module2/... 40 | unsupported/Eigen/src/... 41 | unsupported/doc/snippets/.cpp <- code snippets for the doc 42 | unsupported/doc/examples/.cpp <- examples for the doc 43 | unsupported/doc/TutorialModule1.dox 44 | unsupported/doc/TutorialModule2.dox 45 | unsupported/doc/... 46 | unsupported/test/.cpp <- unit test files 47 | 48 | The documentation is generated at the same time than the main Eigen documentation. 49 | The .html files are generated in: build_dir/doc/html/unsupported/ 50 | 51 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/SparseCore: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SPARSECORE_MODULE_H 2 | #define EIGEN_SPARSECORE_MODULE_H 3 | 4 | #include "Core" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | /** 15 | * \defgroup SparseCore_Module SparseCore module 16 | * 17 | * This module provides a sparse matrix representation, and basic associatd matrix manipulations 18 | * and operations. 19 | * 20 | * See the \ref TutorialSparse "Sparse tutorial" 21 | * 22 | * \code 23 | * #include 24 | * \endcode 25 | * 26 | * This module depends on: Core. 27 | */ 28 | 29 | namespace Eigen { 30 | 31 | /** The type used to identify a general sparse storage. */ 32 | struct Sparse {}; 33 | 34 | } 35 | 36 | #include "src/SparseCore/SparseUtil.h" 37 | #include "src/SparseCore/SparseMatrixBase.h" 38 | #include "src/SparseCore/CompressedStorage.h" 39 | #include "src/SparseCore/AmbiVector.h" 40 | #include "src/SparseCore/SparseMatrix.h" 41 | #include "src/SparseCore/MappedSparseMatrix.h" 42 | #include "src/SparseCore/SparseVector.h" 43 | #include "src/SparseCore/SparseBlock.h" 44 | #include "src/SparseCore/SparseTranspose.h" 45 | #include "src/SparseCore/SparseCwiseUnaryOp.h" 46 | #include "src/SparseCore/SparseCwiseBinaryOp.h" 47 | #include "src/SparseCore/SparseDot.h" 48 | #include "src/SparseCore/SparsePermutation.h" 49 | #include "src/SparseCore/SparseRedux.h" 50 | #include "src/SparseCore/SparseFuzzy.h" 51 | #include "src/SparseCore/ConservativeSparseSparseProduct.h" 52 | #include "src/SparseCore/SparseSparseProductWithPruning.h" 53 | #include "src/SparseCore/SparseProduct.h" 54 | #include "src/SparseCore/SparseDenseProduct.h" 55 | #include "src/SparseCore/SparseDiagonalProduct.h" 56 | #include "src/SparseCore/SparseTriangularView.h" 57 | #include "src/SparseCore/SparseSelfAdjointView.h" 58 | #include "src/SparseCore/TriangularSolver.h" 59 | #include "src/SparseCore/SparseView.h" 60 | 61 | #include "src/Core/util/ReenableStupidWarnings.h" 62 | 63 | #endif // EIGEN_SPARSECORE_MODULE_H 64 | 65 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | // This file is a base class plugin containing common coefficient wise functions. 12 | 13 | /** \returns an expression of the difference of \c *this and \a other 14 | * 15 | * \note If you want to substract a given scalar from all coefficients, see Cwise::operator-(). 16 | * 17 | * \sa class CwiseBinaryOp, operator-=() 18 | */ 19 | EIGEN_MAKE_CWISE_BINARY_OP(operator-,internal::scalar_difference_op) 20 | 21 | /** \returns an expression of the sum of \c *this and \a other 22 | * 23 | * \note If you want to add a given scalar to all coefficients, see Cwise::operator+(). 24 | * 25 | * \sa class CwiseBinaryOp, operator+=() 26 | */ 27 | EIGEN_MAKE_CWISE_BINARY_OP(operator+,internal::scalar_sum_op) 28 | 29 | /** \returns an expression of a custom coefficient-wise operator \a func of *this and \a other 30 | * 31 | * The template parameter \a CustomBinaryOp is the type of the functor 32 | * of the custom operator (see class CwiseBinaryOp for an example) 33 | * 34 | * Here is an example illustrating the use of custom functors: 35 | * \include class_CwiseBinaryOp.cpp 36 | * Output: \verbinclude class_CwiseBinaryOp.out 37 | * 38 | * \sa class CwiseBinaryOp, operator+(), operator-(), cwiseProduct() 39 | */ 40 | template 41 | EIGEN_STRONG_INLINE const CwiseBinaryOp 42 | binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other, const CustomBinaryOp& func = CustomBinaryOp()) const 43 | { 44 | return CwiseBinaryOp(derived(), other.derived(), func); 45 | } 46 | 47 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/SuperLUSupport: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_SUPERLUSUPPORT_MODULE_H 2 | #define EIGEN_SUPERLUSUPPORT_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | #ifdef EMPTY 9 | #define EIGEN_EMPTY_WAS_ALREADY_DEFINED 10 | #endif 11 | 12 | typedef int int_t; 13 | #include 14 | #include 15 | #include 16 | 17 | // slu_util.h defines a preprocessor token named EMPTY which is really polluting, 18 | // so we remove it in favor of a SUPERLU_EMPTY token. 19 | // If EMPTY was already defined then we don't undef it. 20 | 21 | #if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) 22 | # undef EIGEN_EMPTY_WAS_ALREADY_DEFINED 23 | #elif defined(EMPTY) 24 | # undef EMPTY 25 | #endif 26 | 27 | #define SUPERLU_EMPTY (-1) 28 | 29 | namespace Eigen { struct SluMatrix; } 30 | 31 | /** \ingroup Support_modules 32 | * \defgroup SuperLUSupport_Module SuperLUSupport module 33 | * 34 | * This module provides an interface to the SuperLU library. 35 | * It provides the following factorization class: 36 | * - class SuperLU: a supernodal sequential LU factorization. 37 | * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). 38 | * 39 | * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. 40 | * 41 | * \code 42 | * #include 43 | * \endcode 44 | * 45 | * In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies. 46 | * The dependencies depend on how superlu has been compiled. 47 | * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. 48 | * 49 | */ 50 | 51 | #include "src/misc/Solve.h" 52 | #include "src/misc/SparseSolve.h" 53 | 54 | #include "src/SuperLUSupport/SuperLUSupport.h" 55 | 56 | 57 | #include "src/Core/util/ReenableStupidWarnings.h" 58 | 59 | #endif // EIGEN_SUPERLUSUPPORT_MODULE_H 60 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h: -------------------------------------------------------------------------------- 1 | #define chkder_log10e 0.43429448190325182765 2 | #define chkder_factor 100. 3 | 4 | namespace Eigen { 5 | 6 | namespace internal { 7 | 8 | template 9 | void chkder( 10 | const Matrix< Scalar, Dynamic, 1 > &x, 11 | const Matrix< Scalar, Dynamic, 1 > &fvec, 12 | const Matrix< Scalar, Dynamic, Dynamic > &fjac, 13 | Matrix< Scalar, Dynamic, 1 > &xp, 14 | const Matrix< Scalar, Dynamic, 1 > &fvecp, 15 | int mode, 16 | Matrix< Scalar, Dynamic, 1 > &err 17 | ) 18 | { 19 | using std::sqrt; 20 | using std::abs; 21 | using std::log; 22 | 23 | typedef DenseIndex Index; 24 | 25 | const Scalar eps = sqrt(NumTraits::epsilon()); 26 | const Scalar epsf = chkder_factor * NumTraits::epsilon(); 27 | const Scalar epslog = chkder_log10e * log(eps); 28 | Scalar temp; 29 | 30 | const Index m = fvec.size(), n = x.size(); 31 | 32 | if (mode != 2) { 33 | /* mode = 1. */ 34 | xp.resize(n); 35 | for (Index j = 0; j < n; ++j) { 36 | temp = eps * abs(x[j]); 37 | if (temp == 0.) 38 | temp = eps; 39 | xp[j] = x[j] + temp; 40 | } 41 | } 42 | else { 43 | /* mode = 2. */ 44 | err.setZero(m); 45 | for (Index j = 0; j < n; ++j) { 46 | temp = abs(x[j]); 47 | if (temp == 0.) 48 | temp = 1.; 49 | err += temp * fjac.col(j); 50 | } 51 | for (Index i = 0; i < m; ++i) { 52 | temp = 1.; 53 | if (fvec[i] != 0. && fvecp[i] != 0. && abs(fvecp[i] - fvec[i]) >= epsf * abs(fvec[i])) 54 | temp = eps * abs((fvecp[i] - fvec[i]) / eps - err[i]) / (abs(fvec[i]) + abs(fvecp[i])); 55 | err[i] = 1.; 56 | if (temp > NumTraits::epsilon() && temp < eps) 57 | err[i] = (chkder_log10e * log(temp) - epslog) / epslog; 58 | if (temp >= eps) 59 | err[i] = 0.; 60 | } 61 | } 62 | } 63 | 64 | } // end namespace internal 65 | 66 | } // end namespace Eigen 67 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/test/mpreal_support.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace mpfr; 8 | using namespace Eigen; 9 | 10 | void test_mpreal_support() 11 | { 12 | // set precision to 256 bits (double has only 53 bits) 13 | mpreal::set_default_prec(256); 14 | typedef Matrix MatrixXmp; 15 | 16 | std::cerr << "epsilon = " << NumTraits::epsilon() << "\n"; 17 | std::cerr << "dummy_precision = " << NumTraits::dummy_precision() << "\n"; 18 | std::cerr << "highest = " << NumTraits::highest() << "\n"; 19 | std::cerr << "lowest = " << NumTraits::lowest() << "\n"; 20 | 21 | for(int i = 0; i < g_repeat; i++) { 22 | int s = Eigen::internal::random(1,100); 23 | MatrixXmp A = MatrixXmp::Random(s,s); 24 | MatrixXmp B = MatrixXmp::Random(s,s); 25 | MatrixXmp S = A.adjoint() * A; 26 | MatrixXmp X; 27 | 28 | // Basic stuffs 29 | VERIFY_IS_APPROX(A.real(), A); 30 | VERIFY(Eigen::internal::isApprox(A.array().abs2().sum(), A.squaredNorm())); 31 | VERIFY_IS_APPROX(A.array().exp(), exp(A.array())); 32 | VERIFY_IS_APPROX(A.array().abs2().sqrt(), A.array().abs()); 33 | VERIFY_IS_APPROX(A.array().sin(), sin(A.array())); 34 | VERIFY_IS_APPROX(A.array().cos(), cos(A.array())); 35 | 36 | 37 | // Cholesky 38 | X = S.selfadjointView().llt().solve(B); 39 | VERIFY_IS_APPROX((S.selfadjointView()*X).eval(),B); 40 | 41 | // partial LU 42 | X = A.lu().solve(B); 43 | VERIFY_IS_APPROX((A*X).eval(),B); 44 | 45 | // symmetric eigenvalues 46 | SelfAdjointEigenSolver eig(S); 47 | VERIFY_IS_EQUAL(eig.info(), Success); 48 | VERIFY( (S.selfadjointView() * eig.eigenvectors()).isApprox(eig.eigenvectors() * eig.eigenvalues().asDiagonal(), NumTraits::dummy_precision()*1e3) ); 49 | } 50 | 51 | { 52 | MatrixXmp A(8,3); A.setRandom(); 53 | // test output (interesting things happen in this code) 54 | std::stringstream stream; 55 | stream << A; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/CoreIterators.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_COREITERATORS_H 11 | #define EIGEN_COREITERATORS_H 12 | 13 | namespace Eigen { 14 | 15 | /* This file contains the respective InnerIterator definition of the expressions defined in Eigen/Core 16 | */ 17 | 18 | /** \ingroup SparseCore_Module 19 | * \class InnerIterator 20 | * \brief An InnerIterator allows to loop over the element of a sparse (or dense) matrix or expression 21 | * 22 | * todo 23 | */ 24 | 25 | // generic version for dense matrix and expressions 26 | template class DenseBase::InnerIterator 27 | { 28 | protected: 29 | typedef typename Derived::Scalar Scalar; 30 | typedef typename Derived::Index Index; 31 | 32 | enum { IsRowMajor = (Derived::Flags&RowMajorBit)==RowMajorBit }; 33 | public: 34 | EIGEN_STRONG_INLINE InnerIterator(const Derived& expr, Index outer) 35 | : m_expression(expr), m_inner(0), m_outer(outer), m_end(expr.innerSize()) 36 | {} 37 | 38 | EIGEN_STRONG_INLINE Scalar value() const 39 | { 40 | return (IsRowMajor) ? m_expression.coeff(m_outer, m_inner) 41 | : m_expression.coeff(m_inner, m_outer); 42 | } 43 | 44 | EIGEN_STRONG_INLINE InnerIterator& operator++() { m_inner++; return *this; } 45 | 46 | EIGEN_STRONG_INLINE Index index() const { return m_inner; } 47 | inline Index row() const { return IsRowMajor ? m_outer : index(); } 48 | inline Index col() const { return IsRowMajor ? index() : m_outer; } 49 | 50 | EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } 51 | 52 | protected: 53 | const Derived& m_expression; 54 | Index m_inner; 55 | const Index m_outer; 56 | const Index m_end; 57 | }; 58 | 59 | } // end namespace Eigen 60 | 61 | #endif // EIGEN_COREITERATORS_H 62 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/NonLinearOptimization/covar.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | template 6 | void covar( 7 | Matrix< Scalar, Dynamic, Dynamic > &r, 8 | const VectorXi &ipvt, 9 | Scalar tol = std::sqrt(NumTraits::epsilon()) ) 10 | { 11 | using std::abs; 12 | typedef DenseIndex Index; 13 | 14 | /* Local variables */ 15 | Index i, j, k, l, ii, jj; 16 | bool sing; 17 | Scalar temp; 18 | 19 | /* Function Body */ 20 | const Index n = r.cols(); 21 | const Scalar tolr = tol * abs(r(0,0)); 22 | Matrix< Scalar, Dynamic, 1 > wa(n); 23 | eigen_assert(ipvt.size()==n); 24 | 25 | /* form the inverse of r in the full upper triangle of r. */ 26 | l = -1; 27 | for (k = 0; k < n; ++k) 28 | if (abs(r(k,k)) > tolr) { 29 | r(k,k) = 1. / r(k,k); 30 | for (j = 0; j <= k-1; ++j) { 31 | temp = r(k,k) * r(j,k); 32 | r(j,k) = 0.; 33 | r.col(k).head(j+1) -= r.col(j).head(j+1) * temp; 34 | } 35 | l = k; 36 | } 37 | 38 | /* form the full upper triangle of the inverse of (r transpose)*r */ 39 | /* in the full upper triangle of r. */ 40 | for (k = 0; k <= l; ++k) { 41 | for (j = 0; j <= k-1; ++j) 42 | r.col(j).head(j+1) += r.col(k).head(j+1) * r(j,k); 43 | r.col(k).head(k+1) *= r(k,k); 44 | } 45 | 46 | /* form the full lower triangle of the covariance matrix */ 47 | /* in the strict lower triangle of r and in wa. */ 48 | for (j = 0; j < n; ++j) { 49 | jj = ipvt[j]; 50 | sing = j > l; 51 | for (i = 0; i <= j; ++i) { 52 | if (sing) 53 | r(i,j) = 0.; 54 | ii = ipvt[i]; 55 | if (ii > jj) 56 | r(ii,jj) = r(i,j); 57 | if (ii < jj) 58 | r(jj,ii) = r(i,j); 59 | } 60 | wa[jj] = r(j,j); 61 | } 62 | 63 | /* symmetrize the covariance matrix in r. */ 64 | r.topLeftCorner(n,n).template triangularView() = r.topLeftCorner(n,n).transpose(); 65 | r.diagonal() = wa; 66 | } 67 | 68 | } // end namespace internal 69 | 70 | } // end namespace Eigen 71 | -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/frame_handler_mono.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENMVO_MVO_FRAME_HANDLER_MONO_H_ 2 | #define OPENMVO_MVO_FRAME_HANDLER_MONO_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace mvo { 11 | 12 | /// 单目视觉里程计的处理流 13 | class FrameHandlerMono : public FrameHandlerBase 14 | { 15 | public: 16 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 17 | 18 | FrameHandlerMono(AbstractCamera* cam); 19 | virtual ~FrameHandlerMono(); 20 | 21 | /// 提供一个图像 22 | void addImage(const cv::Mat& img, double timestamp); 23 | 24 | /// 获取被处理的最后一帧 25 | FramePtr lastFrame() { return last_frame_; } 26 | 27 | /// 一个外面的位置识别模块,用于确定在什么地方需要重新定位,目前用不着 28 | bool relocalizeFrameAtPose( 29 | const int keyframe_id, 30 | const SE3& T_kf_f, 31 | const cv::Mat& img, 32 | const double timestamp); 33 | 34 | protected: 35 | AbstractCamera* cam_; //!< 相机模型,目前为针孔相机模型,可以是ATAN或Ocam模型 36 | Reprojector reprojector_; //!< 将其他帧上对应的3D点投影到当前帧上 37 | FramePtr new_frame_; //!< 当前帧 38 | FramePtr last_frame_; //!< 上一帧,不必一定是关键帧 39 | std::set core_kfs_; //!< 靠近邻居的关键帧 40 | std::vector< std::pair > overlap_kfs_; //!< 所有的关键帧有重叠视野. pair的第二个数表示有多少个共同的可观测点 41 | Initialization klt_homography_init_; //!< 用来估计开始两个关键帧的位姿通过估计两帧的单应矩阵 42 | DepthFilter* depth_filter_; //!< 深度估计算法,其运行在单独的线程,用来初始化新的3D点 43 | 44 | /// 单目视觉里程计算法初始化 45 | virtual void initialize(); 46 | 47 | /// 处理第一帧,并设置这一帧为关键帧 48 | virtual UpdateResult processFirstFrame(); 49 | 50 | /// 处理接下来的所有帧,直到下一个关键帧被选择 51 | virtual UpdateResult processSecondFrame(); 52 | 53 | /// 处理完开始的两个关键帧后处理所有帧 54 | virtual UpdateResult processFrame(); 55 | 56 | /// 根据上一帧的位置进行重新定位 57 | virtual UpdateResult relocalizeFrame( 58 | const SE3& T_cur_ref, 59 | FramePtr ref_keyframe); 60 | 61 | /// 重新设置关键处理程序 62 | virtual void resetAll(); 63 | 64 | /// 关键帧选择标准 65 | virtual bool needNewKf(double scene_depth_mean); 66 | 67 | }; 68 | 69 | } // namespace mvo 70 | 71 | 72 | #endif // OPENMVO_MVO_FRAME_HANDLER_MONO_H_ 73 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_WARNINGS_DISABLED 2 | #define EIGEN_WARNINGS_DISABLED 3 | 4 | #ifdef _MSC_VER 5 | // 4100 - unreferenced formal parameter (occurred e.g. in aligned_allocator::destroy(pointer p)) 6 | // 4101 - unreferenced local variable 7 | // 4127 - conditional expression is constant 8 | // 4181 - qualifier applied to reference type ignored 9 | // 4211 - nonstandard extension used : redefined extern to static 10 | // 4244 - 'argument' : conversion from 'type1' to 'type2', possible loss of data 11 | // 4273 - QtAlignedMalloc, inconsistent DLL linkage 12 | // 4324 - structure was padded due to declspec(align()) 13 | // 4512 - assignment operator could not be generated 14 | // 4522 - 'class' : multiple assignment operators specified 15 | // 4700 - uninitialized local variable 'xyz' used 16 | // 4717 - 'function' : recursive on all control paths, function will cause runtime stack overflow 17 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 18 | #pragma warning( push ) 19 | #endif 20 | #pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4512 4522 4700 4717 ) 21 | #elif defined __INTEL_COMPILER 22 | // 2196 - routine is both "inline" and "noinline" ("noinline" assumed) 23 | // ICC 12 generates this warning even without any inline keyword, when defining class methods 'inline' i.e. inside of class body 24 | // typedef that may be a reference type. 25 | // 279 - controlling expression is constant 26 | // ICC 12 generates this warning on assert(constant_expression_depending_on_template_params) and frankly this is a legitimate use case. 27 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 28 | #pragma warning push 29 | #endif 30 | #pragma warning disable 2196 279 31 | #elif defined __clang__ 32 | // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant 33 | // this is really a stupid warning as it warns on compile-time expressions involving enums 34 | #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS 35 | #pragma clang diagnostic push 36 | #endif 37 | #pragma clang diagnostic ignored "-Wconstant-logical-operand" 38 | #endif 39 | 40 | #endif // not EIGEN_WARNINGS_DISABLED 41 | -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/sparse_img_align.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 文件名: sparse_img_align 3 | * 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 时间: 2015/8/25 7 | * 8 | * 说明: 参考rpg_svo(https://github.com/uzh-rpg/rpg_svo) 9 | *************************************************************************/ 10 | #ifndef OPENMVO_MVO_SPARSE_IMG_ALIGN_H_ 11 | #define OPENMVO_MVO_SPARSE_IMG_ALIGN_H_ 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mvo { 19 | 20 | using namespace Sophus; 21 | using namespace Eigen; 22 | 23 | class AbstractCamera; 24 | class Feature; 25 | 26 | /// 通过对帧之间的特征片进行光度误差最小化,优化帧位置 27 | class SparseImgAlign : public NLLSSolver < 6, SE3 > 28 | { 29 | static const int patch_halfsize_ = 2;//!< 面片的半尺寸为2 30 | static const int patch_size_ = 2 * patch_halfsize_;// 论文中将patch大小设置为4*4 31 | static const int patch_area_ = patch_size_*patch_size_;// 每个特征周围采用4*4的patch 32 | public: 33 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 34 | 35 | cv::Mat resimg_; 36 | 37 | SparseImgAlign( 38 | int n_levels, 39 | int min_level, 40 | int n_iter, 41 | Method method, 42 | bool display, 43 | bool verbose); 44 | 45 | size_t run(FramePtr ref_frame,FramePtr cur_frame); 46 | 47 | protected: 48 | FramePtr ref_frame_; //!< 参考帧,已经获得深度信息 49 | FramePtr cur_frame_; //!< 当前帧,目前只知道图像信息 50 | int level_; //!< 当前金字塔等级 51 | bool display_; //!< 是否显示残差图像 52 | int max_level_; //!< 用于对齐的最粗糙即最大的金字塔等级 53 | int min_level_; //!< 用于对齐的最好的即最小的金字塔等级 54 | 55 | // cache: 56 | Matrix jacobian_cache_; 57 | bool have_ref_patch_cache_; 58 | cv::Mat ref_patch_cache_; 59 | std::vector visible_fts_; 60 | 61 | void precomputeReferencePatches(); 62 | 63 | virtual double computeResiduals(const SE3& model, bool linearize_system, bool compute_weight_scale = false); 64 | virtual int solve(); 65 | virtual void update(const ModelType& old_model, ModelType& new_model); 66 | 67 | virtual void startIteration(); 68 | virtual void finishIteration(); 69 | }; 70 | 71 | } // namespace mvo 72 | 73 | 74 | #endif // OPENMVO_MVO_SPARSE_IMG_ALIGN_H_ 75 | -------------------------------------------------------------------------------- /libs/base/include/openmvo/utils/math_utils.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * 文件名: math_utils 3 | * 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 时间: 2015/8/7 7 | * 8 | * 说明: 9 | *************************************************************************/ 10 | #ifndef OPENMVO_UTILS_MATH_UTILS_H_ 11 | #define OPENMVO_UTILS_MATH_UTILS_H_ 12 | #include 13 | #include 14 | #include 15 | 16 | namespace mvo 17 | { 18 | using namespace Eigen; 19 | 20 | Vector3d triangulateFeatureNonLin( 21 | const Matrix3d& R, 22 | const Vector3d& t, 23 | const Vector3d& feature1, 24 | const Vector3d& feature2); 25 | 26 | double reprojError( 27 | const Vector3d& f1, 28 | const Vector3d& f2, 29 | double focal_length); 30 | 31 | double computeInliers( 32 | const std::vector& features1, 33 | const std::vector& features2, 34 | const Matrix3d& R, 35 | const Vector3d& t, 36 | const double reproj_thresh, 37 | double focal_length, 38 | std::vector& xyz_vec, 39 | std::vector& inliers, 40 | std::vector& outliers); 41 | 42 | /// 投影,摄像机坐标系下坐标转像素世界坐标 43 | inline Vector2d project2d(const Vector3d& v) 44 | { 45 | return v.head<2>() / v[2]; 46 | } 47 | 48 | /// 反投影,将像素的世界坐标转相对于的摄像机坐标 49 | inline Vector3d unproject2d(const Vector2d& v) 50 | { 51 | return Vector3d(v[0], v[1], 1.0); 52 | } 53 | ///给出反对称矩阵 54 | inline Matrix3d sqew(const Vector3d& v) 55 | { 56 | Matrix3d v_sqew; 57 | v_sqew << 0, -v[2], v[1], 58 | v[2], 0, -v[0], 59 | -v[1], v[0], 0; 60 | return v_sqew; 61 | } 62 | 63 | inline double norm_max(const Eigen::VectorXd & v) 64 | { 65 | double max = -1; 66 | for (int i = 0; i < v.size(); i++) 67 | { 68 | double abs = fabs(v[i]); 69 | if (abs > max){ 70 | max = abs; 71 | } 72 | } 73 | return max; 74 | } 75 | 76 | double sampsonusError( 77 | const Vector2d &v2Dash, 78 | const Matrix3d& m3Essential, 79 | const Vector2d& v2); 80 | ///给出中值 81 | template 82 | T getMedian(std::vector& data_vec) 83 | { 84 | assert(!data_vec.empty()); 85 | typename std::vector::iterator it = data_vec.begin() + floor(data_vec.size() / 2); 86 | nth_element(data_vec.begin(), it, data_vec.end());//对前n个数进行排序 87 | return *it; 88 | } 89 | } 90 | 91 | #endif // OPENMVO_UTILS_MATH_UTILS_H_ -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/BVH_Example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace Eigen; 6 | typedef AlignedBox Box2d; 7 | 8 | namespace Eigen { 9 | namespace internal { 10 | Box2d bounding_box(const Vector2d &v) { return Box2d(v, v); } //compute the bounding box of a single point 11 | } 12 | } 13 | 14 | struct PointPointMinimizer //how to compute squared distances between points and rectangles 15 | { 16 | PointPointMinimizer() : calls(0) {} 17 | typedef double Scalar; 18 | 19 | double minimumOnVolumeVolume(const Box2d &r1, const Box2d &r2) { ++calls; return r1.squaredExteriorDistance(r2); } 20 | double minimumOnVolumeObject(const Box2d &r, const Vector2d &v) { ++calls; return r.squaredExteriorDistance(v); } 21 | double minimumOnObjectVolume(const Vector2d &v, const Box2d &r) { ++calls; return r.squaredExteriorDistance(v); } 22 | double minimumOnObjectObject(const Vector2d &v1, const Vector2d &v2) { ++calls; return (v1 - v2).squaredNorm(); } 23 | 24 | int calls; 25 | }; 26 | 27 | int main() 28 | { 29 | typedef std::vector > StdVectorOfVector2d; 30 | StdVectorOfVector2d redPoints, bluePoints; 31 | for(int i = 0; i < 100; ++i) { //initialize random set of red points and blue points 32 | redPoints.push_back(Vector2d::Random()); 33 | bluePoints.push_back(Vector2d::Random()); 34 | } 35 | 36 | PointPointMinimizer minimizer; 37 | double minDistSq = std::numeric_limits::max(); 38 | 39 | //brute force to find closest red-blue pair 40 | for(int i = 0; i < (int)redPoints.size(); ++i) 41 | for(int j = 0; j < (int)bluePoints.size(); ++j) 42 | minDistSq = std::min(minDistSq, minimizer.minimumOnObjectObject(redPoints[i], bluePoints[j])); 43 | std::cout << "Brute force distance = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl; 44 | 45 | //using BVH to find closest red-blue pair 46 | minimizer.calls = 0; 47 | KdBVH redTree(redPoints.begin(), redPoints.end()), blueTree(bluePoints.begin(), bluePoints.end()); //construct the trees 48 | minDistSq = BVMinimize(redTree, blueTree, minimizer); //actual BVH minimization call 49 | std::cout << "BVH distance = " << sqrt(minDistSq) << ", calls = " << minimizer.calls << std::endl; 50 | 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2012 Désiré Nuentsa-Wakam 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | 11 | #ifndef EIGEN_SPARSELU_UTILS_H 12 | #define EIGEN_SPARSELU_UTILS_H 13 | 14 | namespace Eigen { 15 | namespace internal { 16 | 17 | /** 18 | * \brief Count Nonzero elements in the factors 19 | */ 20 | template 21 | void SparseLUImpl::countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu) 22 | { 23 | nnzL = 0; 24 | nnzU = (glu.xusub)(n); 25 | Index nsuper = (glu.supno)(n); 26 | Index jlen; 27 | Index i, j, fsupc; 28 | if (n <= 0 ) return; 29 | // For each supernode 30 | for (i = 0; i <= nsuper; i++) 31 | { 32 | fsupc = glu.xsup(i); 33 | jlen = glu.xlsub(fsupc+1) - glu.xlsub(fsupc); 34 | 35 | for (j = fsupc; j < glu.xsup(i+1); j++) 36 | { 37 | nnzL += jlen; 38 | nnzU += j - fsupc + 1; 39 | jlen--; 40 | } 41 | } 42 | } 43 | 44 | /** 45 | * \brief Fix up the data storage lsub for L-subscripts. 46 | * 47 | * It removes the subscripts sets for structural pruning, 48 | * and applies permutation to the remaining subscripts 49 | * 50 | */ 51 | template 52 | void SparseLUImpl::fixupL(const Index n, const IndexVector& perm_r, GlobalLU_t& glu) 53 | { 54 | Index fsupc, i, j, k, jstart; 55 | 56 | Index nextl = 0; 57 | Index nsuper = (glu.supno)(n); 58 | 59 | // For each supernode 60 | for (i = 0; i <= nsuper; i++) 61 | { 62 | fsupc = glu.xsup(i); 63 | jstart = glu.xlsub(fsupc); 64 | glu.xlsub(fsupc) = nextl; 65 | for (j = jstart; j < glu.xlsub(fsupc + 1); j++) 66 | { 67 | glu.lsub(nextl) = perm_r(glu.lsub(j)); // Now indexed into P*A 68 | nextl++; 69 | } 70 | for (k = fsupc+1; k < glu.xsup(i+1); k++) 71 | glu.xlsub(k) = nextl; // other columns in supernode i 72 | } 73 | 74 | glu.xlsub(n) = nextl; 75 | } 76 | 77 | } // end namespace internal 78 | 79 | } // end namespace Eigen 80 | #endif // EIGEN_SPARSELU_UTILS_H 81 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/LevenbergMarquardt/CopyrightMINPACK.txt: -------------------------------------------------------------------------------- 1 | Minpack Copyright Notice (1999) University of Chicago. All rights reserved 2 | 3 | Redistribution and use in source and binary forms, with or 4 | without modification, are permitted provided that the 5 | following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above 8 | copyright notice, this list of conditions and the following 9 | disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials 14 | provided with the distribution. 15 | 16 | 3. The end-user documentation included with the 17 | redistribution, if any, must include the following 18 | acknowledgment: 19 | 20 | "This product includes software developed by the 21 | University of Chicago, as Operator of Argonne National 22 | Laboratory. 23 | 24 | Alternately, this acknowledgment may appear in the software 25 | itself, if and wherever such third-party acknowledgments 26 | normally appear. 27 | 28 | 4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" 29 | WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE 30 | UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND 31 | THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES 33 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE 34 | OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY 35 | OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR 36 | USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF 37 | THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) 38 | DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION 39 | UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL 40 | BE CORRECTED. 41 | 42 | 5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT 43 | HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF 44 | ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, 45 | INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF 46 | ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF 47 | PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER 48 | SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT 49 | (INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, 50 | EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE 51 | POSSIBILITY OF SUCH LOSS OR DAMAGES. 52 | 53 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/Lazy.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_LAZY_H 11 | #define EIGEN_LAZY_H 12 | 13 | namespace Eigen { 14 | 15 | /** \deprecated it is only used by lazy() which is deprecated 16 | * 17 | * \returns an expression of *this with added flags 18 | * 19 | * Example: \include MatrixBase_marked.cpp 20 | * Output: \verbinclude MatrixBase_marked.out 21 | * 22 | * \sa class Flagged, extract(), part() 23 | */ 24 | template 25 | template 26 | inline const Flagged 27 | MatrixBase::marked() const 28 | { 29 | return derived(); 30 | } 31 | 32 | /** \deprecated use MatrixBase::noalias() 33 | * 34 | * \returns an expression of *this with the EvalBeforeAssigningBit flag removed. 35 | * 36 | * Example: \include MatrixBase_lazy.cpp 37 | * Output: \verbinclude MatrixBase_lazy.out 38 | * 39 | * \sa class Flagged, marked() 40 | */ 41 | template 42 | inline const Flagged 43 | MatrixBase::lazy() const 44 | { 45 | return derived(); 46 | } 47 | 48 | 49 | /** \internal 50 | * Overloaded to perform an efficient C += (A*B).lazy() */ 51 | template 52 | template 53 | Derived& MatrixBase::operator+=(const Flagged, 0, 54 | EvalBeforeAssigningBit>& other) 55 | { 56 | other._expression().derived().addTo(derived()); return derived(); 57 | } 58 | 59 | /** \internal 60 | * Overloaded to perform an efficient C -= (A*B).lazy() */ 61 | template 62 | template 63 | Derived& MatrixBase::operator-=(const Flagged, 0, 64 | EvalBeforeAssigningBit>& other) 65 | { 66 | other._expression().derived().subTo(derived()); return derived(); 67 | } 68 | 69 | } // end namespace Eigen 70 | 71 | #endif // EIGEN_LAZY_H 72 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/OrderingMethods: -------------------------------------------------------------------------------- 1 | #ifndef EIGEN_ORDERINGMETHODS_MODULE_H 2 | #define EIGEN_ORDERINGMETHODS_MODULE_H 3 | 4 | #include "SparseCore" 5 | 6 | #include "src/Core/util/DisableStupidWarnings.h" 7 | 8 | /** 9 | * \defgroup OrderingMethods_Module OrderingMethods module 10 | * 11 | * This module is currently for internal use only 12 | * 13 | * It defines various built-in and external ordering methods for sparse matrices. 14 | * They are typically used to reduce the number of elements during 15 | * the sparse matrix decomposition (LLT, LU, QR). 16 | * Precisely, in a preprocessing step, a permutation matrix P is computed using 17 | * those ordering methods and applied to the columns of the matrix. 18 | * Using for instance the sparse Cholesky decomposition, it is expected that 19 | * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A). 20 | * 21 | * 22 | * Usage : 23 | * \code 24 | * #include 25 | * \endcode 26 | * 27 | * A simple usage is as a template parameter in the sparse decomposition classes : 28 | * 29 | * \code 30 | * SparseLU > solver; 31 | * \endcode 32 | * 33 | * \code 34 | * SparseQR > solver; 35 | * \endcode 36 | * 37 | * It is possible as well to call directly a particular ordering method for your own purpose, 38 | * \code 39 | * AMDOrdering ordering; 40 | * PermutationMatrix perm; 41 | * SparseMatrix A; 42 | * //Fill the matrix ... 43 | * 44 | * ordering(A, perm); // Call AMD 45 | * \endcode 46 | * 47 | * \note Some of these methods (like AMD or METIS), need the sparsity pattern 48 | * of the input matrix to be symmetric. When the matrix is structurally unsymmetric, 49 | * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method. 50 | * If your matrix is already symmetric (at leat in structure), you can avoid that 51 | * by calling the method with a SelfAdjointView type. 52 | * 53 | * \code 54 | * // Call the ordering on the pattern of the lower triangular matrix A 55 | * ordering(A.selfadjointView(), perm); 56 | * \endcode 57 | */ 58 | 59 | #ifndef EIGEN_MPL2_ONLY 60 | #include "src/OrderingMethods/Amd.h" 61 | #endif 62 | 63 | #include "src/OrderingMethods/Ordering.h" 64 | #include "src/Core/util/ReenableStupidWarnings.h" 65 | 66 | #endif // EIGEN_ORDERINGMETHODS_MODULE_H 67 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h: -------------------------------------------------------------------------------- 1 | namespace Eigen { 2 | 3 | namespace internal { 4 | 5 | template 6 | DenseIndex fdjac1( 7 | const FunctorType &Functor, 8 | Matrix< Scalar, Dynamic, 1 > &x, 9 | Matrix< Scalar, Dynamic, 1 > &fvec, 10 | Matrix< Scalar, Dynamic, Dynamic > &fjac, 11 | DenseIndex ml, DenseIndex mu, 12 | Scalar epsfcn) 13 | { 14 | using std::sqrt; 15 | using std::abs; 16 | 17 | typedef DenseIndex Index; 18 | 19 | /* Local variables */ 20 | Scalar h; 21 | Index j, k; 22 | Scalar eps, temp; 23 | Index msum; 24 | int iflag; 25 | Index start, length; 26 | 27 | /* Function Body */ 28 | const Scalar epsmch = NumTraits::epsilon(); 29 | const Index n = x.size(); 30 | eigen_assert(fvec.size()==n); 31 | Matrix< Scalar, Dynamic, 1 > wa1(n); 32 | Matrix< Scalar, Dynamic, 1 > wa2(n); 33 | 34 | eps = sqrt((std::max)(epsfcn,epsmch)); 35 | msum = ml + mu + 1; 36 | if (msum >= n) { 37 | /* computation of dense approximate jacobian. */ 38 | for (j = 0; j < n; ++j) { 39 | temp = x[j]; 40 | h = eps * abs(temp); 41 | if (h == 0.) 42 | h = eps; 43 | x[j] = temp + h; 44 | iflag = Functor(x, wa1); 45 | if (iflag < 0) 46 | return iflag; 47 | x[j] = temp; 48 | fjac.col(j) = (wa1-fvec)/h; 49 | } 50 | 51 | }else { 52 | /* computation of banded approximate jacobian. */ 53 | for (k = 0; k < msum; ++k) { 54 | for (j = k; (msum<0) ? (j>n): (jn): (j(0,j-mu); 69 | length = (std::min)(n-1, j+ml) - start + 1; 70 | fjac.col(j).segment(start, length) = ( wa1.segment(start, length)-fvec.segment(start, length))/h; 71 | } 72 | } 73 | } 74 | return 0; 75 | } 76 | 77 | } // end namespace internal 78 | 79 | } // end namespace Eigen 80 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/doc/examples/PolynomialSolver1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace Eigen; 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | typedef Matrix Vector5d; 11 | 12 | Vector5d roots = Vector5d::Random(); 13 | cout << "Roots: " << roots.transpose() << endl; 14 | Eigen::Matrix polynomial; 15 | roots_to_monicPolynomial( roots, polynomial ); 16 | 17 | PolynomialSolver psolve( polynomial ); 18 | cout << "Complex roots: " << psolve.roots().transpose() << endl; 19 | 20 | std::vector realRoots; 21 | psolve.realRoots( realRoots ); 22 | Map mapRR( &realRoots[0] ); 23 | cout << "Real roots: " << mapRR.transpose() << endl; 24 | 25 | cout << endl; 26 | cout << "Illustration of the convergence problem with the QR algorithm: " << endl; 27 | cout << "---------------------------------------------------------------" << endl; 28 | Eigen::Matrix hardCase_polynomial; 29 | hardCase_polynomial << 30 | -0.957, 0.9219, 0.3516, 0.9453, -0.4023, -0.5508, -0.03125; 31 | cout << "Hard case polynomial defined by floats: " << hardCase_polynomial.transpose() << endl; 32 | PolynomialSolver psolvef( hardCase_polynomial ); 33 | cout << "Complex roots: " << psolvef.roots().transpose() << endl; 34 | Eigen::Matrix evals; 35 | for( int i=0; i<6; ++i ){ evals[i] = std::abs( poly_eval( hardCase_polynomial, psolvef.roots()[i] ) ); } 36 | cout << "Norms of the evaluations of the polynomial at the roots: " << evals.transpose() << endl << endl; 37 | 38 | cout << "Using double's almost always solves the problem for small degrees: " << endl; 39 | cout << "-------------------------------------------------------------------" << endl; 40 | PolynomialSolver psolve6d( hardCase_polynomial.cast() ); 41 | cout << "Complex roots: " << psolve6d.roots().transpose() << endl; 42 | for( int i=0; i<6; ++i ) 43 | { 44 | std::complex castedRoot( psolve6d.roots()[i].real(), psolve6d.roots()[i].imag() ); 45 | evals[i] = std::abs( poly_eval( hardCase_polynomial, castedRoot ) ); 46 | } 47 | cout << "Norms of the evaluations of the polynomial at the roots: " << evals.transpose() << endl << endl; 48 | 49 | cout.precision(10); 50 | cout << "The last root in float then in double: " << psolvef.roots()[5] << "\t" << psolve6d.roots()[5] << endl; 51 | std::complex castedRoot( psolve6d.roots()[5].real(), psolve6d.roots()[5].imag() ); 52 | cout << "Norm of the difference: " << std::abs( psolvef.roots()[5] - castedRoot ) << endl; 53 | } 54 | -------------------------------------------------------------------------------- /libs/mvo/src/frame_handler_base.cpp: -------------------------------------------------------------------------------- 1 | #define NOMINMAX 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace mvo 16 | { 17 | FrameHandlerBase::FrameHandlerBase() : 18 | stage_(STAGE_PAUSED), 19 | set_reset_(false), 20 | set_start_(false), 21 | num_obs_last_(0), 22 | tracking_quality_(TRACKING_INSUFFICIENT) 23 | { 24 | } 25 | 26 | FrameHandlerBase::~FrameHandlerBase() 27 | { 28 | } 29 | 30 | bool FrameHandlerBase::startFrameProcessingCommon(const double timestamp) 31 | { 32 | if (set_start_) 33 | { 34 | resetAll(); 35 | stage_ = STAGE_FIRST_FRAME; 36 | } 37 | 38 | if (stage_ == STAGE_PAUSED) 39 | return false; 40 | 41 | timer_.start(); 42 | 43 | // 对最近一次迭代的清理工作,不在之前做主要是因为可视化 44 | map_.emptyTrash(); 45 | return true; 46 | } 47 | 48 | int FrameHandlerBase::finishFrameProcessingCommon( 49 | const size_t update_id, 50 | const UpdateResult dropout, 51 | const size_t num_observations) 52 | { 53 | std::cout << "Frame: " << update_id << std::endl; 54 | num_obs_last_ = num_observations; 55 | 56 | 57 | if (dropout == RESULT_FAILURE && 58 | (stage_ == STAGE_DEFAULT_FRAME || stage_ == STAGE_RELOCALIZING)) 59 | { 60 | stage_ = STAGE_RELOCALIZING; 61 | tracking_quality_ = TRACKING_INSUFFICIENT; 62 | } 63 | else if (dropout == RESULT_FAILURE) 64 | resetAll(); 65 | if (set_reset_) 66 | resetAll(); 67 | 68 | return 0; 69 | } 70 | 71 | void FrameHandlerBase::resetCommon() 72 | { 73 | map_.reset(); 74 | stage_ = STAGE_PAUSED; 75 | set_reset_ = false; 76 | set_start_ = false; 77 | tracking_quality_ = TRACKING_INSUFFICIENT; 78 | num_obs_last_ = 0; 79 | } 80 | 81 | void FrameHandlerBase::setTrackingQuality(const size_t num_observations) 82 | { 83 | tracking_quality_ = TRACKING_GOOD; 84 | if (num_observations < Config::qualityMinFts()) 85 | { 86 | std::cout << "Tracking less than " << Config::qualityMinFts() << " features!" << std::endl; 87 | tracking_quality_ = TRACKING_INSUFFICIENT; 88 | } 89 | const int feature_drop = static_cast(std::min(num_obs_last_, Config::maxFts())) - num_observations; 90 | if (feature_drop > Config::qualityMaxFtsDrop()) 91 | { 92 | std::cout << "Lost " << feature_drop << " features!" << std::endl; 93 | tracking_quality_ = TRACKING_INSUFFICIENT; 94 | } 95 | } 96 | 97 | } // namespace mvo 98 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/MatrixFunctions/StemFunction.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010 Jitse Niesen 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STEM_FUNCTION 11 | #define EIGEN_STEM_FUNCTION 12 | 13 | namespace Eigen { 14 | 15 | /** \ingroup MatrixFunctions_Module 16 | * \brief Stem functions corresponding to standard mathematical functions. 17 | */ 18 | template 19 | class StdStemFunctions 20 | { 21 | public: 22 | 23 | /** \brief The exponential function (and its derivatives). */ 24 | static Scalar exp(Scalar x, int) 25 | { 26 | return std::exp(x); 27 | } 28 | 29 | /** \brief Cosine (and its derivatives). */ 30 | static Scalar cos(Scalar x, int n) 31 | { 32 | Scalar res; 33 | switch (n % 4) { 34 | case 0: 35 | res = std::cos(x); 36 | break; 37 | case 1: 38 | res = -std::sin(x); 39 | break; 40 | case 2: 41 | res = -std::cos(x); 42 | break; 43 | case 3: 44 | res = std::sin(x); 45 | break; 46 | } 47 | return res; 48 | } 49 | 50 | /** \brief Sine (and its derivatives). */ 51 | static Scalar sin(Scalar x, int n) 52 | { 53 | Scalar res; 54 | switch (n % 4) { 55 | case 0: 56 | res = std::sin(x); 57 | break; 58 | case 1: 59 | res = std::cos(x); 60 | break; 61 | case 2: 62 | res = -std::sin(x); 63 | break; 64 | case 3: 65 | res = -std::cos(x); 66 | break; 67 | } 68 | return res; 69 | } 70 | 71 | /** \brief Hyperbolic cosine (and its derivatives). */ 72 | static Scalar cosh(Scalar x, int n) 73 | { 74 | Scalar res; 75 | switch (n % 2) { 76 | case 0: 77 | res = std::cosh(x); 78 | break; 79 | case 1: 80 | res = std::sinh(x); 81 | break; 82 | } 83 | return res; 84 | } 85 | 86 | /** \brief Hyperbolic sine (and its derivatives). */ 87 | static Scalar sinh(Scalar x, int n) 88 | { 89 | Scalar res; 90 | switch (n % 2) { 91 | case 0: 92 | res = std::sinh(x); 93 | break; 94 | case 1: 95 | res = std::cosh(x); 96 | break; 97 | } 98 | return res; 99 | } 100 | 101 | }; // end of class StdStemFunctions 102 | 103 | } // end namespace Eigen 104 | 105 | #endif // EIGEN_STEM_FUNCTION 106 | -------------------------------------------------------------------------------- /libs/mvo/include/openmvo/mvo/frame_handler_base.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENMVO_MVO_FRAME_HANDLER_BASE_H_ 2 | #define OPENMVO_MVO_FRAME_HANDLER_BASE_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace mvo 10 | { 11 | class Point3D; 12 | class Matcher; 13 | class DepthFilter; 14 | class AbstractCamera; 15 | 16 | /// 视觉里程计帧处理基类,用于管理地图和状态机 17 | class FrameHandlerBase : Noncopyable 18 | { 19 | public: 20 | //算法所处的状态 21 | enum Stage { 22 | STAGE_PAUSED,//暂停 23 | STAGE_FIRST_FRAME,//第一帧 24 | STAGE_SECOND_FRAME,//第二帧 25 | STAGE_DEFAULT_FRAME,//默认帧 26 | STAGE_RELOCALIZING//重新定位 27 | }; 28 | //跟踪质量 29 | enum TrackingQuality { 30 | TRACKING_INSUFFICIENT,//不够跟踪 31 | TRACKING_BAD,//不好的跟踪 32 | TRACKING_GOOD//好的跟踪 33 | }; 34 | //更新结果 35 | enum UpdateResult { 36 | RESULT_NO_KEYFRAME,//不是关键帧 37 | RESULT_IS_KEYFRAME,//是关键帧 38 | RESULT_FAILURE//失败 39 | }; 40 | 41 | FrameHandlerBase(); 42 | 43 | virtual ~FrameHandlerBase(); 44 | 45 | /// 得到当前地图 46 | const Map& map() const { return map_; } 47 | 48 | /// 当前帧处理完成后就重置地图 49 | void reset() { set_reset_ = true; } 50 | 51 | /// 开始处理 52 | void start() { set_start_ = true; } 53 | 54 | /// 得到当前算法所处的阶段 55 | Stage stage() const { return stage_; } 56 | 57 | /// 得到目前跟踪质量 58 | TrackingQuality trackingQuality() const { return tracking_quality_; } 59 | 60 | /// 得到上一次迭代的处理时间 61 | double lastProcessingTime() const { return timer_.getTime(); } 62 | 63 | /// 得到上一帧观察到的特征数目 64 | size_t lastNumObservations() const { return num_obs_last_; } 65 | 66 | protected: 67 | Stage stage_; //!< 算法当前所处的阶段 68 | bool set_reset_; //!< 用户可以设置的标识,表示在下一次迭代之前重新设置系统 69 | bool set_start_; //!< 用户可以设置的标识,表示在获得下一个图像后启动系统 70 | Map map_; //!< 由关键帧构建的地图 71 | Timer timer_; //!< 码表用于测量处理时间 72 | size_t num_obs_last_; //!< 在前一帧中观察到的特征数 73 | TrackingQuality tracking_quality_; //!< 跟踪质量的估计,根据跟踪的特征数 74 | 75 | /// 在帧处理之前,该函数被调用 76 | bool startFrameProcessingCommon(const double timestamp); 77 | 78 | /// 帧处理完成之后,该函数被调用 79 | int finishFrameProcessingCommon( 80 | const size_t update_id, 81 | const UpdateResult dropout, 82 | const size_t num_observations); 83 | 84 | /// 重置的地图和帧的处理程序,从零开始 85 | void resetCommon(); 86 | 87 | /// 重置帧处理程序,在派生类中实现 88 | virtual void resetAll() { resetCommon(); } 89 | 90 | /// 设置跟踪质量,跟踪质量取决于跟踪的特征数 91 | virtual void setTrackingQuality(const size_t num_observations); 92 | 93 | }; 94 | 95 | } // namespace mvo 96 | 97 | #endif // OPENMVO_MVO_FRAME_HANDLER_BASE_H_ 98 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_AUTODIFF_JACOBIAN_H 11 | #define EIGEN_AUTODIFF_JACOBIAN_H 12 | 13 | namespace Eigen 14 | { 15 | 16 | template class AutoDiffJacobian : public Functor 17 | { 18 | public: 19 | AutoDiffJacobian() : Functor() {} 20 | AutoDiffJacobian(const Functor& f) : Functor(f) {} 21 | 22 | // forward constructors 23 | template 24 | AutoDiffJacobian(const T0& a0) : Functor(a0) {} 25 | template 26 | AutoDiffJacobian(const T0& a0, const T1& a1) : Functor(a0, a1) {} 27 | template 28 | AutoDiffJacobian(const T0& a0, const T1& a1, const T2& a2) : Functor(a0, a1, a2) {} 29 | 30 | enum { 31 | InputsAtCompileTime = Functor::InputsAtCompileTime, 32 | ValuesAtCompileTime = Functor::ValuesAtCompileTime 33 | }; 34 | 35 | typedef typename Functor::InputType InputType; 36 | typedef typename Functor::ValueType ValueType; 37 | typedef typename Functor::JacobianType JacobianType; 38 | typedef typename JacobianType::Scalar Scalar; 39 | typedef typename JacobianType::Index Index; 40 | 41 | typedef Matrix DerivativeType; 42 | typedef AutoDiffScalar ActiveScalar; 43 | 44 | 45 | typedef Matrix ActiveInput; 46 | typedef Matrix ActiveValue; 47 | 48 | void operator() (const InputType& x, ValueType* v, JacobianType* _jac=0) const 49 | { 50 | eigen_assert(v!=0); 51 | if (!_jac) 52 | { 53 | Functor::operator()(x, v); 54 | return; 55 | } 56 | 57 | JacobianType& jac = *_jac; 58 | 59 | ActiveInput ax = x.template cast(); 60 | ActiveValue av(jac.rows()); 61 | 62 | if(InputsAtCompileTime==Dynamic) 63 | for (Index j=0; jinputs()); 65 | 66 | for (Index i=0; iinputs(),i); 68 | 69 | Functor::operator()(ax, &av); 70 | 71 | for (Index i=0; i 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_SPARSETRANSPOSE_H 11 | #define EIGEN_SPARSETRANSPOSE_H 12 | 13 | namespace Eigen { 14 | 15 | template class TransposeImpl 16 | : public SparseMatrixBase > 17 | { 18 | typedef typename internal::remove_all::type _MatrixTypeNested; 19 | public: 20 | 21 | EIGEN_SPARSE_PUBLIC_INTERFACE(Transpose ) 22 | 23 | class InnerIterator; 24 | class ReverseInnerIterator; 25 | 26 | inline Index nonZeros() const { return derived().nestedExpression().nonZeros(); } 27 | }; 28 | 29 | // NOTE: VC10 and VC11 trigger an ICE if don't put typename TransposeImpl:: in front of Index, 30 | // a typedef typename TransposeImpl::Index Index; 31 | // does not fix the issue. 32 | // An alternative is to define the nested class in the parent class itself. 33 | template class TransposeImpl::InnerIterator 34 | : public _MatrixTypeNested::InnerIterator 35 | { 36 | typedef typename _MatrixTypeNested::InnerIterator Base; 37 | typedef typename TransposeImpl::Index Index; 38 | public: 39 | 40 | EIGEN_STRONG_INLINE InnerIterator(const TransposeImpl& trans, typename TransposeImpl::Index outer) 41 | : Base(trans.derived().nestedExpression(), outer) 42 | {} 43 | typename TransposeImpl::Index row() const { return Base::col(); } 44 | typename TransposeImpl::Index col() const { return Base::row(); } 45 | }; 46 | 47 | template class TransposeImpl::ReverseInnerIterator 48 | : public _MatrixTypeNested::ReverseInnerIterator 49 | { 50 | typedef typename _MatrixTypeNested::ReverseInnerIterator Base; 51 | typedef typename TransposeImpl::Index Index; 52 | public: 53 | 54 | EIGEN_STRONG_INLINE ReverseInnerIterator(const TransposeImpl& xpr, typename TransposeImpl::Index outer) 55 | : Base(xpr.derived().nestedExpression(), outer) 56 | {} 57 | typename TransposeImpl::Index row() const { return Base::col(); } 58 | typename TransposeImpl::Index col() const { return Base::row(); } 59 | }; 60 | 61 | } // end namespace Eigen 62 | 63 | #endif // EIGEN_SPARSETRANSPOSE_H 64 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/misc/Solve.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Benoit Jacob 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_MISC_SOLVE_H 11 | #define EIGEN_MISC_SOLVE_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | /** \class solve_retval_base 18 | * 19 | */ 20 | template 21 | struct traits > 22 | { 23 | typedef typename DecompositionType::MatrixType MatrixType; 24 | typedef Matrix ReturnType; 30 | }; 31 | 32 | template struct solve_retval_base 33 | : public ReturnByValue > 34 | { 35 | typedef typename remove_all::type RhsNestedCleaned; 36 | typedef _DecompositionType DecompositionType; 37 | typedef ReturnByValue Base; 38 | typedef typename Base::Index Index; 39 | 40 | solve_retval_base(const DecompositionType& dec, const Rhs& rhs) 41 | : m_dec(dec), m_rhs(rhs) 42 | {} 43 | 44 | inline Index rows() const { return m_dec.cols(); } 45 | inline Index cols() const { return m_rhs.cols(); } 46 | inline const DecompositionType& dec() const { return m_dec; } 47 | inline const RhsNestedCleaned& rhs() const { return m_rhs; } 48 | 49 | template inline void evalTo(Dest& dst) const 50 | { 51 | static_cast*>(this)->evalTo(dst); 52 | } 53 | 54 | protected: 55 | const DecompositionType& m_dec; 56 | typename Rhs::Nested m_rhs; 57 | }; 58 | 59 | } // end namespace internal 60 | 61 | #define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType,Rhs) \ 62 | typedef typename DecompositionType::MatrixType MatrixType; \ 63 | typedef typename MatrixType::Scalar Scalar; \ 64 | typedef typename MatrixType::RealScalar RealScalar; \ 65 | typedef typename MatrixType::Index Index; \ 66 | typedef Eigen::internal::solve_retval_base Base; \ 67 | using Base::dec; \ 68 | using Base::rhs; \ 69 | using Base::rows; \ 70 | using Base::cols; \ 71 | solve_retval(const DecompositionType& dec, const Rhs& rhs) \ 72 | : Base(dec, rhs) {} 73 | 74 | } // end namespace Eigen 75 | 76 | #endif // EIGEN_MISC_SOLVE_H 77 | -------------------------------------------------------------------------------- /3rdparty/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMcovar.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // This code initially comes from MINPACK whose original authors are: 5 | // Copyright Jorge More - Argonne National Laboratory 6 | // Copyright Burt Garbow - Argonne National Laboratory 7 | // Copyright Ken Hillstrom - Argonne National Laboratory 8 | // 9 | // This Source Code Form is subject to the terms of the Minpack license 10 | // (a BSD-like license) described in the campaigned CopyrightMINPACK.txt file. 11 | 12 | #ifndef EIGEN_LMCOVAR_H 13 | #define EIGEN_LMCOVAR_H 14 | 15 | namespace Eigen { 16 | 17 | namespace internal { 18 | 19 | template 20 | void covar( 21 | Matrix< Scalar, Dynamic, Dynamic > &r, 22 | const VectorXi& ipvt, 23 | Scalar tol = std::sqrt(NumTraits::epsilon()) ) 24 | { 25 | using std::abs; 26 | typedef DenseIndex Index; 27 | /* Local variables */ 28 | Index i, j, k, l, ii, jj; 29 | bool sing; 30 | Scalar temp; 31 | 32 | /* Function Body */ 33 | const Index n = r.cols(); 34 | const Scalar tolr = tol * abs(r(0,0)); 35 | Matrix< Scalar, Dynamic, 1 > wa(n); 36 | eigen_assert(ipvt.size()==n); 37 | 38 | /* form the inverse of r in the full upper triangle of r. */ 39 | l = -1; 40 | for (k = 0; k < n; ++k) 41 | if (abs(r(k,k)) > tolr) { 42 | r(k,k) = 1. / r(k,k); 43 | for (j = 0; j <= k-1; ++j) { 44 | temp = r(k,k) * r(j,k); 45 | r(j,k) = 0.; 46 | r.col(k).head(j+1) -= r.col(j).head(j+1) * temp; 47 | } 48 | l = k; 49 | } 50 | 51 | /* form the full upper triangle of the inverse of (r transpose)*r */ 52 | /* in the full upper triangle of r. */ 53 | for (k = 0; k <= l; ++k) { 54 | for (j = 0; j <= k-1; ++j) 55 | r.col(j).head(j+1) += r.col(k).head(j+1) * r(j,k); 56 | r.col(k).head(k+1) *= r(k,k); 57 | } 58 | 59 | /* form the full lower triangle of the covariance matrix */ 60 | /* in the strict lower triangle of r and in wa. */ 61 | for (j = 0; j < n; ++j) { 62 | jj = ipvt[j]; 63 | sing = j > l; 64 | for (i = 0; i <= j; ++i) { 65 | if (sing) 66 | r(i,j) = 0.; 67 | ii = ipvt[i]; 68 | if (ii > jj) 69 | r(ii,jj) = r(i,j); 70 | if (ii < jj) 71 | r(jj,ii) = r(i,j); 72 | } 73 | wa[jj] = r(j,j); 74 | } 75 | 76 | /* symmetrize the covariance matrix in r. */ 77 | r.topLeftCorner(n,n).template triangularView() = r.topLeftCorner(n,n).transpose(); 78 | r.diagonal() = wa; 79 | } 80 | 81 | } // end namespace internal 82 | 83 | } // end namespace Eigen 84 | 85 | #endif // EIGEN_LMCOVAR_H 86 | -------------------------------------------------------------------------------- /libs/base/include/openmvo/utils/timer.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * 文件: timer.h 3 | * 时间: 2014/11/09 22:15 4 | * 作者: 冯兵 5 | * 邮件: fengbing123@gmail.com 6 | * 7 | * 说明: 这个类实现了一个高性能的码表. 8 | * 9 | ********************************************************************************/ 10 | #ifndef OPENMVO_UTILS_TIMER_H_ 11 | #define OPENMVO_UTILS_TIMER_H_ 12 | 13 | #include 14 | #ifdef _WIN32 15 | # include 16 | #else 17 | # include 18 | #endif 19 | #include 20 | 21 | namespace mvo 22 | { 23 | 24 | class Timer 25 | { 26 | private: 27 | #ifndef _WIN32 28 | timeval start_time_; 29 | #endif 30 | double time_; 31 | double accumulated_; 32 | 33 | double start_; 34 | #ifdef _WIN32 35 | double frequency_; 36 | #endif 37 | public: 38 | 39 | /// The constructor directly starts the timer. 40 | Timer() : 41 | time_(0.0), 42 | accumulated_(0.0) 43 | { 44 | #ifdef _WIN32 45 | LARGE_INTEGER freq; 46 | if (!QueryPerformanceFrequency(&freq)) 47 | { 48 | const char *msg = "Failed to initialize high resolution timer!"; 49 | std::cerr << msg << std::endl; 50 | throw std::runtime_error(msg); 51 | } 52 | frequency_ = static_cast(freq.QuadPart); 53 | #endif 54 | start(); 55 | } 56 | 57 | ~Timer() 58 | {} 59 | 60 | inline void start() 61 | { 62 | accumulated_ = 0.0; 63 | 64 | #if _WIN32 65 | LARGE_INTEGER li_start_; 66 | QueryPerformanceCounter(&li_start_); 67 | start_ = static_cast(li_start_.QuadPart); 68 | #else 69 | gettimeofday(&start_time_, NULL); 70 | #endif 71 | } 72 | 73 | inline void resume() 74 | { 75 | #if _WIN32 76 | LARGE_INTEGER li_start_; 77 | QueryPerformanceCounter(&li_start_); 78 | start_ = static_cast(li_start_.QuadPart); 79 | #else 80 | gettimeofday(&start_time_, NULL); 81 | #endif 82 | } 83 | 84 | inline double stop() 85 | { 86 | #if _WIN32 87 | LARGE_INTEGER end_; 88 | QueryPerformanceCounter(&end_); 89 | time_ = (static_cast(end_.QuadPart) - start_) / frequency_; 90 | accumulated_ = time_; 91 | return time_; 92 | #else 93 | timeval end_time; 94 | gettimeofday(&end_time, NULL); 95 | long seconds = end_time.tv_sec - start_time_.tv_sec; 96 | long useconds = end_time.tv_usec - start_time_.tv_usec; 97 | time_ = ((seconds) + useconds*0.000001) + accumulated_; 98 | accumulated_ = time_; 99 | return time_; 100 | #endif 101 | } 102 | 103 | inline double getTime() const 104 | { 105 | return time_; 106 | } 107 | 108 | inline void reset() 109 | { 110 | time_ = 0.0; 111 | accumulated_ = 0.0; 112 | } 113 | 114 | }; 115 | 116 | } // end namespace mvo 117 | 118 | #endif // OPENMVO_UTILS_TIMER_H_ 119 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2008-2009 Gael Guennebaud 5 | // Copyright (C) 2006-2008 Benoit Jacob 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | // This file is a base class plugin containing matrix specifics coefficient wise functions. 12 | 13 | /** \returns an expression of the coefficient-wise absolute value of \c *this 14 | * 15 | * Example: \include MatrixBase_cwiseAbs.cpp 16 | * Output: \verbinclude MatrixBase_cwiseAbs.out 17 | * 18 | * \sa cwiseAbs2() 19 | */ 20 | EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> 21 | cwiseAbs() const { return derived(); } 22 | 23 | /** \returns an expression of the coefficient-wise squared absolute value of \c *this 24 | * 25 | * Example: \include MatrixBase_cwiseAbs2.cpp 26 | * Output: \verbinclude MatrixBase_cwiseAbs2.out 27 | * 28 | * \sa cwiseAbs() 29 | */ 30 | EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> 31 | cwiseAbs2() const { return derived(); } 32 | 33 | /** \returns an expression of the coefficient-wise square root of *this. 34 | * 35 | * Example: \include MatrixBase_cwiseSqrt.cpp 36 | * Output: \verbinclude MatrixBase_cwiseSqrt.out 37 | * 38 | * \sa cwisePow(), cwiseSquare() 39 | */ 40 | inline const CwiseUnaryOp, const Derived> 41 | cwiseSqrt() const { return derived(); } 42 | 43 | /** \returns an expression of the coefficient-wise inverse of *this. 44 | * 45 | * Example: \include MatrixBase_cwiseInverse.cpp 46 | * Output: \verbinclude MatrixBase_cwiseInverse.out 47 | * 48 | * \sa cwiseProduct() 49 | */ 50 | inline const CwiseUnaryOp, const Derived> 51 | cwiseInverse() const { return derived(); } 52 | 53 | /** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s 54 | * 55 | * \warning this performs an exact comparison, which is generally a bad idea with floating-point types. 56 | * In order to check for equality between two vectors or matrices with floating-point coefficients, it is 57 | * generally a far better idea to use a fuzzy comparison as provided by isApprox() and 58 | * isMuchSmallerThan(). 59 | * 60 | * \sa cwiseEqual(const MatrixBase &) const 61 | */ 62 | inline const CwiseUnaryOp >, const Derived> 63 | cwiseEqual(const Scalar& s) const 64 | { 65 | return CwiseUnaryOp >,const Derived> 66 | (derived(), std::bind1st(std::equal_to(), s)); 67 | } 68 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Eigen2Support/MathFunctions.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010 Gael Guennebaud 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN2_MATH_FUNCTIONS_H 11 | #define EIGEN2_MATH_FUNCTIONS_H 12 | 13 | namespace Eigen { 14 | 15 | template inline typename NumTraits::Real ei_real(const T& x) { return numext::real(x); } 16 | template inline typename NumTraits::Real ei_imag(const T& x) { return numext::imag(x); } 17 | template inline T ei_conj(const T& x) { return numext::conj(x); } 18 | template inline typename NumTraits::Real ei_abs (const T& x) { using std::abs; return abs(x); } 19 | template inline typename NumTraits::Real ei_abs2(const T& x) { return numext::abs2(x); } 20 | template inline T ei_sqrt(const T& x) { using std::sqrt; return sqrt(x); } 21 | template inline T ei_exp (const T& x) { using std::exp; return exp(x); } 22 | template inline T ei_log (const T& x) { using std::log; return log(x); } 23 | template inline T ei_sin (const T& x) { using std::sin; return sin(x); } 24 | template inline T ei_cos (const T& x) { using std::cos; return cos(x); } 25 | template inline T ei_atan2(const T& x,const T& y) { using std::atan2; return atan2(x,y); } 26 | template inline T ei_pow (const T& x,const T& y) { return numext::pow(x,y); } 27 | template inline T ei_random () { return internal::random(); } 28 | template inline T ei_random (const T& x, const T& y) { return internal::random(x, y); } 29 | 30 | template inline T precision () { return NumTraits::dummy_precision(); } 31 | template inline T machine_epsilon () { return NumTraits::epsilon(); } 32 | 33 | 34 | template 35 | inline bool ei_isMuchSmallerThan(const Scalar& x, const OtherScalar& y, 36 | typename NumTraits::Real precision = NumTraits::dummy_precision()) 37 | { 38 | return internal::isMuchSmallerThan(x, y, precision); 39 | } 40 | 41 | template 42 | inline bool ei_isApprox(const Scalar& x, const Scalar& y, 43 | typename NumTraits::Real precision = NumTraits::dummy_precision()) 44 | { 45 | return internal::isApprox(x, y, precision); 46 | } 47 | 48 | template 49 | inline bool ei_isApproxOrLessThan(const Scalar& x, const Scalar& y, 50 | typename NumTraits::Real precision = NumTraits::dummy_precision()) 51 | { 52 | return internal::isApproxOrLessThan(x, y, precision); 53 | } 54 | 55 | } // end namespace Eigen 56 | 57 | #endif // EIGEN2_MATH_FUNCTIONS_H 58 | -------------------------------------------------------------------------------- /3rdparty/eigen3/Eigen/src/Householder/BlockHouseholder.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2010 Vincent Lejeune 5 | // Copyright (C) 2010 Gael Guennebaud 6 | // 7 | // This Source Code Form is subject to the terms of the Mozilla 8 | // Public License v. 2.0. If a copy of the MPL was not distributed 9 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 10 | 11 | #ifndef EIGEN_BLOCK_HOUSEHOLDER_H 12 | #define EIGEN_BLOCK_HOUSEHOLDER_H 13 | 14 | // This file contains some helper function to deal with block householder reflectors 15 | 16 | namespace Eigen { 17 | 18 | namespace internal { 19 | 20 | /** \internal */ 21 | template 22 | void make_block_householder_triangular_factor(TriangularFactorType& triFactor, const VectorsType& vectors, const CoeffsType& hCoeffs) 23 | { 24 | typedef typename TriangularFactorType::Index Index; 25 | typedef typename VectorsType::Scalar Scalar; 26 | const Index nbVecs = vectors.cols(); 27 | eigen_assert(triFactor.rows() == nbVecs && triFactor.cols() == nbVecs && vectors.rows()>=nbVecs); 28 | 29 | for(Index i = 0; i < nbVecs; i++) 30 | { 31 | Index rs = vectors.rows() - i; 32 | Scalar Vii = vectors(i,i); 33 | vectors.const_cast_derived().coeffRef(i,i) = Scalar(1); 34 | triFactor.col(i).head(i).noalias() = -hCoeffs(i) * vectors.block(i, 0, rs, i).adjoint() 35 | * vectors.col(i).tail(rs); 36 | vectors.const_cast_derived().coeffRef(i, i) = Vii; 37 | // FIXME add .noalias() once the triangular product can work inplace 38 | triFactor.col(i).head(i) = triFactor.block(0,0,i,i).template triangularView() 39 | * triFactor.col(i).head(i); 40 | triFactor(i,i) = hCoeffs(i); 41 | } 42 | } 43 | 44 | /** \internal */ 45 | template 46 | void apply_block_householder_on_the_left(MatrixType& mat, const VectorsType& vectors, const CoeffsType& hCoeffs) 47 | { 48 | typedef typename MatrixType::Index Index; 49 | enum { TFactorSize = MatrixType::ColsAtCompileTime }; 50 | Index nbVecs = vectors.cols(); 51 | Matrix T(nbVecs,nbVecs); 52 | make_block_householder_triangular_factor(T, vectors, hCoeffs); 53 | 54 | const TriangularView& V(vectors); 55 | 56 | // A -= V T V^* A 57 | Matrix tmp = V.adjoint() * mat; 59 | // FIXME add .noalias() once the triangular product can work inplace 60 | tmp = T.template triangularView().adjoint() * tmp; 61 | mat.noalias() -= V * tmp; 62 | } 63 | 64 | } // end namespace internal 65 | 66 | } // end namespace Eigen 67 | 68 | #endif // EIGEN_BLOCK_HOUSEHOLDER_H 69 | --------------------------------------------------------------------------------