├── .clang-format ├── .gitignore ├── CMakeLists.txt ├── README.md ├── applications ├── CMakeLists.txt ├── build_1dsfm_reconstruction.cc ├── build_1dsfm_reconstruction_flags.txt ├── build_reconstruction.cc ├── build_reconstruction_flags.txt ├── calibrate_camera_intrinsics.cc ├── calibrate_camera_intrinsics_flags.txt ├── colorize_reconstruction.cc ├── command_line_helpers.h ├── compare_reconstructions.cc ├── compute_matching_relative_pose_errors.cc ├── compute_reconstruction_statistics.cc ├── compute_two_view_geometry.cc ├── convert_bundle_file.cc ├── convert_nvm_file.cc ├── convert_sift_key_file.cc ├── convert_theia_reconstruction_to_bundler_file.cc ├── create_calibration_file_from_exif.cc ├── create_reconstruction_from_strecha_dataset.cc ├── evaluate_relative_translation_optimization.cc ├── export_colmap_files.cc ├── export_reconstruction_to_pmvs.cc ├── export_to_nvm_file.cc ├── extract_features.cc ├── print_reconstruction_statistics.h ├── undistort_images.cc ├── verify_1dsfm_input.cc ├── view_reconstruction.cc └── write_reconstruction_ply_file.cc ├── cmake ├── FindEigen.cmake ├── FindGflags.cmake ├── FindGlog.cmake ├── FindOpenImageIO.cmake ├── FindRocksDB.cmake ├── FindSphinx.cmake ├── FindSuiteSparse.cmake ├── OptimizeTheiaCompilerFlags.cmake ├── TheiaConfig.cmake.in ├── TheiaConfigVersion.cmake.in └── uninstall.cmake.in ├── data ├── camera_sensor_database.txt ├── camera_sensor_database_license.txt ├── image │ ├── .DS_Store │ ├── descriptor │ │ └── img1.png │ ├── exif.jpg │ ├── gps_exif.jpg │ ├── img1.png │ ├── img2.png │ ├── img3.png │ ├── img4.png │ ├── img5.png │ ├── img6.png │ ├── keypoint_detector │ │ └── img1.png │ └── test1.jpg ├── io │ └── calibration_test.json └── sfm │ ├── fountain11.bin │ ├── fountain11_matches.bin │ └── gt_fountain11.bin ├── docs ├── CMakeLists.txt ├── make_docs.py └── source │ ├── CMakeLists.txt │ ├── _static │ ├── ajax-loader.gif │ ├── basic.css │ ├── comment-bright.png │ ├── comment-close.png │ ├── comment.png │ ├── commit-msg │ ├── default.css │ ├── doctools.js │ ├── down-pressed.png │ ├── down.png │ ├── file.png │ ├── jquery.js │ ├── minus.png │ ├── plus.png │ ├── pygments.css │ ├── rtd.css │ ├── searchtools.js │ ├── sidebar.js │ ├── theia_logo.png │ ├── underscore.js │ ├── up-pressed.png │ ├── up.png │ └── websupport.js │ ├── _templates │ └── layout.html │ ├── api.rst │ ├── applications.rst │ ├── bibliography.rst │ ├── building.rst │ ├── cameras.rst │ ├── conf.py │ ├── contributions.rst │ ├── faq.rst │ ├── features.rst │ ├── global_linear_position_estimation.png │ ├── global_sfm.png │ ├── image.rst │ ├── incremental_sfm.png │ ├── index.rst │ ├── license.rst │ ├── math.rst │ ├── performance.rst │ ├── pisa.png │ ├── pose.rst │ ├── ransac.rst │ ├── releases.rst │ └── sfm.rst ├── include └── theia │ └── theia.h ├── libraries ├── CMakeLists.txt ├── akaze │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── akaze_features.cpp │ ├── akaze_match.cpp │ ├── cimg │ │ ├── CImg.h │ │ ├── CMakeLists.txt │ │ ├── Licence_CeCILL-C_V1-en.txt │ │ ├── Licence_CeCILL_V2-en.txt │ │ ├── README.txt │ │ └── cmake-modules │ │ │ ├── FindBOARD.cmake │ │ │ ├── FindEZMINC.cmake │ │ │ ├── FindFFMPEG.cmake │ │ │ ├── FindFFTW3.cmake │ │ │ ├── FindFFTW3F.cmake │ │ │ ├── FindGTK2.cmake │ │ │ ├── FindHDF5.cmake │ │ │ ├── FindImageMagick.cmake │ │ │ ├── FindJPEG.cmake │ │ │ ├── FindLAPACK.cmake │ │ │ ├── FindMINC.cmake │ │ │ ├── FindNetCDF.cmake │ │ │ ├── FindOpenCV.cmake │ │ │ ├── FindOpenEXR.cmake │ │ │ ├── FindOpenMP.cmake │ │ │ ├── FindPNG.cmake │ │ │ ├── FindTIFF.cmake │ │ │ ├── FindTest.cmake │ │ │ ├── FindX11.cmake │ │ │ └── FindZLIB.cmake │ ├── cmake │ │ ├── CheckSSEFeatures.cmake │ │ ├── FindEigen.cmake │ │ └── OptimizeCompilerFlags.cmake │ ├── datasets │ │ └── iguazu │ │ │ ├── H1to1p │ │ │ ├── H1to2p │ │ │ ├── H1to3p │ │ │ ├── H1to4p │ │ │ ├── H1to5p │ │ │ ├── H1to6p │ │ │ ├── img1.pgm │ │ │ ├── img2.pgm │ │ │ ├── img3.pgm │ │ │ ├── img4.pgm │ │ │ ├── img5.pgm │ │ │ └── img6.pgm │ ├── src │ │ ├── AKAZE.cpp │ │ ├── AKAZE.h │ │ ├── AKAZEConfig.h │ │ ├── convolution.cpp │ │ ├── convolution.h │ │ ├── fed.cpp │ │ ├── fed.h │ │ ├── nldiffusion_functions.cpp │ │ ├── nldiffusion_functions.h │ │ ├── utils.cpp │ │ └── utils.h │ └── timer │ │ ├── CMakeLists.txt │ │ ├── timer.cpp │ │ └── timer.hpp ├── cereal │ ├── .gitignore │ ├── .travis.yml │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── doc │ │ ├── DoxygenLayout.xml │ │ ├── doxygen.in │ │ ├── footer.html │ │ └── mainpage.dox │ ├── include │ │ └── cereal │ │ │ ├── access.hpp │ │ │ ├── archives │ │ │ ├── adapters.hpp │ │ │ ├── binary.hpp │ │ │ ├── json.hpp │ │ │ ├── portable_binary.hpp │ │ │ └── xml.hpp │ │ │ ├── cereal.hpp │ │ │ ├── details │ │ │ ├── helpers.hpp │ │ │ ├── polymorphic_impl.hpp │ │ │ ├── polymorphic_impl_fwd.hpp │ │ │ ├── static_object.hpp │ │ │ ├── traits.hpp │ │ │ └── util.hpp │ │ │ ├── external │ │ │ ├── base64.hpp │ │ │ ├── rapidjson │ │ │ │ ├── allocators.h │ │ │ │ ├── document.h │ │ │ │ ├── encodedstream.h │ │ │ │ ├── encodings.h │ │ │ │ ├── error │ │ │ │ │ ├── en.h │ │ │ │ │ └── error.h │ │ │ │ ├── filereadstream.h │ │ │ │ ├── filewritestream.h │ │ │ │ ├── fwd.h │ │ │ │ ├── internal │ │ │ │ │ ├── biginteger.h │ │ │ │ │ ├── diyfp.h │ │ │ │ │ ├── dtoa.h │ │ │ │ │ ├── ieee754.h │ │ │ │ │ ├── itoa.h │ │ │ │ │ ├── meta.h │ │ │ │ │ ├── pow10.h │ │ │ │ │ ├── regex.h │ │ │ │ │ ├── stack.h │ │ │ │ │ ├── strfunc.h │ │ │ │ │ ├── strtod.h │ │ │ │ │ └── swap.h │ │ │ │ ├── istreamwrapper.h │ │ │ │ ├── memorybuffer.h │ │ │ │ ├── memorystream.h │ │ │ │ ├── msinttypes │ │ │ │ │ ├── inttypes.h │ │ │ │ │ └── stdint.h │ │ │ │ ├── ostreamwrapper.h │ │ │ │ ├── pointer.h │ │ │ │ ├── prettywriter.h │ │ │ │ ├── rapidjson.h │ │ │ │ ├── reader.h │ │ │ │ ├── schema.h │ │ │ │ ├── stream.h │ │ │ │ ├── stringbuffer.h │ │ │ │ └── writer.h │ │ │ └── rapidxml │ │ │ │ ├── license.txt │ │ │ │ ├── manual.html │ │ │ │ ├── rapidxml.hpp │ │ │ │ ├── rapidxml_iterators.hpp │ │ │ │ ├── rapidxml_print.hpp │ │ │ │ └── rapidxml_utils.hpp │ │ │ ├── macros.hpp │ │ │ └── types │ │ │ ├── array.hpp │ │ │ ├── base_class.hpp │ │ │ ├── bitset.hpp │ │ │ ├── boost_variant.hpp │ │ │ ├── chrono.hpp │ │ │ ├── common.hpp │ │ │ ├── complex.hpp │ │ │ ├── concepts │ │ │ └── pair_associative_container.hpp │ │ │ ├── deque.hpp │ │ │ ├── forward_list.hpp │ │ │ ├── functional.hpp │ │ │ ├── list.hpp │ │ │ ├── map.hpp │ │ │ ├── memory.hpp │ │ │ ├── polymorphic.hpp │ │ │ ├── queue.hpp │ │ │ ├── set.hpp │ │ │ ├── stack.hpp │ │ │ ├── string.hpp │ │ │ ├── tuple.hpp │ │ │ ├── unordered_map.hpp │ │ │ ├── unordered_set.hpp │ │ │ ├── utility.hpp │ │ │ ├── valarray.hpp │ │ │ └── vector.hpp │ ├── sandbox │ │ ├── CMakeLists.txt │ │ ├── performance.cpp │ │ ├── sandbox.cpp │ │ ├── sandbox_json.cpp │ │ ├── sandbox_rtti.cpp │ │ ├── sandbox_shared_lib │ │ │ ├── CMakeLists.txt │ │ │ ├── base.cpp │ │ │ ├── base.hpp │ │ │ ├── derived.cpp │ │ │ └── derived.hpp │ │ └── sandbox_vs.cpp │ ├── scripts │ │ ├── renameincludes.sh │ │ ├── updatecoverage.sh │ │ └── updatedoc.in │ ├── unittests │ │ ├── CMakeLists.txt │ │ ├── array.cpp │ │ ├── basic_string.cpp │ │ ├── bitset.cpp │ │ ├── boost_variant.cpp │ │ ├── chrono.cpp │ │ ├── cmake-config-module.cmake │ │ ├── common.hpp │ │ ├── complex.cpp │ │ ├── deque.cpp │ │ ├── forward_list.cpp │ │ ├── list.cpp │ │ ├── load_construct.cpp │ │ ├── map.cpp │ │ ├── memory.cpp │ │ ├── memory_cycles.cpp │ │ ├── multimap.cpp │ │ ├── multiset.cpp │ │ ├── pair.cpp │ │ ├── pod.cpp │ │ ├── polymorphic.cpp │ │ ├── portability_test.cpp │ │ ├── portable_binary_archive.cpp │ │ ├── priority_queue.cpp │ │ ├── queue.cpp │ │ ├── run_portability_test.sh │ │ ├── run_valgrind.sh │ │ ├── set.cpp │ │ ├── stack.cpp │ │ ├── structs.cpp │ │ ├── structs_minimal.cpp │ │ ├── structs_specialized.cpp │ │ ├── tuple.cpp │ │ ├── unordered_loads.cpp │ │ ├── unordered_map.cpp │ │ ├── unordered_multimap.cpp │ │ ├── unordered_multiset.cpp │ │ ├── unordered_set.cpp │ │ ├── user_data_adapters.cpp │ │ ├── valarray.cpp │ │ ├── vector.cpp │ │ └── versioning.cpp │ └── vs2013 │ │ ├── .gitignore │ │ ├── sandbox │ │ ├── sandbox.vcxproj │ │ └── sandbox.vcxproj.filters │ │ ├── sandbox_json │ │ ├── sandbox_json.vcxproj │ │ └── sandbox_json.vcxproj.filters │ │ ├── sandbox_rtti │ │ ├── sandbox_rtti.vcxproj │ │ └── sandbox_rtti.vcxproj.filters │ │ ├── sandbox_vs │ │ ├── sandbox_vs.vcxproj │ │ └── sandbox_vs.vcxproj.filters │ │ ├── sandbox_vs_dll │ │ ├── sandbox_vs_dll.vcxproj │ │ └── sandbox_vs_dll.vcxproj.filters │ │ ├── unittests │ │ ├── main.cpp │ │ ├── unittests.vcxproj │ │ └── unittests.vcxproj.filters │ │ └── vs2013.sln ├── flann │ ├── CMakeLists.txt │ ├── COPYING │ ├── ChangeLog │ ├── README.md │ ├── bin │ │ ├── download_checkmd5.py │ │ ├── indent.sh │ │ ├── make_release.sh │ │ ├── run_test.py │ │ └── uncrustify.cfg │ ├── cmake │ │ ├── CMakeLists.txt │ │ ├── FindFlann.cmake │ │ ├── UseLATEX.cmake │ │ ├── flann.pc.in │ │ ├── flann_utils.cmake │ │ └── uninstall_target.cmake.in │ ├── doc │ │ ├── CMakeLists.txt │ │ ├── images │ │ │ └── cmake-gui.png │ │ ├── manual.tex │ │ └── references.bib │ ├── examples │ │ ├── CMakeLists.txt │ │ ├── README │ │ ├── flann_example.c │ │ ├── flann_example.cpp │ │ └── flann_example_mpi.cpp │ ├── src │ │ ├── CMakeLists.txt │ │ ├── cpp │ │ │ ├── CMakeLists.txt │ │ │ ├── empty.cpp │ │ │ └── flann │ │ │ │ ├── algorithms │ │ │ │ ├── all_indices.h │ │ │ │ ├── autotuned_index.h │ │ │ │ ├── center_chooser.h │ │ │ │ ├── composite_index.h │ │ │ │ ├── dist.h │ │ │ │ ├── hierarchical_clustering_index.h │ │ │ │ ├── kdtree_cuda_3d_index.cu │ │ │ │ ├── kdtree_cuda_3d_index.h │ │ │ │ ├── kdtree_cuda_builder.h │ │ │ │ ├── kdtree_index.h │ │ │ │ ├── kdtree_single_index.h │ │ │ │ ├── kmeans_index.h │ │ │ │ ├── linear_index.h │ │ │ │ ├── lsh_index.h │ │ │ │ └── nn_index.h │ │ │ │ ├── config.h │ │ │ │ ├── config.h.in │ │ │ │ ├── defines.h │ │ │ │ ├── ext │ │ │ │ ├── lz4.c │ │ │ │ ├── lz4.h │ │ │ │ ├── lz4hc.c │ │ │ │ └── lz4hc.h │ │ │ │ ├── flann.cpp │ │ │ │ ├── flann.h │ │ │ │ ├── flann.hpp │ │ │ │ ├── flann_cpp.cpp │ │ │ │ ├── general.h │ │ │ │ ├── io │ │ │ │ └── hdf5.h │ │ │ │ ├── mpi │ │ │ │ ├── client.h │ │ │ │ ├── flann_mpi_client.cpp │ │ │ │ ├── flann_mpi_server.cpp │ │ │ │ ├── index.h │ │ │ │ ├── matrix.h │ │ │ │ ├── queries.h │ │ │ │ └── server.h │ │ │ │ ├── nn │ │ │ │ ├── ground_truth.h │ │ │ │ ├── index_testing.h │ │ │ │ └── simplex_downhill.h │ │ │ │ └── util │ │ │ │ ├── allocator.h │ │ │ │ ├── any.h │ │ │ │ ├── cuda │ │ │ │ ├── heap.h │ │ │ │ └── result_set.h │ │ │ │ ├── cutil_math.h │ │ │ │ ├── dynamic_bitset.h │ │ │ │ ├── heap.h │ │ │ │ ├── logger.h │ │ │ │ ├── lsh_table.h │ │ │ │ ├── matrix.h │ │ │ │ ├── object_factory.h │ │ │ │ ├── params.h │ │ │ │ ├── random.h │ │ │ │ ├── result_set.h │ │ │ │ ├── sampling.h │ │ │ │ ├── saving.h │ │ │ │ ├── serialization.h │ │ │ │ └── timer.h │ │ ├── matlab │ │ │ ├── CMakeLists.txt │ │ │ ├── flann_build_index.m │ │ │ ├── flann_free_index.m │ │ │ ├── flann_load_index.m │ │ │ ├── flann_save_index.m │ │ │ ├── flann_search.m │ │ │ ├── flann_set_distance_type.m │ │ │ ├── nearest_neighbors.cpp │ │ │ └── test_flann.m │ │ ├── python │ │ │ ├── CMakeLists.txt │ │ │ ├── pyflann │ │ │ │ ├── __init__.py │ │ │ │ ├── exceptions.py │ │ │ │ ├── flann_ctypes.py │ │ │ │ └── index.py │ │ │ └── setup.py.tpl │ │ └── ruby │ │ │ ├── Gemfile │ │ │ ├── LICENSE.txt │ │ │ ├── Manifest.txt │ │ │ ├── Rakefile │ │ │ ├── flann.gemspec │ │ │ ├── lib │ │ │ ├── flann.rb │ │ │ └── flann │ │ │ │ ├── index.rb │ │ │ │ └── version.rb │ │ │ └── spec │ │ │ ├── flann_spec.rb │ │ │ ├── index_spec.rb │ │ │ ├── spec_helper.rb │ │ │ └── test.dataset │ └── test │ │ ├── CMakeLists.txt │ │ ├── flann_autotuned_test.cpp │ │ ├── flann_cuda_test.cu │ │ ├── flann_hierarchical_test.cpp │ │ ├── flann_kdtree_single_test.cpp │ │ ├── flann_kdtree_test.cpp │ │ ├── flann_kmeans_test.cpp │ │ ├── flann_linear_test.cpp │ │ ├── flann_lsh_test.cpp │ │ ├── flann_multithreaded_test.cpp │ │ ├── flann_tests.h │ │ ├── memusage_clustering.py │ │ ├── memusage_nn.py │ │ ├── test_clustering.py │ │ ├── test_index_save.py │ │ ├── test_nn.py │ │ ├── test_nn_autotune.py │ │ └── test_nn_index.py ├── gtest │ ├── CHANGES │ ├── CMakeLists.txt │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── Makefile.am │ ├── README.md │ ├── build-aux │ │ └── .keep │ ├── cmake │ │ └── internal_utils.cmake │ ├── codegear │ │ ├── gtest.cbproj │ │ ├── gtest.groupproj │ │ ├── gtest_all.cc │ │ ├── gtest_link.cc │ │ ├── gtest_main.cbproj │ │ └── gtest_unittest.cbproj │ ├── configure.ac │ ├── docs │ │ ├── AdvancedGuide.md │ │ ├── DevGuide.md │ │ ├── Documentation.md │ │ ├── FAQ.md │ │ ├── Primer.md │ │ ├── PumpManual.md │ │ ├── Samples.md │ │ ├── V1_5_AdvancedGuide.md │ │ ├── V1_5_Documentation.md │ │ ├── V1_5_FAQ.md │ │ ├── V1_5_Primer.md │ │ ├── V1_5_PumpManual.md │ │ ├── V1_5_XcodeGuide.md │ │ ├── V1_6_AdvancedGuide.md │ │ ├── V1_6_Documentation.md │ │ ├── V1_6_FAQ.md │ │ ├── V1_6_Primer.md │ │ ├── V1_6_PumpManual.md │ │ ├── V1_6_Samples.md │ │ ├── V1_6_XcodeGuide.md │ │ ├── V1_7_AdvancedGuide.md │ │ ├── V1_7_Documentation.md │ │ ├── V1_7_FAQ.md │ │ ├── V1_7_Primer.md │ │ ├── V1_7_PumpManual.md │ │ ├── V1_7_Samples.md │ │ ├── V1_7_XcodeGuide.md │ │ └── XcodeGuide.md │ ├── include │ │ └── gtest │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-param-test.h.pump │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-tuple.h │ │ │ ├── gtest-tuple.h.pump │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ ├── m4 │ │ ├── acx_pthread.m4 │ │ └── gtest.m4 │ ├── make │ │ └── Makefile │ ├── msvc │ │ ├── gtest-md.sln │ │ ├── gtest-md.vcproj │ │ ├── gtest.sln │ │ ├── gtest.vcproj │ │ ├── gtest_main-md.vcproj │ │ ├── gtest_main.vcproj │ │ ├── gtest_prod_test-md.vcproj │ │ ├── gtest_prod_test.vcproj │ │ ├── gtest_unittest-md.vcproj │ │ └── gtest_unittest.vcproj │ ├── samples │ │ ├── prime_tables.h │ │ ├── sample1.cc │ │ ├── sample1.h │ │ ├── sample10_unittest.cc │ │ ├── sample1_unittest.cc │ │ ├── sample2.cc │ │ ├── sample2.h │ │ ├── sample2_unittest.cc │ │ ├── sample3-inl.h │ │ ├── sample3_unittest.cc │ │ ├── sample4.cc │ │ ├── sample4.h │ │ ├── sample4_unittest.cc │ │ ├── sample5_unittest.cc │ │ ├── sample6_unittest.cc │ │ ├── sample7_unittest.cc │ │ ├── sample8_unittest.cc │ │ └── sample9_unittest.cc │ ├── scripts │ │ ├── common.py │ │ ├── fuse_gtest_files.py │ │ ├── gen_gtest_pred_impl.py │ │ ├── gtest-config.in │ │ ├── pump.py │ │ ├── release_docs.py │ │ ├── test │ │ │ └── Makefile │ │ ├── upload.py │ │ └── upload_gtest.py │ ├── src │ │ ├── gtest-all.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc │ ├── test │ │ ├── gtest-death-test_ex_test.cc │ │ ├── gtest-death-test_test.cc │ │ ├── gtest-filepath_test.cc │ │ ├── gtest-linked_ptr_test.cc │ │ ├── gtest-listener_test.cc │ │ ├── gtest-message_test.cc │ │ ├── gtest-options_test.cc │ │ ├── gtest-param-test2_test.cc │ │ ├── gtest-param-test_test.cc │ │ ├── gtest-param-test_test.h │ │ ├── gtest-port_test.cc │ │ ├── gtest-printers_test.cc │ │ ├── gtest-test-part_test.cc │ │ ├── gtest-tuple_test.cc │ │ ├── gtest-typed-test2_test.cc │ │ ├── gtest-typed-test_test.cc │ │ ├── gtest-typed-test_test.h │ │ ├── gtest-unittest-api_test.cc │ │ ├── gtest_all_test.cc │ │ ├── gtest_break_on_failure_unittest.py │ │ ├── gtest_break_on_failure_unittest_.cc │ │ ├── gtest_catch_exceptions_test.py │ │ ├── gtest_catch_exceptions_test_.cc │ │ ├── gtest_color_test.py │ │ ├── gtest_color_test_.cc │ │ ├── gtest_env_var_test.py │ │ ├── gtest_env_var_test_.cc │ │ ├── gtest_environment_test.cc │ │ ├── gtest_filter_unittest.py │ │ ├── gtest_filter_unittest_.cc │ │ ├── gtest_help_test.py │ │ ├── gtest_help_test_.cc │ │ ├── gtest_list_tests_unittest.py │ │ ├── gtest_list_tests_unittest_.cc │ │ ├── gtest_main_unittest.cc │ │ ├── gtest_no_test_unittest.cc │ │ ├── gtest_output_test.py │ │ ├── gtest_output_test_.cc │ │ ├── gtest_output_test_golden_lin.txt │ │ ├── gtest_pred_impl_unittest.cc │ │ ├── gtest_premature_exit_test.cc │ │ ├── gtest_prod_test.cc │ │ ├── gtest_repeat_test.cc │ │ ├── gtest_shuffle_test.py │ │ ├── gtest_shuffle_test_.cc │ │ ├── gtest_sole_header_test.cc │ │ ├── gtest_stress_test.cc │ │ ├── gtest_test_utils.py │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ ├── gtest_throw_on_failure_test.py │ │ ├── gtest_throw_on_failure_test_.cc │ │ ├── gtest_uninitialized_test.py │ │ ├── gtest_uninitialized_test_.cc │ │ ├── gtest_unittest.cc │ │ ├── gtest_xml_outfile1_test_.cc │ │ ├── gtest_xml_outfile2_test_.cc │ │ ├── gtest_xml_outfiles_test.py │ │ ├── gtest_xml_output_unittest.py │ │ ├── gtest_xml_output_unittest_.cc │ │ ├── gtest_xml_test_utils.py │ │ ├── production.cc │ │ └── production.h │ └── xcode │ │ ├── Config │ │ ├── DebugProject.xcconfig │ │ ├── FrameworkTarget.xcconfig │ │ ├── General.xcconfig │ │ ├── ReleaseProject.xcconfig │ │ ├── StaticLibraryTarget.xcconfig │ │ └── TestTarget.xcconfig │ │ ├── Resources │ │ └── Info.plist │ │ ├── Samples │ │ └── FrameworkSample │ │ │ ├── Info.plist │ │ │ ├── WidgetFramework.xcodeproj │ │ │ └── project.pbxproj │ │ │ ├── runtests.sh │ │ │ ├── widget.cc │ │ │ ├── widget.h │ │ │ └── widget_test.cc │ │ ├── Scripts │ │ ├── runtests.sh │ │ └── versiongenerate.py │ │ └── gtest.xcodeproj │ │ └── project.pbxproj ├── optimo │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ └── optimo │ │ ├── CMakeLists.txt │ │ ├── core │ │ ├── CMakeLists.txt │ │ ├── numerical_gradient.h │ │ ├── numerical_gradient_tests.cc │ │ ├── numerical_hessian.h │ │ ├── numerical_hessian_tests.cc │ │ ├── objects.h │ │ ├── objects_ls.h │ │ └── objects_tests.cc │ │ ├── solvers │ │ ├── CMakeLists.txt │ │ ├── bfgs.h │ │ ├── bfgs_api.h │ │ ├── bfgs_impl.h │ │ ├── bfgs_tests.cc │ │ ├── gradient_descent.h │ │ ├── gradient_descent_tests.cc │ │ ├── newton.h │ │ ├── newton_api.h │ │ ├── newton_impl.h │ │ ├── newton_tests.cc │ │ ├── primal_dual_lp.h │ │ ├── primal_dual_lp_api.h │ │ ├── primal_dual_lp_impl.h │ │ ├── primal_dual_lp_tests.cc │ │ ├── primal_dual_qp.h │ │ ├── primal_dual_qp_api.h │ │ ├── primal_dual_qp_impl.h │ │ ├── primal_dual_qp_tests.cc │ │ ├── solver.h │ │ ├── sparse_primal_dual_lp.h │ │ ├── sparse_primal_dual_lp_api.h │ │ ├── sparse_primal_dual_lp_impl.h │ │ ├── sparse_primal_dual_lp_tests.cc │ │ ├── sparse_primal_dual_qp.h │ │ ├── sparse_primal_dual_qp_api.h │ │ ├── sparse_primal_dual_qp_impl.h │ │ └── sparse_primal_dual_qp_tests.cc │ │ └── utils │ │ └── matrix_utils.h ├── spectra │ ├── .gitignore │ ├── .travis.yml │ ├── AUTHORS.md │ ├── CHANGELOG.md │ ├── README.md │ ├── benchmark │ │ ├── ArpackFun.h │ │ ├── Cpp.cpp │ │ ├── F77.cpp │ │ ├── Makefile │ │ ├── main.cpp │ │ ├── result_analyzer.R │ │ ├── timer.h │ │ └── wrapper.f │ ├── doxygen │ │ ├── Doxyfile │ │ └── Overview.md │ ├── include │ │ ├── GenEigsComplexShiftSolver.h │ │ ├── GenEigsRealShiftSolver.h │ │ ├── GenEigsSolver.h │ │ ├── LinAlg │ │ │ ├── DoubleShiftQR.h │ │ │ ├── TridiagEigen.h │ │ │ ├── UpperHessenbergEigen.h │ │ │ └── UpperHessenbergQR.h │ │ ├── MatOp │ │ │ ├── DenseCholesky.h │ │ │ ├── DenseGenComplexShiftSolve.h │ │ │ ├── DenseGenMatProd.h │ │ │ ├── DenseGenRealShiftSolve.h │ │ │ ├── DenseSymMatProd.h │ │ │ ├── DenseSymShiftSolve.h │ │ │ ├── SparseCholesky.h │ │ │ ├── SparseGenMatProd.h │ │ │ ├── SparseGenRealShiftSolve.h │ │ │ ├── SparseRegularInverse.h │ │ │ ├── SparseSymMatProd.h │ │ │ ├── SparseSymShiftSolve.h │ │ │ └── internal │ │ │ │ ├── SymGEigsCholeskyOp.h │ │ │ │ └── SymGEigsRegInvOp.h │ │ ├── SymEigsShiftSolver.h │ │ ├── SymEigsSolver.h │ │ ├── SymGEigsSolver.h │ │ └── Util │ │ │ ├── CompInfo.h │ │ │ ├── GEigsMode.h │ │ │ ├── SelectionRule.h │ │ │ └── SimpleRandom.h │ └── test │ │ ├── Eigen.cpp │ │ ├── GenEigs.cpp │ │ ├── GenEigsComplexShift.cpp │ │ ├── GenEigsRealShift.cpp │ │ ├── Makefile │ │ ├── QR.cpp │ │ ├── SymEigs.cpp │ │ ├── SymEigsShift.cpp │ │ ├── SymGEigsCholesky.cpp │ │ ├── SymGEigsRegInv.cpp │ │ └── catch.hpp ├── statx │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── libraries │ │ └── burkardt_spec_funcs │ │ │ ├── LICENSE │ │ │ ├── asa103.cpp │ │ │ ├── asa103.hpp │ │ │ ├── asa121.cpp │ │ │ └── asa121.hpp │ └── statx │ │ ├── CMakeLists.txt │ │ ├── distributions │ │ ├── CMakeLists.txt │ │ ├── evd │ │ │ ├── CMakeLists.txt │ │ │ ├── common.h │ │ │ ├── gev.cc │ │ │ ├── gev.h │ │ │ ├── gev_ceres.cc │ │ │ ├── gev_ceres.h │ │ │ ├── gev_mle.cc │ │ │ ├── gev_mle.h │ │ │ ├── gev_tests.cc │ │ │ ├── gpd.cc │ │ │ ├── gpd.h │ │ │ ├── gpd_ceres.cc │ │ │ ├── gpd_ceres.h │ │ │ ├── gpd_mle.cc │ │ │ ├── gpd_mle.h │ │ │ └── gpd_tests.cc │ │ ├── gamma.cc │ │ ├── gamma.h │ │ ├── gamma_tests.cc │ │ ├── rayleigh.h │ │ └── rayleigh_tests.cc │ │ └── utils │ │ ├── CMakeLists.txt │ │ ├── common_funcs.h │ │ ├── common_funcs_tests.cc │ │ ├── ecdf.cc │ │ ├── ecdf.h │ │ └── ecdf_tests.cc ├── stlplus3 │ ├── .DS_Store │ ├── CMakeLists.txt │ ├── file_system.cpp │ ├── file_system.hpp │ ├── portability_fixes.cpp │ ├── portability_fixes.hpp │ ├── wildcard.cpp │ └── wildcard.hpp ├── visual_sfm │ ├── CMakeLists.txt │ ├── DataInterface.h │ ├── FeaturePoints.cpp │ ├── FeaturePoints.h │ ├── MatchFile.cpp │ ├── MatchFile.h │ ├── points.h │ └── util.h └── vlfeat │ ├── CMakeLists.txt │ └── vl │ ├── fisher.c │ ├── fisher.h │ ├── float.th │ ├── generic.c │ ├── generic.h │ ├── gmm.c │ ├── gmm.h │ ├── heap-def.h │ ├── host.c │ ├── host.h │ ├── imopv.c │ ├── imopv.h │ ├── imopv_sse2.c │ ├── imopv_sse2.h │ ├── kdtree.c │ ├── kdtree.h │ ├── kmeans.c │ ├── kmeans.h │ ├── mathop.c │ ├── mathop.h │ ├── mathop_avx.h │ ├── mathop_sse2.c │ ├── mathop_sse2.h │ ├── mser.c │ ├── mser.h │ ├── qsort-def.h │ ├── random.c │ ├── random.h │ ├── shuffle-def.h │ ├── sift.c │ ├── sift.h │ ├── vlad.c │ └── vlad.h ├── license.txt └── src └── theia ├── CMakeLists.txt ├── alignment └── alignment.h ├── image ├── descriptor │ ├── akaze_descriptor.cc │ ├── akaze_descriptor.h │ ├── akaze_descriptor_test.cc │ ├── create_descriptor_extractor.cc │ ├── create_descriptor_extractor.h │ ├── descriptor_extractor.cc │ ├── descriptor_extractor.h │ ├── sift_descriptor.cc │ ├── sift_descriptor.h │ └── sift_descriptor_test.cc ├── image.cc ├── image.h ├── image_cache.cc ├── image_cache.h ├── image_test.cc └── keypoint_detector │ ├── keypoint.h │ ├── keypoint_detector.h │ ├── sift_detector.cc │ ├── sift_detector.h │ ├── sift_detector_test.cc │ └── sift_parameters.h ├── io ├── bundler_file_reader.cc ├── bundler_file_reader.h ├── eigen_serializable.h ├── import_nvm_file.cc ├── import_nvm_file.h ├── populate_image_sizes.cc ├── populate_image_sizes.h ├── read_1dsfm.cc ├── read_1dsfm.h ├── read_bundler_files.cc ├── read_bundler_files.h ├── read_calibration.cc ├── read_calibration.h ├── read_calibration_test.cc ├── read_keypoints_and_descriptors.cc ├── read_keypoints_and_descriptors.h ├── read_strecha_dataset.cc ├── read_strecha_dataset.h ├── reconstruction_reader.cc ├── reconstruction_reader.h ├── reconstruction_writer.cc ├── reconstruction_writer.h ├── sift_binary_file.cc ├── sift_binary_file.h ├── sift_text_file.cc ├── sift_text_file.h ├── write_bundler_files.cc ├── write_bundler_files.h ├── write_calibration.cc ├── write_calibration.h ├── write_calibration_test.cc ├── write_colmap_files.cc ├── write_colmap_files.h ├── write_keypoints_and_descriptors.cc ├── write_keypoints_and_descriptors.h ├── write_nvm_file.cc ├── write_nvm_file.h ├── write_ply_file.cc └── write_ply_file.h ├── matching ├── brute_force_feature_matcher.cc ├── brute_force_feature_matcher.h ├── brute_force_feature_matcher_test.cc ├── cascade_hasher.cc ├── cascade_hasher.h ├── cascade_hashing_feature_matcher.cc ├── cascade_hashing_feature_matcher.h ├── cascade_hashing_feature_matcher_test.cc ├── create_feature_matcher.cc ├── create_feature_matcher.h ├── distance.h ├── distance_test.cc ├── feature_correspondence.h ├── feature_correspondence_test.cc ├── feature_matcher.cc ├── feature_matcher.h ├── feature_matcher_options.h ├── feature_matcher_utils.cc ├── feature_matcher_utils.h ├── feature_matcher_utils_test.cc ├── features_and_matches_database.h ├── fisher_vector_extractor.cc ├── fisher_vector_extractor.h ├── global_descriptor_extractor.h ├── guided_epipolar_matcher.cc ├── guided_epipolar_matcher.h ├── guided_epipolar_matcher_test.cc ├── image_pair_match.h ├── in_memory_features_and_matches_database.cc ├── in_memory_features_and_matches_database.h ├── indexed_feature_match.h ├── keypoints_and_descriptors.h ├── local_features_and_matches_database.cc ├── local_features_and_matches_database.h ├── rocksdb_features_and_matches_database.cc ├── rocksdb_features_and_matches_database.h └── rocksdb_features_and_matches_database_test.cc ├── math ├── closed_form_polynomial_solver.cc ├── closed_form_polynomial_solver.h ├── closed_form_polynomial_solver_test.cc ├── constrained_l1_solver.cc ├── constrained_l1_solver.h ├── distribution.h ├── find_polynomial_roots_companion_matrix.cc ├── find_polynomial_roots_companion_matrix.h ├── find_polynomial_roots_companion_matrix_test.cc ├── find_polynomial_roots_jenkins_traub.cc ├── find_polynomial_roots_jenkins_traub.h ├── find_polynomial_roots_jenkins_traub_test.cc ├── graph │ ├── connected_components.h │ ├── connected_components_test.cc │ ├── minimum_spanning_tree.h │ ├── minimum_spanning_tree_test.cc │ ├── normalized_graph_cut.h │ ├── normalized_graph_cut_test.cc │ ├── triplet_extractor.h │ └── triplet_extractor_test.cc ├── histogram.h ├── l1_solver.h ├── l1_solver_test.cc ├── matrix │ ├── gauss_jordan.h │ ├── gauss_jordan_test.cc │ ├── linear_operator.h │ ├── rq_decomposition.h │ ├── rq_decomposition_test.cc │ ├── sparse_cholesky_llt.cc │ ├── sparse_cholesky_llt.h │ ├── sparse_matrix.cc │ ├── sparse_matrix.h │ └── spectra_linear_operator.h ├── polynomial.cc ├── polynomial.h ├── polynomial_test.cc ├── probability │ ├── sequential_probability_ratio.cc │ ├── sequential_probability_ratio.h │ └── sprt_test.cc ├── qp_solver.cc ├── qp_solver.h ├── qp_solver_test.cc ├── reservoir_sampler.h ├── reservoir_sampler_test.cc ├── rotation.cc ├── rotation.h ├── rotation_test.cc └── util.h ├── sfm ├── bundle_adjustment │ ├── angular_epipolar_error.h │ ├── bundle_adjust_two_views.cc │ ├── bundle_adjust_two_views.h │ ├── bundle_adjuster.cc │ ├── bundle_adjuster.h │ ├── bundle_adjustment.cc │ ├── bundle_adjustment.h │ ├── create_loss_function.cc │ ├── create_loss_function.h │ ├── optimize_relative_position_with_known_rotation.cc │ ├── optimize_relative_position_with_known_rotation.h │ ├── optimize_relative_position_with_known_rotation_test.cc │ ├── orthogonal_vector_error.h │ └── unit_norm_three_vector_parameterization.h ├── camera │ ├── camera.cc │ ├── camera.h │ ├── camera_intrinsics_model.cc │ ├── camera_intrinsics_model.h │ ├── camera_intrinsics_model_type.h │ ├── camera_test.cc │ ├── create_reprojection_error_cost_function.h │ ├── division_undistortion_camera_model.cc │ ├── division_undistortion_camera_model.h │ ├── division_undistortion_camera_model_test.cc │ ├── fisheye_camera_model.cc │ ├── fisheye_camera_model.h │ ├── fisheye_camera_model_test.cc │ ├── fov_camera_model.cc │ ├── fov_camera_model.h │ ├── fov_camera_model_test.cc │ ├── pinhole_camera_model.cc │ ├── pinhole_camera_model.h │ ├── pinhole_camera_model_test.cc │ ├── pinhole_radial_tangential_camera_model.cc │ ├── pinhole_radial_tangential_camera_model.h │ ├── pinhole_radial_tangential_camera_model_test.cc │ ├── projection_matrix_utils.cc │ ├── projection_matrix_utils.h │ ├── projection_matrix_utils_test.cc │ └── reprojection_error.h ├── camera_intrinsics_prior.h ├── colorize_reconstruction.cc ├── colorize_reconstruction.h ├── create_and_initialize_ransac_variant.h ├── estimate_track.cc ├── estimate_track.h ├── estimate_twoview_info.cc ├── estimate_twoview_info.h ├── estimators │ ├── camera_and_feature_correspondence_2d_3d.h │ ├── estimate_absolute_pose_with_known_orientation.cc │ ├── estimate_absolute_pose_with_known_orientation.h │ ├── estimate_absolute_pose_with_known_orientation_test.cc │ ├── estimate_calibrated_absolute_pose.cc │ ├── estimate_calibrated_absolute_pose.h │ ├── estimate_calibrated_absolute_pose_test.cc │ ├── estimate_dominant_plane_from_points.cc │ ├── estimate_dominant_plane_from_points.h │ ├── estimate_dominant_plane_from_points_test.cc │ ├── estimate_essential_matrix.cc │ ├── estimate_essential_matrix.h │ ├── estimate_essential_matrix_test.cc │ ├── estimate_fundamental_matrix.cc │ ├── estimate_fundamental_matrix.h │ ├── estimate_fundamental_matrix_test.cc │ ├── estimate_homography.cc │ ├── estimate_homography.h │ ├── estimate_homography_test.cc │ ├── estimate_radial_distortion_homography.cc │ ├── estimate_radial_distortion_homography.h │ ├── estimate_radial_distortion_homography_test.cc │ ├── estimate_relative_pose.cc │ ├── estimate_relative_pose.h │ ├── estimate_relative_pose_test.cc │ ├── estimate_relative_pose_with_known_orientation.cc │ ├── estimate_relative_pose_with_known_orientation.h │ ├── estimate_relative_pose_with_known_orientation_test.cc │ ├── estimate_rigid_transformation_2d_3d.cc │ ├── estimate_rigid_transformation_2d_3d.h │ ├── estimate_rigid_transformation_2d_3d_test.cc │ ├── estimate_similarity_transformation_2d_3d.cc │ ├── estimate_similarity_transformation_2d_3d.h │ ├── estimate_similarity_transformation_2d_3d_test.cc │ ├── estimate_triangulation.cc │ ├── estimate_triangulation.h │ ├── estimate_triangulation_test.cc │ ├── estimate_uncalibrated_absolute_pose.cc │ ├── estimate_uncalibrated_absolute_pose.h │ ├── estimate_uncalibrated_absolute_pose_test.cc │ ├── estimate_uncalibrated_relative_pose.cc │ ├── estimate_uncalibrated_relative_pose.h │ ├── estimate_uncalibrated_relative_pose_test.cc │ └── feature_correspondence_2d_3d.h ├── exif_reader.cc ├── exif_reader.h ├── exif_reader_test.cc ├── extract_maximally_parallel_rigid_subgraph.cc ├── extract_maximally_parallel_rigid_subgraph.h ├── extract_maximally_parallel_rigid_subgraph_test.cc ├── feature.h ├── feature_extractor.cc ├── feature_extractor.h ├── feature_extractor_and_matcher.cc ├── feature_extractor_and_matcher.h ├── filter_view_graph_cycles_by_rotation.cc ├── filter_view_graph_cycles_by_rotation.h ├── filter_view_graph_cycles_by_rotation_test.cc ├── filter_view_pairs_from_orientation.cc ├── filter_view_pairs_from_orientation.h ├── filter_view_pairs_from_orientation_test.cc ├── filter_view_pairs_from_relative_translation.cc ├── filter_view_pairs_from_relative_translation.h ├── filter_view_pairs_from_relative_translation_test.cc ├── find_common_tracks_in_views.cc ├── find_common_tracks_in_views.h ├── find_common_tracks_in_views_test.cc ├── find_common_views_by_name.cc ├── find_common_views_by_name.h ├── find_common_views_by_name_test.cc ├── global_pose_estimation │ ├── compute_triplet_baseline_ratios.cc │ ├── compute_triplet_baseline_ratios.h │ ├── compute_triplet_baseline_ratios_test.cc │ ├── least_unsquared_deviation_position_estimator.cc │ ├── least_unsquared_deviation_position_estimator.h │ ├── least_unsquared_deviation_position_estimator_test.cc │ ├── linear_position_estimator.cc │ ├── linear_position_estimator.h │ ├── linear_position_estimator_test.cc │ ├── linear_rotation_estimator.cc │ ├── linear_rotation_estimator.h │ ├── linear_rotation_estimator_test.cc │ ├── nonlinear_position_estimator.cc │ ├── nonlinear_position_estimator.h │ ├── nonlinear_position_estimator_test.cc │ ├── nonlinear_rotation_estimator.cc │ ├── nonlinear_rotation_estimator.h │ ├── pairwise_rotation_error.cc │ ├── pairwise_rotation_error.h │ ├── pairwise_rotation_error_test.cc │ ├── pairwise_translation_and_scale_error.cc │ ├── pairwise_translation_and_scale_error.h │ ├── pairwise_translation_and_scale_error_test.cc │ ├── pairwise_translation_error.cc │ ├── pairwise_translation_error.h │ ├── pairwise_translation_error_test.cc │ ├── position_estimator.h │ ├── robust_rotation_estimator.cc │ ├── robust_rotation_estimator.h │ ├── robust_rotation_estimator_test.cc │ └── rotation_estimator.h ├── global_reconstruction_estimator.cc ├── global_reconstruction_estimator.h ├── gps_converter.cc ├── gps_converter.h ├── gps_converter_test.cc ├── hybrid_reconstruction_estimator.cc ├── hybrid_reconstruction_estimator.h ├── hybrid_reconstruction_estimator_test.cc ├── incremental_reconstruction_estimator.cc ├── incremental_reconstruction_estimator.h ├── incremental_reconstruction_estimator_test.cc ├── localize_view_to_reconstruction.cc ├── localize_view_to_reconstruction.h ├── pose │ ├── build_upnp_action_matrix.cc │ ├── build_upnp_action_matrix.h │ ├── build_upnp_action_matrix_test.cc │ ├── build_upnp_action_matrix_using_symmetry.cc │ ├── build_upnp_action_matrix_using_symmetry.h │ ├── build_upnp_action_matrix_using_symmetry_test.cc │ ├── dls_impl.cc │ ├── dls_impl.h │ ├── dls_pnp.cc │ ├── dls_pnp.h │ ├── dls_pnp_test.cc │ ├── eight_point_fundamental_matrix.cc │ ├── eight_point_fundamental_matrix.h │ ├── eight_point_fundamental_matrix_test.cc │ ├── essential_matrix_utils.cc │ ├── essential_matrix_utils.h │ ├── essential_matrix_utils_test.cc │ ├── five_point_focal_length_radial_distortion.cc │ ├── five_point_focal_length_radial_distortion.h │ ├── five_point_focal_length_radial_distortion_test.cc │ ├── five_point_relative_pose.cc │ ├── five_point_relative_pose.h │ ├── five_point_relative_pose_test.cc │ ├── four_point_focal_length.cc │ ├── four_point_focal_length.h │ ├── four_point_focal_length_helper.cc │ ├── four_point_focal_length_helper.h │ ├── four_point_focal_length_radial_distortion.cc │ ├── four_point_focal_length_radial_distortion.h │ ├── four_point_focal_length_radial_distortion_helper.cc │ ├── four_point_focal_length_radial_distortion_helper.h │ ├── four_point_focal_length_radial_distortion_test.cc │ ├── four_point_focal_length_test.cc │ ├── four_point_homography.cc │ ├── four_point_homography.h │ ├── four_point_homography_test.cc │ ├── four_point_relative_pose_partial_rotation.cc │ ├── four_point_relative_pose_partial_rotation.h │ ├── four_point_relative_pose_partial_rotation_test.cc │ ├── fundamental_matrix_util.cc │ ├── fundamental_matrix_util.h │ ├── fundamental_matrix_util_test.cc │ ├── perspective_three_point.cc │ ├── perspective_three_point.h │ ├── perspective_three_point_test.cc │ ├── position_from_two_rays.cc │ ├── position_from_two_rays.h │ ├── position_from_two_rays_test.cc │ ├── relative_pose_from_two_points_with_known_rotation.cc │ ├── relative_pose_from_two_points_with_known_rotation.h │ ├── relative_pose_from_two_points_with_known_rotation_test.cc │ ├── seven_point_fundamental_matrix.cc │ ├── seven_point_fundamental_matrix.h │ ├── seven_point_fundamental_matrix_test.cc │ ├── sim_transform_partial_rotation.cc │ ├── sim_transform_partial_rotation.h │ ├── sim_transform_partial_rotation_test.cc │ ├── six_point_radial_distortion_homography.cc │ ├── six_point_radial_distortion_homography.h │ ├── six_point_radial_distortion_homography_test.cc │ ├── test_util.cc │ ├── test_util.h │ ├── three_point_relative_pose_partial_rotation.cc │ ├── three_point_relative_pose_partial_rotation.h │ ├── three_point_relative_pose_partial_rotation_test.cc │ ├── two_point_pose_partial_rotation.cc │ ├── two_point_pose_partial_rotation.h │ ├── two_point_pose_partial_rotation_test.cc │ ├── upnp.cc │ ├── upnp.h │ ├── upnp_test.cc │ ├── util.cc │ └── util.h ├── pose_error.h ├── reconstruction.cc ├── reconstruction.h ├── reconstruction_builder.cc ├── reconstruction_builder.h ├── reconstruction_estimator.cc ├── reconstruction_estimator.h ├── reconstruction_estimator_options.h ├── reconstruction_estimator_utils.cc ├── reconstruction_estimator_utils.h ├── reconstruction_test.cc ├── rigid_transformation.h ├── select_good_tracks_for_bundle_adjustment.cc ├── select_good_tracks_for_bundle_adjustment.h ├── set_camera_intrinsics_from_priors.cc ├── set_camera_intrinsics_from_priors.h ├── set_outlier_tracks_to_unestimated.cc ├── set_outlier_tracks_to_unestimated.h ├── similarity_transformation.h ├── track.cc ├── track.h ├── track_builder.cc ├── track_builder.h ├── track_builder_test.cc ├── track_test.cc ├── transformation │ ├── align_point_clouds.cc │ ├── align_point_clouds.h │ ├── align_point_clouds_test.cc │ ├── align_reconstructions.cc │ ├── align_reconstructions.h │ ├── align_reconstructions_test.cc │ ├── align_rotations.cc │ ├── align_rotations.h │ ├── align_rotations_test.cc │ ├── gdls_similarity_transform.cc │ ├── gdls_similarity_transform.h │ ├── gdls_similarity_transform_test.cc │ ├── transform_reconstruction.cc │ └── transform_reconstruction.h ├── triangulation │ ├── triangulation.cc │ ├── triangulation.h │ └── triangulation_test.cc ├── two_view_match_geometric_verification.cc ├── two_view_match_geometric_verification.h ├── twoview_info.cc ├── twoview_info.h ├── twoview_info_test.cc ├── types.h ├── undistort_image.cc ├── undistort_image.h ├── view.cc ├── view.h ├── view_graph │ ├── orientations_from_maximum_spanning_tree.cc │ ├── orientations_from_maximum_spanning_tree.h │ ├── orientations_from_maximum_spanning_tree_test.cc │ ├── remove_disconnected_view_pairs.cc │ ├── remove_disconnected_view_pairs.h │ ├── remove_disconnected_view_pairs_test.cc │ ├── view_graph.cc │ ├── view_graph.h │ └── view_graph_test.cc ├── view_test.cc ├── view_triplet.h ├── visibility_pyramid.cc └── visibility_pyramid.h ├── solvers ├── estimator.h ├── evsac.h ├── evsac_sampler.h ├── evsac_test.cc ├── exhaustive_ransac.h ├── exhaustive_ransac_test.cc ├── exhaustive_sampler.cc ├── exhaustive_sampler.h ├── exhaustive_sampler_test.cc ├── inlier_support.h ├── lmed.h ├── lmed_quality_measurement.h ├── lmed_test.cc ├── mle_quality_measurement.h ├── prosac.h ├── prosac_sampler.cc ├── prosac_sampler.h ├── prosac_test.cc ├── quality_measurement.h ├── random_sampler.cc ├── random_sampler.h ├── random_sampler_test.cc ├── ransac.h ├── ransac_test.cc ├── sample_consensus_estimator.h └── sampler.h ├── test ├── test_main.cc └── test_utils.h └── util ├── enable_enum_bitmask_operators.h ├── filesystem.cc ├── filesystem.h ├── hash.h ├── lru_cache.h ├── lru_cache_test.cc ├── map_util.h ├── mutable_priority_queue.h ├── mutable_priority_queue_test.cc ├── random.cc ├── random.h ├── string.h ├── stringprintf.cc ├── stringprintf.h ├── threadpool.cc ├── threadpool.h ├── timer.cc ├── timer.h └── util.h /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: Google 4 | AccessModifierOffset: -1 5 | AlignAfterOpenBracket: true 6 | AlignConsecutiveAssignments: false 7 | AlignEscapedNewlinesLeft: true 8 | AlignOperands: true 9 | AlignTrailingComments: true 10 | AllowAllParametersOfDeclarationOnNextLine: true 11 | AllowShortBlocksOnASingleLine: false 12 | AllowShortCaseLabelsOnASingleLine: false 13 | AllowShortFunctionsOnASingleLine: All 14 | AllowShortIfStatementsOnASingleLine: true 15 | AllowShortLoopsOnASingleLine: true 16 | AlwaysBreakAfterDefinitionReturnType: None 17 | AlwaysBreakBeforeMultilineStrings: true 18 | AlwaysBreakTemplateDeclarations: true 19 | BinPackArguments: false 20 | BinPackParameters: false 21 | BreakBeforeBinaryOperators: None 22 | BreakBeforeBraces: Attach 23 | BreakBeforeTernaryOperators: true 24 | BreakConstructorInitializersBeforeComma: false 25 | ColumnLimit: 80 26 | CommentPragmas: '^ IWYU pragma:' 27 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 28 | ConstructorInitializerIndentWidth: 4 29 | ContinuationIndentWidth: 4 30 | Cpp11BracedListStyle: true 31 | DerivePointerAlignment: false 32 | DisableFormat: false 33 | ExperimentalAutoDetectBinPacking: false 34 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] 35 | IndentCaseLabels: true 36 | IndentWidth: 2 37 | IndentWrappedFunctionNames: false 38 | KeepEmptyLinesAtTheStartOfBlocks: false 39 | MacroBlockBegin: '' 40 | MacroBlockEnd: '' 41 | MaxEmptyLinesToKeep: 1 42 | NamespaceIndentation: None 43 | ObjCBlockIndentWidth: 2 44 | ObjCSpaceAfterProperty: false 45 | ObjCSpaceBeforeProtocolList: false 46 | PenaltyBreakBeforeFirstCallParameter: 1 47 | PenaltyBreakComment: 300 48 | PenaltyBreakFirstLessLess: 120 49 | PenaltyBreakString: 1000 50 | PenaltyExcessCharacter: 1000000 51 | PenaltyReturnTypeOnItsOwnLine: 200 52 | PointerAlignment: Left 53 | SpaceAfterCStyleCast: false 54 | SpaceBeforeAssignmentOperators: true 55 | SpaceBeforeParens: ControlStatements 56 | SpaceInEmptyParentheses: false 57 | SpacesBeforeTrailingComments: 2 58 | SpacesInAngles: false 59 | SpacesInContainerLiterals: true 60 | SpacesInCStyleCastParentheses: false 61 | SpacesInParentheses: false 62 | SpacesInSquareBrackets: false 63 | Standard: Auto 64 | TabWidth: 8 65 | UseTab: Never 66 | ... 67 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/* 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright 2015-2016 Chris Sweeney (sweeney.chris.m@gmail.com) 2 | UC Santa Barbara 3 | 4 | What is this library? 5 | --------------------- 6 | 7 | Theia is an end-to-end structure-from-motion library that was created by Chris 8 | Sweeney. It is designed to be very efficient, scalable, and accurate. All 9 | steps of the pipeline are designed to be modular so that code is easy to read 10 | and easy to extend. 11 | 12 | Please see the Theia website for detailed information, including instructions 13 | for building Theia and full documentation of the library. The website is 14 | currently located at http://www.theia-sfm.org 15 | 16 | Contact Information 17 | ------------------- 18 | 19 | Questions, comments, and bug reports can be sent to the Theia mailing list: 20 | theia-vision-library@googlegroups.com 21 | 22 | Citing this library 23 | ------------------- 24 | 25 | If you are using this library for academic research or publications we ask that 26 | you please cite this library as: 27 | 28 | @misc{theia-manual, 29 | author = {Chris Sweeney}, 30 | title = {Theia Multiview Geometry Library: Tutorial \& Reference}, 31 | howpublished = "\url{http://theia-sfm.org}", 32 | } 33 | -------------------------------------------------------------------------------- /data/camera_sensor_database_license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Camera Sensor Size Database authors. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /data/image/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/.DS_Store -------------------------------------------------------------------------------- /data/image/descriptor/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/descriptor/img1.png -------------------------------------------------------------------------------- /data/image/exif.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/exif.jpg -------------------------------------------------------------------------------- /data/image/gps_exif.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/gps_exif.jpg -------------------------------------------------------------------------------- /data/image/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/img1.png -------------------------------------------------------------------------------- /data/image/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/img2.png -------------------------------------------------------------------------------- /data/image/img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/img3.png -------------------------------------------------------------------------------- /data/image/img4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/img4.png -------------------------------------------------------------------------------- /data/image/img5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/img5.png -------------------------------------------------------------------------------- /data/image/img6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/img6.png -------------------------------------------------------------------------------- /data/image/keypoint_detector/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/keypoint_detector/img1.png -------------------------------------------------------------------------------- /data/image/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/image/test1.jpg -------------------------------------------------------------------------------- /data/io/calibration_test.json: -------------------------------------------------------------------------------- 1 | {"priors" : [ 2 | {"CameraIntrinsicsPrior": { 3 | "image_name" : "view_1.jpg", 4 | "focal_length" : 300, 5 | "width" : 480, 6 | "height" : 480, 7 | "principal_point" : [240, 240], 8 | "aspect_ratio" : 1.0, 9 | "skew" : 0.0, 10 | "radial_distortion_coeffs" : [0.1, 0.1], 11 | "camera_intrinsics_type" : "PINHOLE" 12 | }}, 13 | {"CameraIntrinsicsPrior": { 14 | "image_name" : "view_2.jpg", 15 | "focal_length" : 350, 16 | "principal_point" : [240, 240], 17 | "aspect_ratio" : 1.5, 18 | "skew" : 0.25, 19 | "radial_distortion_coeffs" : [0.1], 20 | "camera_intrinsics_type" : "PINHOLE" 21 | }}, 22 | {"CameraIntrinsicsPrior": { 23 | "image_name" : "view_3.jpg", 24 | "principal_point" : [240, 240], 25 | "camera_intrinsics_type" : "PINHOLE" 26 | }}, 27 | {"CameraIntrinsicsPrior": { 28 | "image_name" : "view_4.jpg", 29 | "focal_length" : 300, 30 | "width" : 480, 31 | "height" : 480, 32 | "principal_point" : [240, 240], 33 | "aspect_ratio" : 1.0, 34 | "skew" : 0.0, 35 | "radial_distortion_coeffs" : [0.1, 0.1, 0.01], 36 | "tangential_distortion_coeffs" : [0.05, 0.05], 37 | "orientation" : [0.1, 0.1, 0.1], 38 | "position" : [1, 2.0, -3.0], 39 | "latitude" : 128.0, 40 | "longitude" : 256.0, 41 | "altitude" : 512.0, 42 | "camera_intrinsics_type" : "PINHOLE_RADIAL_TANGENTIAL" 43 | }} 44 | ]} 45 | -------------------------------------------------------------------------------- /data/sfm/fountain11.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/sfm/fountain11.bin -------------------------------------------------------------------------------- /data/sfm/fountain11_matches.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/sfm/fountain11_matches.bin -------------------------------------------------------------------------------- /data/sfm/gt_fountain11.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/data/sfm/gt_fountain11.bin -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Ceres Solver - A fast non-linear least squares minimizer 2 | # Copyright 2013 Google Inc. All rights reserved. 3 | # http://code.google.com/p/ceres-solver/ 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # 8 | # * Redistributions of source code must retain the above copyright notice, 9 | # this list of conditions and the following disclaimer. 10 | # * Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # * Neither the name of Google Inc. nor the names of its contributors may be 14 | # used to endorse or promote products derived from this software without 15 | # specific prior written permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | # POSSIBILITY OF SUCH DAMAGE. 28 | 29 | ADD_SUBDIRECTORY(source) 30 | -------------------------------------------------------------------------------- /docs/source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FIND_PACKAGE(Sphinx REQUIRED) 2 | 3 | # HTML output directory 4 | SET(SPHINX_HTML_DIR "${CMAKE_BINARY_DIR}/docs/html") 5 | 6 | # Install documentation 7 | INSTALL(DIRECTORY ${SPHINX_HTML_DIR} 8 | DESTINATION share/doc/theia 9 | COMPONENT Doc 10 | PATTERN "${SPHINX_HTML_DIR}/*") 11 | 12 | # Building using 'make_docs.py' python script 13 | ADD_CUSTOM_TARGET(theia_docs ALL 14 | python 15 | "${CMAKE_SOURCE_DIR}/docs/make_docs.py" 16 | "${CMAKE_SOURCE_DIR}" 17 | "${CMAKE_BINARY_DIR}/docs" 18 | "${SPHINX_EXECUTABLE}" 19 | COMMENT "Building HTML documentation with Sphinx") 20 | -------------------------------------------------------------------------------- /docs/source/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/source/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/source/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/comment-close.png -------------------------------------------------------------------------------- /docs/source/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/comment.png -------------------------------------------------------------------------------- /docs/source/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/source/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/down.png -------------------------------------------------------------------------------- /docs/source/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/file.png -------------------------------------------------------------------------------- /docs/source/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/minus.png -------------------------------------------------------------------------------- /docs/source/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/plus.png -------------------------------------------------------------------------------- /docs/source/_static/theia_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/theia_logo.png -------------------------------------------------------------------------------- /docs/source/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/source/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/_static/up.png -------------------------------------------------------------------------------- /docs/source/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {% block footer %} 4 | {{ super() }} 5 | 6 | 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /docs/source/api.rst: -------------------------------------------------------------------------------- 1 | .. _chapter-api: 2 | 3 | ============= 4 | API Reference 5 | ============= 6 | 7 | .. toctree:: 8 | :maxdepth: 3 9 | 10 | image 11 | features 12 | ransac 13 | pose 14 | math 15 | cameras 16 | sfm 17 | -------------------------------------------------------------------------------- /docs/source/global_linear_position_estimation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/global_linear_position_estimation.png -------------------------------------------------------------------------------- /docs/source/global_sfm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/global_sfm.png -------------------------------------------------------------------------------- /docs/source/incremental_sfm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/incremental_sfm.png -------------------------------------------------------------------------------- /docs/source/license.rst: -------------------------------------------------------------------------------- 1 | ======= 2 | License 3 | ======= 4 | 5 | Theia is licensed under the New BSD license, whose terms are as follows. 6 | 7 | Copyright © 2013, 2014. The Regents of the University of California (Regents). All 8 | rights reserved. 9 | 10 | 1. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 11 | 12 | 2. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 13 | 14 | 3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 15 | 16 | Neither the name of The Regents or the University of California nor the names of 17 | its contributors may be used to endorse or promote products derived from this 18 | software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 24 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 27 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | Citation 32 | ======== 33 | 34 | If you use Theia for an academic publication, please cite this 35 | manual. e.g., :: 36 | 37 | @misc{theia-manual, 38 | author = {Chris Sweeney}, 39 | title = {Theia Multiview Geometry Library: Tutorial \& Reference}, 40 | howpublished = "\url{http://theia-sfm.org}", 41 | } 42 | -------------------------------------------------------------------------------- /docs/source/pisa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/docs/source/pisa.png -------------------------------------------------------------------------------- /libraries/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (${BUILD_TESTING}) 2 | add_subdirectory(gtest) 3 | endif (${BUILD_TESTING}) 4 | 5 | # AKAZE feature extractor. 6 | add_subdirectory(akaze) 7 | 8 | # Cereal for portable IO. 9 | add_subdirectory(cereal) 10 | 11 | # Flann for fast approximate nearest neighbor searches. 12 | add_subdirectory(flann) 13 | 14 | # Add Optimo. 15 | add_subdirectory(optimo) 16 | 17 | # Add Statx. 18 | add_subdirectory(statx) 19 | 20 | # STLPlus for filepath tools. 21 | add_subdirectory(stlplus3) 22 | 23 | # Add VLFeat. 24 | add_subdirectory(vlfeat) 25 | 26 | # Add VisualSfM files. 27 | add_subdirectory(visual_sfm) -------------------------------------------------------------------------------- /libraries/akaze/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Chris Sweeney, Pablo Fernandez Alcantarilla, Jesus Nuevo 2 | All Rights Reserved 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the copyright holders nor the names of its contributors 15 | may be used to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY 26 | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /libraries/akaze/cimg/Licence_CeCILL-C_V1-en.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/cimg/Licence_CeCILL-C_V1-en.txt -------------------------------------------------------------------------------- /libraries/akaze/cimg/Licence_CeCILL_V2-en.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/cimg/Licence_CeCILL_V2-en.txt -------------------------------------------------------------------------------- /libraries/akaze/cimg/cmake-modules/FindBOARD.cmake: -------------------------------------------------------------------------------- 1 | # - Find BOARD 2 | # Find the native BOARD includes and library 3 | # This module defines 4 | # BOARD_INCLUDE_DIR, where to find jpeglib.h, etc. 5 | # BOARD_LIBRARIES, the libraries needed to use BOARD. 6 | # BOARD_FOUND, If false, do not try to use BOARD. 7 | # also defined, but not for general use are 8 | # BOARD_LIBRARY, where to find the BOARD library. 9 | 10 | FIND_PATH(BOARD_INCLUDE_DIR board.h 11 | /usr/local/include 12 | /usr/include 13 | ) 14 | 15 | SET(BOARD_NAMES ${BOARD_NAMES} board) 16 | FIND_LIBRARY(BOARD_LIBRARY 17 | NAMES ${BOARD_NAMES} 18 | PATHS /usr/lib /usr/local/lib 19 | ) 20 | 21 | IF (BOARD_LIBRARY AND BOARD_INCLUDE_DIR) 22 | SET(BOARD_LIBRARIES ${BOARD_LIBRARY}) 23 | SET(BOARD_FOUND "YES") 24 | ELSE (BOARD_LIBRARY AND BOARD_INCLUDE_DIR) 25 | SET(BOARD_FOUND "NO") 26 | ENDIF (BOARD_LIBRARY AND BOARD_INCLUDE_DIR) 27 | 28 | 29 | IF (BOARD_FOUND) 30 | IF (NOT BOARD_FIND_QUIETLY) 31 | MESSAGE(STATUS "Found BOARD: ${BOARD_LIBRARIES}") 32 | ENDIF (NOT BOARD_FIND_QUIETLY) 33 | ELSE (BOARD_FOUND) 34 | IF (BOARD_FIND_REQUIRED) 35 | MESSAGE(FATAL_ERROR "Could not find BOARD library") 36 | ENDIF (BOARD_FIND_REQUIRED) 37 | ENDIF (BOARD_FOUND) 38 | 39 | # Deprecated declarations. 40 | SET (NATIVE_BOARD_INCLUDE_PATH ${BOARD_INCLUDE_DIR} ) 41 | GET_FILENAME_COMPONENT (NATIVE_BOARD_LIB_PATH ${BOARD_LIBRARY} PATH) 42 | 43 | MARK_AS_ADVANCED( 44 | BOARD_LIBRARY 45 | BOARD_INCLUDE_DIR 46 | ) 47 | -------------------------------------------------------------------------------- /libraries/akaze/cimg/cmake-modules/FindEZMINC.cmake: -------------------------------------------------------------------------------- 1 | # FindEZMINC.cmake module 2 | 3 | # Find the native MINC includes and library 4 | # This module defines 5 | # EZMINC_INCLUDE_DIR, where to find jpeglib.h, etc. 6 | # EZMINC_LIBRARIES, the libraries needed to use EZMINC. 7 | # EZMINC_FOUND, If false, do not try to use EZMINC. 8 | # also defined, but not for general use are 9 | # EZMINC_LIBRARY, where to find the MINC library. 10 | 11 | 12 | FIND_PATH(EZMINC_INCLUDE_DIR minc_1_rw.h /usr/include /usr/local/include /usr/local/bic/include /opt/minc-toolkit/include) 13 | FIND_LIBRARY(EZMINC_minc_io_LIBRARY NAMES minc_io HINTS /usr/lib /usr/local/lib /usr/local/bic/lib /opt/minc-toolkit/lib) 14 | 15 | 16 | IF (EZMINC_INCLUDE_DIR AND EZMINC_minc_io_LIBRARY) 17 | set(EZMINC_LIBRARIES 18 | ${EZMINC_minc_io_LIBRARY} 19 | ) 20 | SET(EZMINC_FOUND TRUE) 21 | 22 | ENDIF (EZMINC_INCLUDE_DIR AND EZMINC_minc_io_LIBRARY) 23 | 24 | 25 | IF (EZMINC_FOUND) 26 | IF (NOT Minc_FIND_QUIETLY) 27 | MESSAGE(STATUS "Found EZMINC: ${EZMINC_LIBRARIES}") 28 | ENDIF (NOT Minc_FIND_QUIETLY) 29 | ELSE (EZMINC_FOUND) 30 | IF (Minc_FIND_REQUIRED) 31 | MESSAGE(FATAL_ERROR "Cound not find EZMINC") 32 | ENDIF (Minc_FIND_REQUIRED) 33 | ENDIF (EZMINC_FOUND) 34 | 35 | 36 | mark_as_advanced( 37 | EZMINC_minc_io_LIBRARY 38 | ) 39 | -------------------------------------------------------------------------------- /libraries/akaze/cimg/cmake-modules/FindFFTW3F.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find FFTW 2 | # Once done this will define 3 | # FFTW_FOUND - System has FFTW3 4 | # FFTW_INCLUDE_DIRS - The FFTW3 include directories 5 | # FFTW_LIBRARIES - The libraries needed to use FFTW3 6 | # FFTW_DEFINITIONS - Compiler switches required for using FFTW3 7 | 8 | find_package(PkgConfig) 9 | 10 | pkg_check_modules(PC_FFTW3F QUIET fftw3f) 11 | 12 | set(FFTW3F_DEFINITIONS ${PC_FFTW3F_CFLAGS_OTHER}) 13 | 14 | find_path(FFTW3F_INCLUDE_DIR fftw3.h 15 | HINTS ${PC_FFTW3F_INCLUDEDIR} ${PC_FFTW3F_INCLUDE_DIRS} 16 | NAMES fftw3.h ) 17 | 18 | find_library(FFTW3F_LIBRARY NAMES fftw3f libfftw3f 19 | HINTS ${PC_FFTW3F_LIBDIR} ${PC_FFTW3F_LIBRARY_DIRS} ) 20 | 21 | set(FFTW3F_LIBRARIES ${FFTW3F_LIBRARY} ) 22 | set(FFTW3F_INCLUDE_DIRS ${FFTW3F_INCLUDE_DIR} ) 23 | 24 | include(FindPackageHandleStandardArgs) 25 | # handle the QUIETLY and REQUIRED arguments and set FFTW3F_FOUND to TRUE 26 | # if all listed variables are TRUE 27 | find_package_handle_standard_args(FFTW3F DEFAULT_MSG 28 | FFTW3F_LIBRARY FFTW3F_INCLUDE_DIR) 29 | 30 | mark_as_advanced(FFTW3F_INCLUDE_DIR FFTW3F_LIBRARY ) -------------------------------------------------------------------------------- /libraries/akaze/cimg/cmake-modules/FindJPEG.cmake: -------------------------------------------------------------------------------- 1 | # - Find JPEG 2 | # Find the native JPEG includes and library 3 | # This module defines 4 | # JPEG_INCLUDE_DIR, where to find jpeglib.h, etc. 5 | # JPEG_LIBRARIES, the libraries needed to use JPEG. 6 | # JPEG_FOUND, If false, do not try to use JPEG. 7 | # also defined, but not for general use are 8 | # JPEG_LIBRARY, where to find the JPEG library. 9 | 10 | #============================================================================= 11 | # Copyright 2001-2009 Kitware, Inc. 12 | # 13 | # Distributed under the OSI-approved BSD License (the "License"); 14 | # see accompanying file Copyright.txt for details. 15 | # 16 | # This software is distributed WITHOUT ANY WARRANTY; without even the 17 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 | # See the License for more information. 19 | #============================================================================= 20 | # (To distributed this file outside of CMake, substitute the full 21 | # License text for the above reference.) 22 | 23 | FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h) 24 | 25 | SET(JPEG_NAMES ${JPEG_NAMES} jpeg) 26 | FIND_LIBRARY(JPEG_LIBRARY NAMES ${JPEG_NAMES} ) 27 | 28 | # handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if 29 | # all listed variables are TRUE 30 | INCLUDE(FindPackageHandleStandardArgs) 31 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG DEFAULT_MSG JPEG_LIBRARY JPEG_INCLUDE_DIR) 32 | 33 | IF(JPEG_FOUND) 34 | SET(JPEG_LIBRARIES ${JPEG_LIBRARY}) 35 | ENDIF(JPEG_FOUND) 36 | 37 | # Deprecated declarations. 38 | SET (NATIVE_JPEG_INCLUDE_PATH ${JPEG_INCLUDE_DIR} ) 39 | IF(JPEG_LIBRARY) 40 | GET_FILENAME_COMPONENT (NATIVE_JPEG_LIB_PATH ${JPEG_LIBRARY} PATH) 41 | ENDIF(JPEG_LIBRARY) 42 | 43 | MARK_AS_ADVANCED(JPEG_LIBRARY JPEG_INCLUDE_DIR ) 44 | -------------------------------------------------------------------------------- /libraries/akaze/cimg/cmake-modules/FindMINC.cmake: -------------------------------------------------------------------------------- 1 | # FindMINC.cmake module 2 | 3 | # Find the native MINC includes and library 4 | # This module defines 5 | # MINC_INCLUDE_DIR, where to find jpeglib.h, etc. 6 | # MINC_LIBRARIES, the libraries needed to use MINC. 7 | # MINC_FOUND, If false, do not try to use MINC. 8 | # also defined, but not for general use are 9 | # MINC_LIBRARY, where to find the MINC library. 10 | 11 | 12 | FIND_PATH(MINC_INCLUDE_DIR minc2.h /usr/include /usr/local/include /usr/local/bic/include /opt/minc-toolkit/include) 13 | FIND_LIBRARY(MINC_volume_io2_LIBRARY NAMES volume_io2 HINTS /usr/lib /usr/local/lib /usr/local/bic/lib /opt/minc-toolkit/include) 14 | FIND_LIBRARY(MINC_minc2_LIBRARY NAMES minc2 HINTS /usr/lib /usr/local/lib /usr/local/bic/lib /opt/minc-toolkit/include) 15 | 16 | 17 | IF (MINC_INCLUDE_DIR AND MINC_minc2_LIBRARY AND MINC_volume_io2_LIBRARY) 18 | set(MINC_LIBRARIES 19 | ${MINC_volume_io2_LIBRARY} 20 | ${MINC_minc2_LIBRARY} 21 | ) 22 | SET(MINC_FOUND TRUE) 23 | 24 | ENDIF (MINC_INCLUDE_DIR AND MINC_minc2_LIBRARY AND MINC_volume_io2_LIBRARY) 25 | 26 | 27 | IF (MINC_FOUND) 28 | IF (NOT Minc_FIND_QUIETLY) 29 | MESSAGE(STATUS "Found MINC: ${MINC_LIBRARIES}") 30 | ENDIF (NOT Minc_FIND_QUIETLY) 31 | ELSE (MINC_FOUND) 32 | IF (Minc_FIND_REQUIRED) 33 | MESSAGE(FATAL_ERROR "Cound not find MINC") 34 | ENDIF (Minc_FIND_REQUIRED) 35 | ENDIF (MINC_FOUND) 36 | 37 | 38 | mark_as_advanced( 39 | MINC_minc2_LIBRARY 40 | MINC_volume_io2_LIBRARY 41 | ) 42 | -------------------------------------------------------------------------------- /libraries/akaze/cimg/cmake-modules/FindTIFF.cmake: -------------------------------------------------------------------------------- 1 | # - Find TIFF library 2 | # Find the native TIFF includes and library 3 | # This module defines 4 | # TIFF_INCLUDE_DIR, where to find tiff.h, etc. 5 | # TIFF_LIBRARIES, libraries to link against to use TIFF. 6 | # TIFF_FOUND, If false, do not try to use TIFF. 7 | # also defined, but not for general use are 8 | # TIFF_LIBRARY, where to find the TIFF library. 9 | 10 | #============================================================================= 11 | # Copyright 2002-2009 Kitware, Inc. 12 | # 13 | # Distributed under the OSI-approved BSD License (the "License"); 14 | # see accompanying file Copyright.txt for details. 15 | # 16 | # This software is distributed WITHOUT ANY WARRANTY; without even the 17 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 | # See the License for more information. 19 | #============================================================================= 20 | # (To distributed this file outside of CMake, substitute the full 21 | # License text for the above reference.) 22 | 23 | FIND_PATH(TIFF_INCLUDE_DIR tiff.h) 24 | 25 | SET(TIFF_NAMES ${TIFF_NAMES} tiff libtiff libtiff3) 26 | FIND_LIBRARY(TIFF_LIBRARY NAMES ${TIFF_NAMES} ) 27 | 28 | # handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if 29 | # all listed variables are TRUE 30 | INCLUDE(FindPackageHandleStandardArgs) 31 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(TIFF DEFAULT_MSG TIFF_LIBRARY TIFF_INCLUDE_DIR) 32 | 33 | IF(TIFF_FOUND) 34 | SET( TIFF_LIBRARIES ${TIFF_LIBRARY} ) 35 | ENDIF(TIFF_FOUND) 36 | 37 | MARK_AS_ADVANCED(TIFF_INCLUDE_DIR TIFF_LIBRARY) 38 | -------------------------------------------------------------------------------- /libraries/akaze/cimg/cmake-modules/FindZLIB.cmake: -------------------------------------------------------------------------------- 1 | # - Find zlib 2 | # Find the native ZLIB includes and library 3 | # 4 | # ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. 5 | # ZLIB_LIBRARIES - List of libraries when using zlib. 6 | # ZLIB_FOUND - True if zlib found. 7 | 8 | #============================================================================= 9 | # Copyright 2001-2009 Kitware, Inc. 10 | # 11 | # Distributed under the OSI-approved BSD License (the "License"); 12 | # see accompanying file Copyright.txt for details. 13 | # 14 | # This software is distributed WITHOUT ANY WARRANTY; without even the 15 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 | # See the License for more information. 17 | #============================================================================= 18 | # (To distributed this file outside of CMake, substitute the full 19 | # License text for the above reference.) 20 | 21 | IF (ZLIB_INCLUDE_DIR) 22 | # Already in cache, be silent 23 | SET(ZLIB_FIND_QUIETLY TRUE) 24 | ENDIF (ZLIB_INCLUDE_DIR) 25 | 26 | FIND_PATH(ZLIB_INCLUDE_DIR zlib.h) 27 | 28 | SET(ZLIB_NAMES z zlib zdll) 29 | FIND_LIBRARY(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ) 30 | MARK_AS_ADVANCED( ZLIB_LIBRARY ZLIB_INCLUDE_DIR ) 31 | 32 | # Per-recommendation 33 | SET(ZLIB_INCLUDE_DIRS "${ZLIB_INCLUDE_DIR}") 34 | SET(ZLIB_LIBRARIES "${ZLIB_LIBRARY}") 35 | 36 | # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if 37 | # all listed variables are TRUE 38 | INCLUDE(FindPackageHandleStandardArgs) 39 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIRS) 40 | 41 | -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/H1to1p: -------------------------------------------------------------------------------- 1 | 1.0 0.0 0.0 2 | 0.0 1.0 0.0 3 | 0.0 0.0 1.0 4 | -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/H1to2p: -------------------------------------------------------------------------------- 1 | 1 0 0 2 | 0 1 0 3 | 0 0 1 4 | -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/H1to3p: -------------------------------------------------------------------------------- 1 | 1 0 0 2 | 0 1 0 3 | 0 0 1 4 | -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/H1to4p: -------------------------------------------------------------------------------- 1 | 1 0 0 2 | 0 1 0 3 | 0 0 1 4 | -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/H1to5p: -------------------------------------------------------------------------------- 1 | 1 0 0 2 | 0 1 0 3 | 0 0 1 4 | -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/H1to6p: -------------------------------------------------------------------------------- 1 | 1 0 0 2 | 0 1 0 3 | 0 0 1 4 | -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/img1.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/datasets/iguazu/img1.pgm -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/img2.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/datasets/iguazu/img2.pgm -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/img3.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/datasets/iguazu/img3.pgm -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/img4.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/datasets/iguazu/img4.pgm -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/img5.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/datasets/iguazu/img5.pgm -------------------------------------------------------------------------------- /libraries/akaze/datasets/iguazu/img6.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/akaze/datasets/iguazu/img6.pgm -------------------------------------------------------------------------------- /libraries/akaze/timer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(timer) 2 | 3 | INCLUDE_DIRECTORIES(./) 4 | ADD_LIBRARY(timer timer.cpp) -------------------------------------------------------------------------------- /libraries/akaze/timer/timer.hpp: -------------------------------------------------------------------------------- 1 | // The following code was taken from the OpenMVG library and is unmodified other 2 | // than the namespace and header guard. 3 | // To see the original source code, please visit OpenMVG's repository: 4 | // https://github.com/openMVG/openMVG 5 | // The original software license is given below. 6 | 7 | // ========================================================================== // 8 | // 9 | // Copyright (C) 2013 David Ok 10 | // Copyright (C) 2014 Pierre Moulon 11 | // 12 | // Adapted from DO++, a basic set of libraries in C++ for computer 13 | // vision. 14 | // 15 | // This Source Code Form is subject to the terms of the Mozilla Public 16 | // License v. 2.0. If a copy of the MPL was not distributed with this file, 17 | // you can obtain one at http://mozilla.org/MPL/2.0/. 18 | // ========================================================================== // 19 | 20 | #ifndef TIMER_HPP 21 | #define TIMER_HPP 22 | 23 | #ifdef HAVE_CXX11_CHRONO 24 | #include 25 | #endif 26 | #include 27 | 28 | namespace timer { 29 | 30 | //! \brief Timer class with microsecond accuracy. 31 | class Timer 32 | { 33 | public: 34 | //! Default constructor 35 | Timer(); 36 | //! Reset the timer to zero. 37 | void reset(); 38 | //! Returns the elapsed time in seconds. 39 | double elapsed() const; 40 | //! Returns the elapsed time in milliseconds. 41 | double elapsedMs() const; 42 | private: 43 | 44 | #ifdef HAVE_CXX11_CHRONO 45 | std::chrono::high_resolution_clock::time_point start_; 46 | #else 47 | double start_; 48 | #ifdef _WIN32 49 | double frequency_; 50 | #endif 51 | #endif // HAVE_CXX11_CHRONO 52 | }; 53 | 54 | // print the elapsed time 55 | std::ostream& operator << (std::ostream&, const Timer&); 56 | 57 | } // namespace timer 58 | 59 | #endif // TIMER_HPP 60 | -------------------------------------------------------------------------------- /libraries/cereal/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | # Visual studio cruft 16 | *.opensdf 17 | *.sdf 18 | *.suo 19 | *.user 20 | */x64 21 | */Debug* 22 | */Release* 23 | *.log 24 | *.tlog* 25 | *.obj 26 | *.VC.db 27 | *.VC.VC.opendb 28 | *.pdb 29 | 30 | # misc files mostly used for testing 31 | out.txt 32 | ptr.txt 33 | test.txt 34 | boost_serialize 35 | arr.txt 36 | performance 37 | include_renamed 38 | .ycm_extra_conf.py* 39 | doc/html 40 | rtti.txt 41 | doc/latex 42 | portability64 43 | portability32 44 | file.json 45 | out.xml 46 | cereal_version.out 47 | xml_ordering.out 48 | build 49 | /out/ -------------------------------------------------------------------------------- /libraries/cereal/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | compiler: 4 | # TODO: Clang is currently giving issues 5 | #- clang 6 | - gcc 7 | 8 | before_install: 9 | # Always install g++4.8.1 10 | - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test 11 | 12 | # Install recent version of Boost 13 | - sudo add-apt-repository -y ppa:boost-latest/ppa 14 | 15 | # clang 3.3 16 | - if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y ppa:h-rayflood/llvm; fi 17 | 18 | - sudo apt-get update -qq 19 | 20 | install: 21 | - sudo apt-get install cmake 22 | - sudo apt-get install libboost1.54-all-dev 23 | 24 | # Always install valgrind 25 | - sudo apt-get install valgrind 26 | 27 | # Always install g++4.8.1 28 | - sudo apt-get install -qq g++-4.8 29 | - sudo apt-get install -qq g++-4.8-multilib 30 | - if [ "$CXX" = "g++" ]; then export CMAKE_CXX_COMPILER="g++-4.8"; fi 31 | - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8"; fi 32 | 33 | # clang 3.3 34 | - if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated -qq clang-3.3; fi 35 | - if [ "$CXX" == "clang++" ]; then export CMAKE_CXX_COMPILER="clang++-3.3"; fi 36 | - if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.3"; fi 37 | 38 | script: 39 | - mkdir build 40 | - cd build 41 | - cmake .. 42 | - make 43 | 44 | after_script: 45 | - ctest . 46 | # - make valgrind 47 | 48 | branches: 49 | only: 50 | - develop 51 | -------------------------------------------------------------------------------- /libraries/cereal/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of cereal nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /libraries/cereal/doc/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 19 | 20 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /libraries/cereal/doc/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | \mainpage cereal code documentation 3 | 4 | \tableofcontents 5 | 6 | Aside from the documentation presented on the main cereal site, this doxygen 7 | page offers code level documentation. 8 | 9 | \section modules Browse modules 10 | 11 | cereal's code is organized into modules of similar functionality. Take a look at the modules 12 | section to learn more. Average users will not need to understand the workings of any code that falls under the 13 | internal module. 14 | 15 | \section files Browse files 16 | 17 | If you need reference on a specific file, the files page lists all files in cereal. 18 | */ 19 | 20 | //! \defgroup Archives Input and Output Archive Types 21 | 22 | /*! \defgroup Access Access Control and Disambiguation 23 | Provides ways to give cereal access to protected member functions, disambiguate 24 | which serialization function cereal should use, and provide ways of using smart 25 | pointers with types that have no default constructor. */ 26 | 27 | /*! \defgroup Utility Utility Functionality 28 | Name-value pairs, binary data wrappers, exceptions, and other utility functions */ 29 | 30 | /*! \defgroup TypeSupport Support for Serializing Various Types 31 | Serialization of many types is shipped with cereal, including most of the standard library as well as a few others. */ 32 | 33 | /*! \defgroup STLSupport Standard Library Support 34 | Serialization methods for nearly all types found in the C++ standard library. 35 | \ingroup TypeSupport */ 36 | 37 | /*! \defgroup TypeConcepts Abstract Type Concept Support 38 | Serialization methods for more abstract type concepts that can generalize over many types. 39 | \ingroup TypeSupport */ 40 | 41 | /*! \defgroup OtherTypes Miscellaneous Types Support 42 | Support for various other types such as smart pointers to polymorphic base classes, boost::variant, etc. 43 | \ingroup TypeSupport */ 44 | 45 | /*! \defgroup Internal Internal Functionality 46 | Various classes and functions that are critical for the operation of cereal but of no 47 | interest to users */ 48 | -------------------------------------------------------------------------------- /libraries/cereal/include/cereal/external/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../stream.h" 19 | 20 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | //! Custom strlen() which works on different character types. 24 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 25 | \param s Null-terminated input string. 26 | \return Number of characters in the string. 27 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 28 | */ 29 | template 30 | inline SizeType StrLen(const Ch* s) { 31 | const Ch* p = s; 32 | while (*p) ++p; 33 | return SizeType(p - s); 34 | } 35 | 36 | //! Returns number of code points in a encoded string. 37 | template 38 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { 39 | GenericStringStream is(s); 40 | const typename Encoding::Ch* end = s + length; 41 | SizeType count = 0; 42 | while (is.src_ < end) { 43 | unsigned codepoint; 44 | if (!Encoding::Decode(is, &codepoint)) 45 | return false; 46 | count++; 47 | } 48 | *outCount = count; 49 | return true; 50 | } 51 | 52 | } // namespace internal 53 | CEREAL_RAPIDJSON_NAMESPACE_END 54 | 55 | #endif // CEREAL_RAPIDJSON_INTERNAL_STRFUNC_H_ 56 | -------------------------------------------------------------------------------- /libraries/cereal/include/cereal/external/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | CEREAL_RAPIDJSON_DIAG_PUSH 22 | CEREAL_RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | CEREAL_RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) CEREAL_RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | CEREAL_RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | CEREAL_RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // CEREAL_RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /libraries/cereal/include/cereal/types/functional.hpp: -------------------------------------------------------------------------------- 1 | /*! \file functional.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2016, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_FUNCTIONAL_HPP_ 31 | #define CEREAL_TYPES_FUNCTIONAL_HPP_ 32 | 33 | #include 34 | 35 | namespace cereal 36 | { 37 | //! Saving for std::less 38 | template inline 39 | void serialize( Archive &, std::less & ) 40 | { } 41 | } // namespace cereal 42 | 43 | #endif // CEREAL_TYPES_FUNCTIONAL_HPP_ 44 | -------------------------------------------------------------------------------- /libraries/cereal/include/cereal/types/map.hpp: -------------------------------------------------------------------------------- 1 | /*! \file map.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_MAP_HPP_ 31 | #define CEREAL_TYPES_MAP_HPP_ 32 | 33 | #include 34 | #include 35 | 36 | #endif // CEREAL_TYPES_MAP_HPP_ 37 | -------------------------------------------------------------------------------- /libraries/cereal/include/cereal/types/unordered_map.hpp: -------------------------------------------------------------------------------- 1 | /*! \file unordered_map.hpp 2 | \brief Support for types found in \ 3 | \ingroup STLSupport */ 4 | /* 5 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | * Neither the name of cereal nor the 16 | names of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES OR SHANE GRANT BE LIABLE FOR ANY 23 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CEREAL_TYPES_UNORDERED_MAP_HPP_ 31 | #define CEREAL_TYPES_UNORDERED_MAP_HPP_ 32 | 33 | #include 34 | #include 35 | 36 | #endif // CEREAL_TYPES_UNORDERED_MAP_HPP_ 37 | -------------------------------------------------------------------------------- /libraries/cereal/sandbox/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(sandbox_shared_lib) 2 | 3 | add_executable(sandbox sandbox.cpp) 4 | add_executable(sandbox_json sandbox_json.cpp) 5 | add_executable(sandbox_rtti sandbox_rtti.cpp) 6 | 7 | add_executable(sandbox_vs sandbox_vs.cpp) 8 | target_link_libraries(sandbox_vs sandbox_vs_dll) 9 | include_directories(sandbox_shared_lib) 10 | 11 | if(Boost_FOUND) 12 | add_executable(performance performance.cpp) 13 | target_link_libraries(performance ${Boost_LIBRARIES}) 14 | endif(Boost_FOUND) 15 | -------------------------------------------------------------------------------- /libraries/cereal/sandbox/sandbox_shared_lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(sandbox_vs_dll SHARED base.cpp derived.cpp) 2 | -------------------------------------------------------------------------------- /libraries/cereal/sandbox/sandbox_shared_lib/base.cpp: -------------------------------------------------------------------------------- 1 | #ifndef CEREAL_DLL_USE 2 | #define CEREAL_DLL_MAKE 3 | #endif 4 | #include "base.hpp" 5 | 6 | template void Base::serialize 7 | ( cereal::XMLOutputArchive & ar, std::uint32_t const version ); 8 | template void Base::serialize 9 | ( cereal::XMLInputArchive & ar, std::uint32_t const version ); 10 | -------------------------------------------------------------------------------- /libraries/cereal/sandbox/sandbox_shared_lib/base.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #if defined (_WINDLL) 9 | #define DECLSPECIFIER __declspec(dllexport) 10 | #elif defined(MSC_VER) 11 | #define DECLSPECIFIER __declspec(dllimport) 12 | #else 13 | #define DECLSPECIFIER 14 | #endif 15 | 16 | int doit(); 17 | 18 | class VersionTest 19 | { 20 | public: 21 | int x; 22 | template 23 | void serialize( Archive & ar, const std::uint32_t /* version */ ) 24 | { ar( x ); } 25 | }; 26 | 27 | class Base 28 | { 29 | public: 30 | friend class cereal::access; 31 | 32 | template < class Archive > 33 | void serialize(Archive &, std::uint32_t const) {} 34 | virtual ~Base() {} 35 | }; 36 | 37 | extern template DECLSPECIFIER void Base::serialize 38 | ( cereal::XMLInputArchive & ar, std::uint32_t const version ); 39 | 40 | extern template DECLSPECIFIER void Base::serialize 41 | ( cereal::XMLOutputArchive & ar, std::uint32_t const version ); 42 | 43 | CEREAL_CLASS_VERSION(VersionTest, 1) 44 | -------------------------------------------------------------------------------- /libraries/cereal/sandbox/sandbox_shared_lib/derived.cpp: -------------------------------------------------------------------------------- 1 | #ifndef CEREAL_DLL_USE 2 | #define CEREAL_DLL_MAKE 3 | #endif 4 | #include "derived.hpp" 5 | 6 | template void Derived::serialize 7 | ( cereal::XMLOutputArchive & ar, std::uint32_t const version ); 8 | 9 | template void Derived::serialize 10 | ( cereal::XMLInputArchive & ar, std::uint32_t const version ); 11 | -------------------------------------------------------------------------------- /libraries/cereal/sandbox/sandbox_shared_lib/derived.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "base.hpp" 3 | class Derived : public Base 4 | { 5 | private: 6 | friend class cereal::access; 7 | template 8 | void serialize(Archive & ar, std::uint32_t const) 9 | { 10 | ar(cereal::base_class(this)); 11 | } 12 | }; 13 | 14 | extern template DECLSPECIFIER void Derived::serialize 15 | ( cereal::XMLOutputArchive & ar, std::uint32_t const version ); 16 | extern template DECLSPECIFIER void Derived::serialize 17 | ( cereal::XMLInputArchive & ar, std::uint32_t const version ); 18 | 19 | CEREAL_REGISTER_TYPE(Derived) 20 | -------------------------------------------------------------------------------- /libraries/cereal/scripts/renameincludes.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | destdir="include_renamed" 4 | 5 | echo -n "New prefix: " 6 | read newprefix 7 | 8 | cp -r include ${destdir} 9 | 10 | newprefix=$(echo ${newprefix} | sed -e 's/\//\\\//') 11 | 12 | find ${destdir} -name '*.hpp' -exec sed -i "s/#include 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /libraries/cereal/vs2013/sandbox_json/sandbox_json.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /libraries/cereal/vs2013/sandbox_rtti/sandbox_rtti.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /libraries/cereal/vs2013/sandbox_vs/sandbox_vs.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /libraries/cereal/vs2013/sandbox_vs_dll/sandbox_vs_dll.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | -------------------------------------------------------------------------------- /libraries/cereal/vs2013/unittests/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014, Randolph Voorhies, Shane Grant 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of cereal nor the 13 | names of its contributors may be used to endorse or promote products 14 | derived from this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL RANDOLPH VOORHIES AND SHANE GRANT BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define BOOST_TEST_MODULE Cereal 29 | #include 30 | #include -------------------------------------------------------------------------------- /libraries/flann/COPYING: -------------------------------------------------------------------------------- 1 | 2 | The BSD License 3 | 4 | Copyright (c) 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | Copyright (c) 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | Copyright (c) 2015 Google Inc (Jack Rae, jwrae@google.com). All Rights Reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 12 | * Neither the name of the "University of British Columbia" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 13 | 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 16 | -------------------------------------------------------------------------------- /libraries/flann/ChangeLog: -------------------------------------------------------------------------------- 1 | Version 1.6.11 2 | * bug fixes 3 | 4 | Version 1.6.10 5 | * fixed a radiusSearch bug introduced in 1.6.9 6 | 7 | Version 1.6.9 8 | * bug fixes 9 | * fixed radius search bug on MSVC compiler 10 | * fixed windows linking problems 11 | 12 | Version 1.6.8 13 | * bug fixes, low dimensional search speedup 14 | 15 | Version 1.6.7 16 | * bug fixes 17 | 18 | Version 1.6.6 19 | * misc bug fixes 20 | 21 | Version 1.6.5 22 | * fix compilation problem on some C++ compilers 23 | * fixes in the python bindings 24 | 25 | Version 1.6.4 26 | * small bug fix 27 | 28 | Version 1.6.3 29 | * radius search speedup 30 | 31 | Version 1.6.2 32 | * slight API changes to the C++ bindings, now the main index type is templated 33 | * on the distance functor which makes it easier to use custom distances 34 | * new kd-tree implementation optimized for low dimensionality data 35 | * experimental MPI support for cluster computing 36 | 37 | Version 1.5 38 | * new C++ templated API 39 | * saving/loading of indices to disk 40 | * threadsafe search 41 | * new distance types (thanks to Radu Bogdan Rusu and Romain Thibaux for the patch) 42 | * (api change) autotuned is no longer selected by passing a precision >0, it's used when the algorithm type is set to autotuned 43 | -------------------------------------------------------------------------------- /libraries/flann/bin/download_checkmd5.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | import urllib, hashlib, sys, os 4 | from optparse import OptionParser 5 | 6 | class AppURLopener(urllib.FancyURLopener): 7 | version ="Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7" 8 | 9 | def prompt_user_passwd(self, host, realm): 10 | raise Exception() 11 | urllib._urlopener = AppURLopener() 12 | 13 | def file_md5(file): 14 | m = hashlib.md5() 15 | m.update(open(dest).read()) 16 | return m.hexdigest() 17 | 18 | 19 | def main(): 20 | parser = OptionParser(usage="usage: %prog URI dest [md5sum]", prog=sys.argv[0]) 21 | options, args = parser.parse_args() 22 | md5sum = None 23 | 24 | if len(args)==2: 25 | uri, dest = args 26 | elif len(args)==3: 27 | uri, dest, md5 = args 28 | else: 29 | parser.error("Wrong arguments") 30 | 31 | fresh = False 32 | if not os.path.exists(dest): 33 | print "Downloading from %s to %s..."%(uri, dest), 34 | sys.stdout.flush() 35 | urllib.urlretrieve(uri, dest) 36 | print "done" 37 | fresh = True 38 | 39 | if md5sum: 40 | print "Computing md5sum on downloaded file", 41 | sys.stdout.flush() 42 | checksum = md5_file(dest) 43 | print "done" 44 | 45 | if checksum!=md5sum: 46 | if not fresh: 47 | print "Checksum mismatch (%s != %s), re-downloading file %s"%(checksum, md5sum, dest), 48 | sys.stdout.flush() 49 | os.remove(dest) 50 | urllib.urlretrieve(uri, dest) 51 | print "done" 52 | 53 | print "Computing md5sum on downloaded file", 54 | sys.stdout.flush() 55 | checksum = md5_file(dest) 56 | print "done" 57 | 58 | if checksum!=md5sum: 59 | print "ERROR, checksum mismatch (%s != %s) on %d",(checksum, md5sum, dest) 60 | return 1 61 | return 0 62 | 63 | 64 | if __name__ == '__main__': 65 | try: 66 | sys.exit(main()) 67 | except Exception as e: 68 | print "ERROR, ",e 69 | sys.exit(1) 70 | -------------------------------------------------------------------------------- /libraries/flann/bin/indent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=`dirname $0` 4 | uncrustify --no-backup -c ${DIR}/uncrustify.cfg $1 5 | 6 | -------------------------------------------------------------------------------- /libraries/flann/bin/make_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | VERSION=`grep "set(FLANN_VERSION" CMakeLists.txt | sed 's/[^0-9]*\([0-9]*\.[0-9]*\.[0-9]*\)[^0-9]*/\1/'` 3 | 4 | echo "Creating flann-$VERSION-src.zip" 5 | 6 | git archive --prefix=flann-$VERSION-src/ -o flann-$VERSION-src.zip $VERSION-src 7 | -------------------------------------------------------------------------------- /libraries/flann/bin/run_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | 4 | import sys 5 | import os.path as op 6 | import unittest 7 | 8 | if __name__ == "__main__": 9 | if len(sys.argv)==1: 10 | print "Usage: %s file"%sys.argv[0] 11 | sys.exit(1) 12 | 13 | python_path = op.abspath(op.join( op.dirname(__file__),"..","src","python")) 14 | sys.path.append(python_path) 15 | 16 | test_file = sys.argv[1] 17 | sys.argv = sys.argv[1:] 18 | execfile(test_file) 19 | -------------------------------------------------------------------------------- /libraries/flann/cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PKG_DESC "Fast Library for Approximate Nearest Neighbors") 2 | set(pkg_conf_file ${CMAKE_CURRENT_BINARY_DIR}/flann.pc) 3 | configure_file(flann.pc.in ${pkg_conf_file} @ONLY) 4 | install(FILES ${pkg_conf_file} 5 | DESTINATION ${FLANN_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT pkgconfig) 6 | 7 | -------------------------------------------------------------------------------- /libraries/flann/cmake/FindFlann.cmake: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Find Flann 3 | # 4 | # This sets the following variables: 5 | # FLANN_FOUND - True if FLANN was found. 6 | # FLANN_INCLUDE_DIRS - Directories containing the FLANN include files. 7 | # FLANN_LIBRARIES - Libraries needed to use FLANN. 8 | # FLANN_DEFINITIONS - Compiler flags for FLANN. 9 | 10 | find_package(PkgConfig) 11 | pkg_check_modules(PC_FLANN flann) 12 | set(FLANN_DEFINITIONS ${PC_FLANN_CFLAGS_OTHER}) 13 | 14 | find_path(FLANN_INCLUDE_DIR flann/flann.hpp 15 | HINTS ${PC_FLANN_INCLUDEDIR} ${PC_FLANN_INCLUDE_DIRS}) 16 | 17 | find_library(FLANN_LIBRARY flann 18 | HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS}) 19 | 20 | set(FLANN_INCLUDE_DIRS ${FLANN_INCLUDE_DIR}) 21 | set(FLANN_LIBRARIES ${FLANN_LIBRARY}) 22 | 23 | include(FindPackageHandleStandardArgs) 24 | find_package_handle_standard_args(Flann DEFAULT_MSG 25 | FLANN_LIBRARY FLANN_INCLUDE_DIR) 26 | 27 | mark_as_advanced(FLANN_LIBRARY FLANN_INCLUDE_DIR) 28 | 29 | -------------------------------------------------------------------------------- /libraries/flann/cmake/flann.pc.in: -------------------------------------------------------------------------------- 1 | # This file was generated by CMake for @PROJECT_NAME@ 2 | prefix=@CMAKE_INSTALL_PREFIX@ 3 | exec_prefix=${prefix} 4 | libdir=${prefix}/@FLANN_LIB_INSTALL_DIR@ 5 | includedir=${prefix}/include 6 | 7 | Name: @PROJECT_NAME@ 8 | Description: @PKG_DESC@ 9 | Version: @FLANN_VERSION@ 10 | Requires: @PKG_EXTERNAL_DEPS@ 11 | Libs: -L${libdir} -lflann -lflann_cpp 12 | Cflags: -I${includedir} 13 | 14 | -------------------------------------------------------------------------------- /libraries/flann/cmake/uninstall_target.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@PROJECT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: \"@PROJECT_BINARY_DIR@/install_manifest.txt\"") 3 | endif(NOT EXISTS "@PROJECT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@PROJECT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 9 | if(EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 11 | OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval) 12 | if(NOT "${rm_retval}" STREQUAL 0) 13 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 14 | endif(NOT "${rm_retval}" STREQUAL 0) 15 | else(EXISTS "$ENV{DESTDIR}${file}") 16 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 17 | endif(EXISTS "$ENV{DESTDIR}${file}") 18 | endforeach(file) 19 | 20 | -------------------------------------------------------------------------------- /libraries/flann/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(LATEX) 2 | 3 | if (NOT DOCDIR) 4 | set(DOCDIR share/doc/flann) 5 | endif () 6 | 7 | if (EXISTS ${PDFLATEX_COMPILER} AND EXISTS ${BIBTEX_COMPILER}) 8 | include(${PROJECT_SOURCE_DIR}/cmake/UseLATEX.cmake) 9 | 10 | add_latex_document(manual.tex BIBFILES references.bib IMAGE_DIRS images DEFAULT_PDF) 11 | 12 | add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/manual.pdf 13 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/manual.pdf ${CMAKE_CURRENT_SOURCE_DIR}/manual.pdf 14 | DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/manual.pdf 15 | ) 16 | add_custom_target(doc DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/manual.pdf) 17 | endif() 18 | 19 | install( 20 | FILES manual.pdf 21 | DESTINATION ${DOCDIR} 22 | OPTIONAL 23 | ) 24 | -------------------------------------------------------------------------------- /libraries/flann/doc/images/cmake-gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/flann/doc/images/cmake-gui.png -------------------------------------------------------------------------------- /libraries/flann/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_custom_target(examples ALL) 2 | 3 | 4 | if (BUILD_C_BINDINGS) 5 | add_executable(flann_example_c flann_example.c) 6 | target_link_libraries(flann_example_c flann) 7 | set_target_properties(flann_example_c PROPERTIES COMPILE_FLAGS -std=c99) 8 | 9 | add_dependencies(examples flann_example_c) 10 | install (TARGETS flann_example_c DESTINATION bin ) 11 | endif() 12 | 13 | if (HDF5_FOUND) 14 | include_directories(${HDF5_INCLUDE_DIR}) 15 | 16 | add_executable(flann_example_cpp flann_example.cpp) 17 | target_link_libraries(flann_example_cpp ${HDF5_LIBRARIES} flann_cpp) 18 | if (HDF5_IS_PARALLEL) 19 | target_link_libraries(flann_example_cpp ${MPI_LIBRARIES}) 20 | endif() 21 | 22 | add_dependencies(examples flann_example_cpp) 23 | install (TARGETS flann_example_cpp DESTINATION bin) 24 | 25 | 26 | if (USE_MPI AND HDF5_IS_PARALLEL) 27 | add_executable(flann_example_mpi flann_example_mpi.cpp) 28 | target_link_libraries(flann_example_mpi flann_cpp ${HDF5_LIBRARIES} ${MPI_LIBRARIES} ${Boost_LIBRARIES}) 29 | 30 | add_dependencies(examples flann_example_mpi) 31 | install (TARGETS flann_example_mpi DESTINATION bin) 32 | endif() 33 | else() 34 | message("hdf5 library not found, not compiling flann_example.cpp") 35 | endif() 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /libraries/flann/examples/README: -------------------------------------------------------------------------------- 1 | 2 | These examples use some datasets that are not included in the source distribution. You can download the datasets from here: 3 | 4 | http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/dataset.hdf5 5 | http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/dataset.dat 6 | http://people.cs.ubc.ca/~mariusm/uploads/FLANN/datasets/testset.dat 7 | -------------------------------------------------------------------------------- /libraries/flann/examples/flann_example.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | using namespace flann; 8 | 9 | int main(int argc, char** argv) 10 | { 11 | int nn = 3; 12 | 13 | Matrix dataset; 14 | Matrix query; 15 | load_from_file(dataset, "dataset.hdf5","dataset"); 16 | load_from_file(query, "dataset.hdf5","query"); 17 | 18 | Matrix indices(new int[query.rows*nn], query.rows, nn); 19 | Matrix dists(new float[query.rows*nn], query.rows, nn); 20 | 21 | // construct an randomized kd-tree index using 4 kd-trees 22 | Index > index(dataset, flann::KDTreeIndexParams(4)); 23 | index.buildIndex(); 24 | 25 | // do a knn search, using 128 checks 26 | index.knnSearch(query, indices, dists, nn, flann::SearchParams(128)); 27 | 28 | flann::save_to_file(indices,"result.hdf5","result"); 29 | 30 | delete[] dataset.ptr(); 31 | delete[] query.ptr(); 32 | delete[] indices.ptr(); 33 | delete[] dists.ptr(); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /libraries/flann/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_subdirectory( cpp ) 3 | 4 | if (BUILD_MATLAB_BINDINGS) 5 | add_subdirectory( matlab ) 6 | endif() 7 | 8 | if (BUILD_PYTHON_BINDINGS) 9 | add_subdirectory( python ) 10 | endif() 11 | -------------------------------------------------------------------------------- /libraries/flann/src/cpp/empty.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/flann/src/cpp/empty.cpp -------------------------------------------------------------------------------- /libraries/flann/src/cpp/flann/config.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef FLANN_CONFIG_H_ 31 | #define FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "1.8.4" 37 | 38 | #endif /* FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /libraries/flann/src/cpp/flann/config.h.in: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #ifndef FLANN_CONFIG_H_ 31 | #define FLANN_CONFIG_H_ 32 | 33 | #ifdef FLANN_VERSION_ 34 | #undef FLANN_VERSION_ 35 | #endif 36 | #define FLANN_VERSION_ "${FLANN_VERSION}" 37 | 38 | #endif /* FLANN_CONFIG_H_ */ 39 | -------------------------------------------------------------------------------- /libraries/flann/src/cpp/flann/flann_cpp.cpp: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Software License Agreement (BSD License) 3 | * 4 | * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 5 | * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | *************************************************************************/ 28 | 29 | 30 | #include "flann/flann.hpp" 31 | -------------------------------------------------------------------------------- /libraries/flann/src/cpp/flann/mpi/flann_mpi_client.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | 12 | #define IF_RANK0 if (world.rank()==0) 13 | 14 | timeval start_time_; 15 | void start_timer(const std::string& message = "") 16 | { 17 | if (!message.empty()) { 18 | printf("%s", message.c_str()); 19 | fflush(stdout); 20 | } 21 | gettimeofday(&start_time_,NULL); 22 | } 23 | 24 | double stop_timer() 25 | { 26 | timeval end_time; 27 | gettimeofday(&end_time,NULL); 28 | 29 | return double(end_time.tv_sec-start_time_.tv_sec)+ double(end_time.tv_usec-start_time_.tv_usec)/1000000; 30 | } 31 | 32 | float compute_precision(const flann::Matrix& match, const flann::Matrix& indices) 33 | { 34 | int count = 0; 35 | 36 | assert(match.rows == indices.rows); 37 | size_t nn = std::min(match.cols, indices.cols); 38 | 39 | for(size_t i=0; i query; 58 | flann::Matrix match; 59 | 60 | flann::load_from_file(query, "sift100K.h5","query"); 61 | flann::load_from_file(match, "sift100K.h5","match"); 62 | // flann::load_from_file(gt_dists, "sift100K.h5","dists"); 63 | 64 | flann::mpi::Client index("localhost","9999"); 65 | 66 | int nn = 1; 67 | flann::Matrix indices(new int[query.rows*nn], query.rows, nn); 68 | flann::Matrix dists(new float[query.rows*nn], query.rows, nn); 69 | 70 | start_timer("Performing search...\n"); 71 | index.knnSearch(query, indices, dists, nn, flann::SearchParams(64)); 72 | printf("Search done (%g seconds)\n", stop_timer()); 73 | 74 | printf("Checking results\n"); 75 | float precision = compute_precision(match, indices); 76 | printf("Precision is: %g\n", precision); 77 | 78 | } 79 | catch (std::exception& e) { 80 | std::cerr << "Exception: " << e.what() << "\n"; 81 | } 82 | 83 | return 0; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /libraries/flann/src/cpp/flann/mpi/flann_mpi_server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char* argv[]) 7 | { 8 | boost::mpi::environment env(argc, argv); 9 | 10 | try { 11 | if (argc != 4) { 12 | std::cout << "Usage: " << argv[0] << " \n"; 13 | return 1; 14 | } 15 | flann::mpi::Server > server(argv[1], argv[2], std::atoi(argv[3]), 16 | flann::KDTreeIndexParams(4)); 17 | 18 | server.run(); 19 | } 20 | catch (std::exception& e) { 21 | std::cerr << "Exception: " << e.what() << "\n"; 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /libraries/flann/src/matlab/flann_free_index.m: -------------------------------------------------------------------------------- 1 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 2 | %Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 3 | % 4 | %THE BSD LICENSE 5 | % 6 | %Redistribution and use in source and binary forms, with or without 7 | %modification, are permitted provided that the following conditions 8 | %are met: 9 | % 10 | %1. Redistributions of source code must retain the above copyright 11 | % notice, this list of conditions and the following disclaimer. 12 | %2. Redistributions in binary form must reproduce the above copyright 13 | % notice, this list of conditions and the following disclaimer in the 14 | % documentation and/or other materials provided with the distribution. 15 | % 16 | %THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | %IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | %OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | %IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | %INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | %NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | %DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | %THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | %(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | %THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | function flann_free_index(index_id) 28 | %FLANN_FREE_INDEX Deletes the nearest-neighbors index 29 | % 30 | % Deletes an index constructed using flann_build_index. 31 | 32 | % Marius Muja, January 2008 33 | 34 | nearest_neighbors('free_index',index_id); 35 | end -------------------------------------------------------------------------------- /libraries/flann/src/matlab/flann_load_index.m: -------------------------------------------------------------------------------- 1 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 2 | %Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 3 | % 4 | %THE BSD LICENSE 5 | % 6 | %Redistribution and use in source and binary forms, with or without 7 | %modification, are permitted provided that the following conditions 8 | %are met: 9 | % 10 | %1. Redistributions of source code must retain the above copyright 11 | % notice, this list of conditions and the following disclaimer. 12 | %2. Redistributions in binary form must reproduce the above copyright 13 | % notice, this list of conditions and the following disclaimer in the 14 | % documentation and/or other materials provided with the distribution. 15 | % 16 | %THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | %IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | %OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | %IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | %INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | %NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | %DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | %THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | %(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | %THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | function index = flann_load_index(filename, dataset) 28 | %FLANN_LOAD_INDEX Loads an index from disk 29 | % 30 | % Marius Muja, March 2009 31 | 32 | index = nearest_neighbors('load_index', filename, dataset); 33 | end -------------------------------------------------------------------------------- /libraries/flann/src/matlab/flann_save_index.m: -------------------------------------------------------------------------------- 1 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 2 | %Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 3 | % 4 | %THE BSD LICENSE 5 | % 6 | %Redistribution and use in source and binary forms, with or without 7 | %modification, are permitted provided that the following conditions 8 | %are met: 9 | % 10 | %1. Redistributions of source code must retain the above copyright 11 | % notice, this list of conditions and the following disclaimer. 12 | %2. Redistributions in binary form must reproduce the above copyright 13 | % notice, this list of conditions and the following disclaimer in the 14 | % documentation and/or other materials provided with the distribution. 15 | % 16 | %THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | %IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | %OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | %IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | %INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | %NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | %DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | %THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | %(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | %THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | function flann_save_index(index_id, filename) 28 | %FLANN_SAVE_INDEX Saves an index to disk 29 | % 30 | 31 | % Marius Muja, March 2010 32 | 33 | nearest_neighbors('save_index',index_id, filename); 34 | end -------------------------------------------------------------------------------- /libraries/flann/src/matlab/flann_set_distance_type.m: -------------------------------------------------------------------------------- 1 | %Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 2 | %Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 3 | % 4 | %THE BSD LICENSE 5 | % 6 | %Redistribution and use in source and binary forms, with or without 7 | %modification, are permitted provided that the following conditions 8 | %are met: 9 | % 10 | %1. Redistributions of source code must retain the above copyright 11 | % notice, this list of conditions and the following disclaimer. 12 | %2. Redistributions in binary form must reproduce the above copyright 13 | % notice, this list of conditions and the following disclaimer in the 14 | % documentation and/or other materials provided with the distribution. 15 | % 16 | %THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | %IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | %OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | %IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | %INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | %NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | %DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | %THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | %(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | %THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | function flann_set_distance_type(type, order) 28 | %FLANN_LOAD_INDEX Loads an index from disk 29 | % 30 | % Marius Muja, March 2009 31 | 32 | distances = struct('euclidean', 1, 'manhattan', 2, 'minkowski', 3, 'max_dist', 4, 'hik', 5, 'hellinger', 6, 'chi_square', 7, 'cs', 7, 'kullback_leibler', 8, 'kl', 8); 33 | 34 | if ~isnumeric(type), 35 | type = value2id(distances,type); 36 | end 37 | if type~=3 38 | order = 0; 39 | end 40 | nearest_neighbors('set_distance_type', type, order); 41 | end 42 | 43 | function id = value2id(map,value) 44 | id = map.(value); 45 | end 46 | -------------------------------------------------------------------------------- /libraries/flann/src/python/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file( setup.py.tpl setup.py ) 2 | 3 | install( DIRECTORY pyflann DESTINATION share/flann/python ) 4 | install( FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.py DESTINATION share/flann/python ) 5 | 6 | 7 | # python instalation 8 | if (PYTHON_EXECUTABLE) 9 | install(CODE "execute_process( 10 | COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/setup.py install 11 | WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")") 12 | endif() 13 | -------------------------------------------------------------------------------- /libraries/flann/src/python/pyflann/__init__.py: -------------------------------------------------------------------------------- 1 | #Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 2 | #Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 3 | # 4 | #THE BSD LICENSE 5 | # 6 | #Redistribution and use in source and binary forms, with or without 7 | #modification, are permitted provided that the following conditions 8 | #are met: 9 | # 10 | #1. Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | #2. Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # 16 | #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | #OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | #IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | #INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | #NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | #DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | #THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | #THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | #import sys 28 | #import os 29 | #sys.path.insert(0, os.path.split(__file__)[0]) # make python3 happy 30 | 31 | from pyflann.index import * 32 | -------------------------------------------------------------------------------- /libraries/flann/src/python/pyflann/exceptions.py: -------------------------------------------------------------------------------- 1 | #Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. 2 | #Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. 3 | # 4 | #THE BSD LICENSE 5 | # 6 | #Redistribution and use in source and binary forms, with or without 7 | #modification, are permitted provided that the following conditions 8 | #are met: 9 | # 10 | #1. Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | #2. Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # 16 | #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | #OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | #IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | #INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | #NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | #DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | #THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | #THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | 28 | # This module defines exceptions that are used by the flann python bindings 29 | 30 | class FLANNException(Exception): 31 | def __init__(self, *args): 32 | Exception.__init__(self, *args) 33 | -------------------------------------------------------------------------------- /libraries/flann/src/python/setup.py.tpl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | from distutils.core import setup 4 | from os.path import exists, abspath, dirname, join 5 | import os 6 | import sys 7 | 8 | 9 | def find_path(): 10 | lib_paths = [ os.path.abspath('@LIBRARY_OUTPUT_PATH@'), abspath(join(dirname(dirname(sys.argv[0])), '../../../lib')) ] 11 | possible_libs = ['libflann.so', 'flann.dll', 'libflann.dll', 'libflann.dylib'] 12 | 13 | for path in lib_paths: 14 | for lib in possible_libs: 15 | if exists(join(path,lib)): 16 | return path 17 | 18 | setup(name='flann', 19 | version='@FLANN_VERSION@', 20 | description='Fast Library for Approximate Nearest Neighbors', 21 | author='Marius Muja', 22 | author_email='mariusm@cs.ubc.ca', 23 | license='BSD', 24 | url='http://www.cs.ubc.ca/~mariusm/flann/', 25 | packages=['pyflann', 'pyflann.lib'], 26 | package_dir={'pyflann.lib': find_path() }, 27 | package_data={'pyflann.lib': ['libflann.so', 'flann.dll', 'libflann.dll', 'libflann.dylib']}, 28 | ) 29 | -------------------------------------------------------------------------------- /libraries/flann/src/ruby/Gemfile: -------------------------------------------------------------------------------- 1 | # Copyright 2014 John O. Woods (john.o.woods@gmail.com), West Virginia 2 | # University's Applied Space Exploration Lab, and West Virginia Robotic 3 | # Technology Center. All rights reserved. 4 | # 5 | # THE BSD LICENSE 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions 9 | # are met: 10 | # 11 | # 1. Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # 2. Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | source 'https://rubygems.org' 29 | gemspec 30 | 31 | gem "ffi" 32 | gem "nmatrix" 33 | 34 | group :development do 35 | 36 | end -------------------------------------------------------------------------------- /libraries/flann/src/ruby/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, John Woods, WVU Applied Space Exploration Laboratory, and West Virginia Robotic Technology Center. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /libraries/flann/src/ruby/Manifest.txt: -------------------------------------------------------------------------------- 1 | Rakefile 2 | Gemfile 3 | LICENSE.txt 4 | Manifest.txt 5 | flann.gemspec 6 | lib/flann.rb 7 | lib/index.rb 8 | lib/flann/index.rb 9 | lib/flann/version.rb 10 | spec/spec_helper.rb 11 | spec/flann_spec.rb 12 | spec/index_spec.rb -------------------------------------------------------------------------------- /libraries/flann/src/ruby/lib/flann/version.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2014 John O. Woods (john.o.woods@gmail.com), West Virginia 2 | # University's Applied Space Exploration Lab, and West Virginia Robotic 3 | # Technology Center. All rights reserved. 4 | # 5 | # THE BSD LICENSE 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions 9 | # are met: 10 | # 11 | # 1. Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # 2. Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | module Flann 29 | module VERSION 30 | MAJOR = 1 31 | MINOR = 8 32 | TINY = 4 33 | MINISCULE = 2 34 | 35 | STRING = [MAJOR, MINOR, TINY, MINISCULE].compact.join('.') 36 | end 37 | end -------------------------------------------------------------------------------- /libraries/flann/src/ruby/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright 2014 John O. Woods (john.o.woods@gmail.com), West Virginia 2 | # University's Applied Space Exploration Lab, and West Virginia Robotic 3 | # Technology Center. All rights reserved. 4 | # 5 | # THE BSD LICENSE 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions 9 | # are met: 10 | # 11 | # 1. Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # 2. Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | require 'rspec' 29 | require 'rspec/longrun' 30 | 31 | require "./lib/flann" 32 | 33 | # Helper function for reading a test dataset so we can test nearest neighbors 34 | # and radius search and such. 35 | def read_dataset filename 36 | Dir.chdir("spec") do 37 | f = File.new(filename, 'r') 38 | n = NMatrix.new([65536, 3], dtype: :float32) 39 | i = 0 40 | while line = f.gets 41 | line.chomp! 42 | fields = line.split 43 | n[i,:*] = fields.map { |field| field.to_f } 44 | 45 | i += 1 46 | end 47 | 48 | n 49 | end 50 | end -------------------------------------------------------------------------------- /libraries/flann/test/memusage_clustering.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | from os.path import * 4 | from pyflann import * 5 | from guppy import hpy 6 | from numpy.random import rand 7 | 8 | import os, gc 9 | 10 | _proc_status = '/proc/%d/status' % os.getpid() 11 | 12 | _scale = {'kB': 1024.0, 'mB': 1024.0*1024.0, 13 | 'KB': 1024.0, 'MB': 1024.0*1024.0} 14 | 15 | def _VmB(VmKey): 16 | '''Private. 17 | ''' 18 | global _proc_status, _scale 19 | # get pseudo file /proc//status 20 | try: 21 | t = open(_proc_status) 22 | v = t.read() 23 | t.close() 24 | except: 25 | return 0.0 # non-Linux? 26 | # get VmKey line e.g. 'VmRSS: 9999 kB\n ...' 27 | i = v.index(VmKey) 28 | v = v[i:].split(None, 3) # whitespace 29 | if len(v) < 3: 30 | return 0.0 # invalid format? 31 | # convert Vm value to bytes 32 | return float(v[1]) * _scale[v[2]] 33 | 34 | 35 | def memory(since=0.0): 36 | '''Return memory usage in bytes. 37 | ''' 38 | return _VmB('VmSize:') - since 39 | 40 | 41 | def resident(since=0.0): 42 | '''Return resident memory usage in bytes. 43 | ''' 44 | return _VmB('VmRSS:') - since 45 | 46 | 47 | def stacksize(since=0.0): 48 | '''Return stack size in bytes. 49 | ''' 50 | return _VmB('VmStk:') - since 51 | 52 | 53 | 54 | if __name__ == '__main__': 55 | 56 | print 'Profiling Memory usage for pyflann; CTRL-C to stop.' 57 | print 'Increasing total process memory, relative to the python memory, ' 58 | print 'implies a memory leak in the external libs.' 59 | print 'Increasing python memory implies a memory leak in the python code.' 60 | 61 | h = hpy() 62 | 63 | while True: 64 | s = str(h.heap()) 65 | 66 | print 'Python: %s; Process Total: %s' % (s[:s.find('\n')], memory()) 67 | 68 | X = rand(30000, 2) 69 | pf = FLANN() 70 | cl = pf.kmeans(X, 20) 71 | del X 72 | del cl 73 | del pf 74 | gc.collect() 75 | 76 | -------------------------------------------------------------------------------- /libraries/flann/test/memusage_nn.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | from os.path import * 4 | from pyflann import * 5 | from guppy import hpy 6 | from numpy.random import rand 7 | 8 | import os, gc 9 | 10 | _proc_status = '/proc/%d/status' % os.getpid() 11 | 12 | _scale = {'kB': 1024.0, 'mB': 1024.0*1024.0, 13 | 'KB': 1024.0, 'MB': 1024.0*1024.0} 14 | 15 | def _VmB(VmKey): 16 | '''Private. 17 | ''' 18 | global _proc_status, _scale 19 | # get pseudo file /proc//status 20 | try: 21 | t = open(_proc_status) 22 | v = t.read() 23 | t.close() 24 | except: 25 | return 0.0 # non-Linux? 26 | # get VmKey line e.g. 'VmRSS: 9999 kB\n ...' 27 | i = v.index(VmKey) 28 | v = v[i:].split(None, 3) # whitespace 29 | if len(v) < 3: 30 | return 0.0 # invalid format? 31 | # convert Vm value to bytes 32 | return float(v[1]) * _scale[v[2]] 33 | 34 | 35 | def memory(since=0.0): 36 | '''Return memory usage in bytes. 37 | ''' 38 | return _VmB('VmSize:') - since 39 | 40 | 41 | def resident(since=0.0): 42 | '''Return resident memory usage in bytes. 43 | ''' 44 | return _VmB('VmRSS:') - since 45 | 46 | 47 | def stacksize(since=0.0): 48 | '''Return stack size in bytes. 49 | ''' 50 | return _VmB('VmStk:') - since 51 | 52 | 53 | 54 | if __name__ == '__main__': 55 | 56 | print 'Profiling Memory usage for pyflann; CTRL-C to stop.' 57 | print 'Increasing total process memory, relative to the python memory, ' 58 | print 'implies a memory leak in the external libs.' 59 | print 'Increasing python memory implies a memory leak in the python code.' 60 | 61 | h = hpy() 62 | 63 | while True: 64 | s = str(h.heap()) 65 | 66 | print 'Python: %s; Process Total: %s' % (s[:s.find('\n')], memory()) 67 | 68 | X1 = rand(50000, 2) 69 | X2 = rand(50000, 2) 70 | pf = FLANN() 71 | nnlist = pf.nn(X1, X2) 72 | del X1 73 | del X2 74 | del nnlist 75 | del pf 76 | gc.collect() 77 | 78 | -------------------------------------------------------------------------------- /libraries/flann/test/test_nn_index.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from pyflann import * 4 | from copy import copy 5 | from numpy import * 6 | from numpy.random import * 7 | import unittest 8 | 9 | 10 | class Test_PyFLANN_nn(unittest.TestCase): 11 | 12 | def setUp(self): 13 | self.nn = FLANN() 14 | 15 | 16 | class Test_PyFLANN_nn_index(unittest.TestCase): 17 | 18 | def testnn_index(self): 19 | 20 | dim = 10 21 | N = 100 22 | 23 | x = rand(N, dim) 24 | nn = FLANN() 25 | nn.build_index(x) 26 | 27 | nnidx, nndist = nn.nn_index(x) 28 | correct = all(nnidx == arange(N, dtype = index_type)) 29 | 30 | nn.delete_index() 31 | self.assertTrue(correct) 32 | 33 | 34 | def testnn_index_random_permute(self): 35 | 36 | numtests = 500 37 | dim = 10 38 | N = 100 39 | 40 | nns = [None]*numtests 41 | x = [rand(N, dim) for i in range(numtests)] 42 | correct = ones(numtests, dtype=bool_) 43 | 44 | for i in permutation(numtests): 45 | nns[i] = FLANN() 46 | nns[i].build_index(x[i]) 47 | 48 | # For kicks 49 | if rand() < 0.5: 50 | nns[i].kmeans(x[i], 5) 51 | if rand() < 0.5: 52 | nns[i].nn(x[i], x[i]) 53 | 54 | 55 | for i in permutation(numtests): 56 | nnidx,nndist = nns[i].nn_index(x[i]) 57 | correct[i] = all(nnidx == arange(N, dtype = index_type)) 58 | 59 | for i in reversed(range(numtests)): 60 | if rand() < 0.5: 61 | nns[i].delete_index() 62 | else: 63 | del nns[i] 64 | 65 | self.assertTrue(all(correct)) 66 | 67 | def testnn_index_bad_index_call_noindex(self): 68 | nn = FLANN() 69 | self.assertRaises(FLANNException, lambda: nn.nn_index(rand(5,5))) 70 | 71 | 72 | def testnn_index_bad_index_call_delindex(self): 73 | nn = FLANN() 74 | nn.build_index(rand(5,5)) 75 | nn.delete_index() 76 | 77 | self.assertRaises(FLANNException, lambda: nn.nn_index(rand(5,5))) 78 | 79 | 80 | if __name__ == '__main__': 81 | unittest.main() 82 | -------------------------------------------------------------------------------- /libraries/gtest/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Hady Zalek 15 | Jeffrey Yasskin 16 | Jói Sigurðsson 17 | Keir Mierle 18 | Keith Ray 19 | Kenton Varda 20 | Manuel Klimek 21 | Markus Heule 22 | Mika Raento 23 | Miklós Fazekas 24 | Pasi Valminen 25 | Patrick Hanna 26 | Patrick Riley 27 | Peter Kaminski 28 | Preston Jackson 29 | Rainer Klaffenboeck 30 | Russ Cox 31 | Russ Rufer 32 | Sean Mcafee 33 | Sigurður Ásgeirsson 34 | Tracy Bialik 35 | Vadim Berman 36 | Vlad Losev 37 | Zhanyong Wan 38 | -------------------------------------------------------------------------------- /libraries/gtest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /libraries/gtest/build-aux/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/gtest/build-aux/.keep -------------------------------------------------------------------------------- /libraries/gtest/codegear/gtest.groupproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {c1d923e0-6cba-4332-9b6f-3420acbf5091} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Default.Personality 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /libraries/gtest/codegear/gtest_all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // C++Builder's IDE cannot build a static library from files with hyphens 35 | // in their name. See http://qc.codegear.com/wc/qcmain.aspx?d=70977 . 36 | // This file serves as a workaround. 37 | 38 | #include "src/gtest-all.cc" 39 | -------------------------------------------------------------------------------- /libraries/gtest/codegear/gtest_link.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: Josh Kelley (joshkel@gmail.com) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Links gtest.lib and gtest_main.lib into the current project in C++Builder. 35 | // This means that these libraries can't be renamed, but it's the only way to 36 | // ensure that Debug versus Release test builds are linked against the 37 | // appropriate Debug or Release build of the libraries. 38 | 39 | #pragma link "gtest.lib" 40 | #pragma link "gtest_main.lib" 41 | -------------------------------------------------------------------------------- /libraries/gtest/docs/Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **(the SVN trunk version)** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](Samples.md) -- learn from examples. 7 | * [AdvancedGuide](AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /libraries/gtest/docs/Samples.md: -------------------------------------------------------------------------------- 1 | If you're like us, you'd like to look at some Google Test sample code. The 2 | [samples folder](../samples) has a number of well-commented samples showing how to use a 3 | variety of Google Test features. 4 | 5 | * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions. 6 | * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions. 7 | * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture. 8 | * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test. 9 | * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. 10 | * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests. 11 | * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests. 12 | * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests. 13 | * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. 14 | * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker. 15 | -------------------------------------------------------------------------------- /libraries/gtest/docs/V1_5_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all official documentation wiki pages for Google Test **1.5.0** -- **if you use a different version of Google Test, make sure to read the documentation for that version instead.** 2 | 3 | * [Primer](V1_5_Primer.md) -- start here if you are new to Google Test. 4 | * [Samples](Samples.md) -- learn from examples. 5 | * [AdvancedGuide](V1_5_AdvancedGuide.md) -- learn more about Google Test. 6 | * [XcodeGuide](V1_5_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 7 | * [Frequently-Asked Questions](V1_5_FAQ.md) -- check here before asking a question on the mailing list. 8 | 9 | To contribute code to Google Test, read: 10 | 11 | * DevGuide -- read this _before_ writing your first patch. 12 | * [PumpManual](V1_5_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /libraries/gtest/docs/V1_6_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **1.6** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](V1_6_Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](V1_6_Samples.md) -- learn from examples. 7 | * [AdvancedGuide](V1_6_AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](V1_6_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](V1_6_FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](V1_6_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /libraries/gtest/docs/V1_6_Samples.md: -------------------------------------------------------------------------------- 1 | If you're like us, you'd like to look at some Google Test sample code. The 2 | [samples folder](../samples) has a number of well-commented samples showing how to use a 3 | variety of Google Test features. 4 | 5 | * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions. 6 | * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions. 7 | * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture. 8 | * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test. 9 | * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. 10 | * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests. 11 | * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests. 12 | * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests. 13 | * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. 14 | * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker. 15 | -------------------------------------------------------------------------------- /libraries/gtest/docs/V1_7_Documentation.md: -------------------------------------------------------------------------------- 1 | This page lists all documentation wiki pages for Google Test **(the SVN trunk version)** 2 | -- **if you use a released version of Google Test, please read the 3 | documentation for that specific version instead.** 4 | 5 | * [Primer](V1_7_Primer.md) -- start here if you are new to Google Test. 6 | * [Samples](V1_7_Samples.md) -- learn from examples. 7 | * [AdvancedGuide](V1_7_AdvancedGuide.md) -- learn more about Google Test. 8 | * [XcodeGuide](V1_7_XcodeGuide.md) -- how to use Google Test in Xcode on Mac. 9 | * [Frequently-Asked Questions](V1_7_FAQ.md) -- check here before asking a question on the mailing list. 10 | 11 | To contribute code to Google Test, read: 12 | 13 | * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch. 14 | * [PumpManual](V1_7_PumpManual.md) -- how we generate some of Google Test's source files. -------------------------------------------------------------------------------- /libraries/gtest/docs/V1_7_Samples.md: -------------------------------------------------------------------------------- 1 | If you're like us, you'd like to look at some Google Test sample code. The 2 | [samples folder](../samples) has a number of well-commented samples showing how to use a 3 | variety of Google Test features. 4 | 5 | * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions. 6 | * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions. 7 | * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture. 8 | * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test. 9 | * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it. 10 | * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests. 11 | * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests. 12 | * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests. 13 | * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results. 14 | * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker. 15 | -------------------------------------------------------------------------------- /libraries/gtest/include/gtest/internal/custom/gtest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. 31 | // The following macros can be defined: 32 | // 33 | // GTEST_OS_STACK_TRACE_GETTER_ - The name of an implementation of 34 | // OsStackTraceGetterInterface. 35 | // 36 | // ** Custom implementation starts here ** 37 | 38 | #ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 39 | #define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 40 | 41 | #endif // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 42 | -------------------------------------------------------------------------------- /libraries/gtest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #ifndef GTEST_SAMPLES_SAMPLE1_H_ 35 | #define GTEST_SAMPLES_SAMPLE1_H_ 36 | 37 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 38 | int Factorial(int n); 39 | 40 | // Returns true iff n is a prime number. 41 | bool IsPrime(int n); 42 | 43 | #endif // GTEST_SAMPLES_SAMPLE1_H_ 44 | -------------------------------------------------------------------------------- /libraries/gtest/samples/sample4.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | // 32 | // Author: wan@google.com (Zhanyong Wan) 33 | 34 | #include 35 | 36 | #include "sample4.h" 37 | 38 | // Returns the current counter value, and increments it. 39 | int Counter::Increment() { 40 | return counter_++; 41 | } 42 | 43 | // Prints the current counter value to STDOUT. 44 | void Counter::Print() const { 45 | printf("%d", counter_); 46 | } 47 | -------------------------------------------------------------------------------- /libraries/gtest/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | #include "sample4.h" 34 | 35 | // Tests the Increment() method. 36 | TEST(Counter, Increment) { 37 | Counter c; 38 | 39 | // EXPECT_EQ() evaluates its arguments exactly once, so they 40 | // can have side effects. 41 | 42 | EXPECT_EQ(0, c.Increment()); 43 | EXPECT_EQ(1, c.Increment()); 44 | EXPECT_EQ(2, c.Increment()); 45 | } 46 | -------------------------------------------------------------------------------- /libraries/gtest/scripts/test/Makefile: -------------------------------------------------------------------------------- 1 | # A Makefile for fusing Google Test and building a sample test against it. 2 | # 3 | # SYNOPSIS: 4 | # 5 | # make [all] - makes everything. 6 | # make TARGET - makes the given target. 7 | # make check - makes everything and runs the built sample test. 8 | # make clean - removes all files generated by make. 9 | 10 | # Points to the root of fused Google Test, relative to where this file is. 11 | FUSED_GTEST_DIR = output 12 | 13 | # Paths to the fused gtest files. 14 | FUSED_GTEST_H = $(FUSED_GTEST_DIR)/gtest/gtest.h 15 | FUSED_GTEST_ALL_CC = $(FUSED_GTEST_DIR)/gtest/gtest-all.cc 16 | 17 | # Where to find the sample test. 18 | SAMPLE_DIR = ../../samples 19 | 20 | # Where to find gtest_main.cc. 21 | GTEST_MAIN_CC = ../../src/gtest_main.cc 22 | 23 | # Flags passed to the preprocessor. 24 | # We have no idea here whether pthreads is available in the system, so 25 | # disable its use. 26 | CPPFLAGS += -I$(FUSED_GTEST_DIR) -DGTEST_HAS_PTHREAD=0 27 | 28 | # Flags passed to the C++ compiler. 29 | CXXFLAGS += -g 30 | 31 | all : sample1_unittest 32 | 33 | check : all 34 | ./sample1_unittest 35 | 36 | clean : 37 | rm -rf $(FUSED_GTEST_DIR) sample1_unittest *.o 38 | 39 | $(FUSED_GTEST_H) : 40 | ../fuse_gtest_files.py $(FUSED_GTEST_DIR) 41 | 42 | $(FUSED_GTEST_ALL_CC) : 43 | ../fuse_gtest_files.py $(FUSED_GTEST_DIR) 44 | 45 | gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GTEST_ALL_CC) 46 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GTEST_DIR)/gtest/gtest-all.cc 47 | 48 | gtest_main.o : $(FUSED_GTEST_H) $(GTEST_MAIN_CC) 49 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GTEST_MAIN_CC) 50 | 51 | sample1.o : $(SAMPLE_DIR)/sample1.cc $(SAMPLE_DIR)/sample1.h 52 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1.cc 53 | 54 | sample1_unittest.o : $(SAMPLE_DIR)/sample1_unittest.cc \ 55 | $(SAMPLE_DIR)/sample1.h $(FUSED_GTEST_H) 56 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(SAMPLE_DIR)/sample1_unittest.cc 57 | 58 | sample1_unittest : sample1.o sample1_unittest.o gtest-all.o gtest_main.o 59 | $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ 60 | -------------------------------------------------------------------------------- /libraries/gtest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | 34 | GTEST_API_ int main(int argc, char **argv) { 35 | printf("Running main() from gtest_main.cc\n"); 36 | testing::InitGoogleTest(&argc, argv); 37 | return RUN_ALL_TESTS(); 38 | } 39 | -------------------------------------------------------------------------------- /libraries/gtest/test/gtest-typed-test2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include 33 | 34 | #include "test/gtest-typed-test_test.h" 35 | #include "gtest/gtest.h" 36 | 37 | #if GTEST_HAS_TYPED_TEST_P 38 | 39 | // Tests that the same type-parameterized test case can be 40 | // instantiated in different translation units linked together. 41 | // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) 42 | INSTANTIATE_TYPED_TEST_CASE_P(Vector, ContainerTest, 43 | testing::Types >); 44 | 45 | #endif // GTEST_HAS_TYPED_TEST_P 46 | -------------------------------------------------------------------------------- /libraries/gtest/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | // Tests that we don't have to define main() when we link to 35 | // gtest_main instead of gtest. 36 | 37 | namespace { 38 | 39 | TEST(GTestMainTest, ShouldSucceed) { 40 | } 41 | 42 | } // namespace 43 | 44 | // We are using the main() function defined in src/gtest_main.cc, so 45 | // we don't define it here. 46 | -------------------------------------------------------------------------------- /libraries/gtest/test/gtest_uninitialized_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | 32 | #include "gtest/gtest.h" 33 | 34 | TEST(DummyTest, Dummy) { 35 | // This test doesn't verify anything. We just need it to create a 36 | // realistic stage for testing the behavior of Google Test when 37 | // RUN_ALL_TESTS() is called without testing::InitGoogleTest() being 38 | // called first. 39 | } 40 | 41 | int main() { 42 | return RUN_ALL_TESTS(); 43 | } 44 | -------------------------------------------------------------------------------- /libraries/gtest/test/gtest_xml_outfile1_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile1_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyOne : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 1); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 1); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyOne, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 1); 49 | } 50 | -------------------------------------------------------------------------------- /libraries/gtest/test/gtest_xml_outfile2_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: keith.ray@gmail.com (Keith Ray) 31 | // 32 | // gtest_xml_outfile2_test_ writes some xml via TestProperty used by 33 | // gtest_xml_outfiles_test.py 34 | 35 | #include "gtest/gtest.h" 36 | 37 | class PropertyTwo : public testing::Test { 38 | protected: 39 | virtual void SetUp() { 40 | RecordProperty("SetUpProp", 2); 41 | } 42 | virtual void TearDown() { 43 | RecordProperty("TearDownProp", 2); 44 | } 45 | }; 46 | 47 | TEST_F(PropertyTwo, TestSomeProperties) { 48 | RecordProperty("TestSomeProperty", 2); 49 | } 50 | -------------------------------------------------------------------------------- /libraries/gtest/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // This is part of the unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "production.h" 35 | 36 | PrivateCode::PrivateCode() : x_(0) {} 37 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Config/DebugProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // DebugProject.xcconfig 3 | // 4 | // These are Debug Configuration project settings for the gtest framework and 5 | // examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // No optimization 14 | GCC_OPTIMIZATION_LEVEL = 0 15 | 16 | // Deployment postprocessing is what triggers Xcode to strip, turn it off 17 | DEPLOYMENT_POSTPROCESSING = NO 18 | 19 | // Dead code stripping off 20 | DEAD_CODE_STRIPPING = NO 21 | 22 | // Debug symbols should be on obviously 23 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 24 | 25 | // Define the DEBUG macro in all debug builds 26 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1 27 | 28 | // These are turned off to avoid STL incompatibilities with client code 29 | // // Turns on special C++ STL checks to "encourage" good STL use 30 | // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS 31 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Config/General.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // General.xcconfig 3 | // 4 | // These are General configuration settings for the gtest framework and 5 | // examples. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Build for PPC and Intel, 32- and 64-bit 11 | ARCHS = i386 x86_64 ppc ppc64 12 | 13 | // Zerolink prevents link warnings so turn it off 14 | ZERO_LINK = NO 15 | 16 | // Prebinding considered unhelpful in 10.3 and later 17 | PREBINDING = NO 18 | 19 | // Strictest warning policy 20 | WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow 21 | 22 | // Work around Xcode bugs by using external strip. See: 23 | // http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html 24 | SEPARATE_STRIP = YES 25 | 26 | // Force C99 dialect 27 | GCC_C_LANGUAGE_STANDARD = c99 28 | 29 | // not sure why apple defaults this on, but it's pretty risky 30 | ALWAYS_SEARCH_USER_PATHS = NO 31 | 32 | // Turn on position dependent code for most cases (overridden where appropriate) 33 | GCC_DYNAMIC_NO_PIC = YES 34 | 35 | // Default SDK and minimum OS version is 10.4 36 | SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk 37 | MACOSX_DEPLOYMENT_TARGET = 10.4 38 | GCC_VERSION = 4.0 39 | 40 | // VERSIONING BUILD SETTINGS (used in Info.plist) 41 | GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc. 42 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Config/ReleaseProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // ReleaseProject.xcconfig 3 | // 4 | // These are Release Configuration project settings for the gtest framework 5 | // and examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // subconfig/Release.xcconfig 14 | 15 | // Optimize for space and size (Apple recommendation) 16 | GCC_OPTIMIZATION_LEVEL = s 17 | 18 | // Deploment postprocessing is what triggers Xcode to strip 19 | DEPLOYMENT_POSTPROCESSING = YES 20 | 21 | // No symbols 22 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO 23 | 24 | // Dead code strip does not affect ObjC code but can help for C 25 | DEAD_CODE_STRIPPING = YES 26 | 27 | // NDEBUG is used by things like assert.h, so define it for general compat. 28 | // ASSERT going away in release tends to create unused vars. 29 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable 30 | 31 | // When we strip we want to strip all symbols in release, but save externals. 32 | STRIP_STYLE = all 33 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.${PRODUCT_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | GTEST_VERSIONINFO_LONG 21 | CFBundleShortVersionString 22 | GTEST_VERSIONINFO_SHORT 23 | CFBundleGetInfoString 24 | ${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT} 25 | NSHumanReadableCopyright 26 | ${GTEST_VERSIONINFO_ABOUT} 27 | CSResourcesFileMapped 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /libraries/gtest/xcode/Samples/FrameworkSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.gtest.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /libraries/optimo/LICENSE: -------------------------------------------------------------------------------- 1 | optimo - A header library implementing several optimization solvers 2 | Copyright (C) 2014 Victor Fragoso 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * Neither the name of the University of California, Santa Barbara nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 25 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /libraries/optimo/README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Victor Fragoso 2 | -------------------------------------------------------------------------- 3 | 4 | Optimo 5 | ------ 6 | 7 | This header library implements several optimization solvers such as 8 | Newton, Gradient Descent, BFGS, and some primal dual newton solvers for LPs 9 | and QPs. 10 | 11 | Installation 12 | ------------ 13 | 14 | There are two options to install Optimo: 15 | 16 | 1. Copy the headers preserving the structure directory in optimo/ to some desired 17 | installation directory. 18 | 19 | 2. If you have cmake (easiest way): 20 | 21 | i) Invoke CMake: 22 | $ cmake -DCMAKE_INSTALL_PREFIX= . 23 | 24 | Here is the installation path, e.g., /usr/local/include/. 25 | 26 | ii). Install: 27 | $ make install 28 | 29 | Make sure you have permissions to write to the destination directory. 30 | 31 | If you want to remove optimo, then simply delete the /optimo directory. 32 | 33 | Dependencies 34 | ------------ 35 | 36 | 1. Eigen 3: http://eigen.tuxfamily.org/ 37 | 38 | Optional dependencies: 39 | 40 | If interested in using the primal dual LP solvers, then you require the 41 | following libraries from SuiteSparse: 42 | 43 | 1. SuiteSparse: https://www.cise.ufl.edu/research/sparse/SuiteSparse/ 44 | 45 | 2. Cholmod: https://www.cise.ufl.edu/research/sparse/cholmod/ 46 | 47 | 3. Umfpack: https://www.cise.ufl.edu/research/sparse/umfpack/ 48 | 49 | Unit tests 50 | ---------- 51 | 52 | To build this the testing examples this library requires: 53 | 54 | a) CMake: http://www.cmake.org 55 | 56 | b) Google Flags: https://code.google.com/p/gflags/ 57 | 58 | c) Google Glog: https://code.google.com/p/google-glog/ 59 | 60 | Building the Unit Tests 61 | 62 | 1. Invoke CMake: 63 | $ cmake -DBUILD_TESTING=TRUE . 64 | 65 | 2. Invoke Makefile: 66 | $ make 67 | 68 | 3. Run tests 69 | $ ./bin/_tests 70 | 71 | Contact: vfragoso@cs.ucsb.edu 72 | 73 | RELEASE NOTES: 74 | 75 | - The Infeasible Newton solver needs a more rigorous testing. 76 | 77 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #See root directory for macros 2 | ADD_SUBDIRECTORY(core) 3 | ADD_SUBDIRECTORY(solvers) 4 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Tests: 2 | IF (${OPTIMO_BUILD_TESTING}) 3 | GTEST(objects_tests) 4 | GTEST(numerical_gradient_tests) 5 | GTEST(numerical_hessian_tests) 6 | ENDIF (${OPTIMO_BUILD_TESTING}) 7 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/solvers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Tests: 2 | IF (${OPTIMO_BUILD_TESTING}) 3 | GTEST(gradient_descent_tests) 4 | GTEST(newton_tests) 5 | GTEST(primal_dual_lp_tests) 6 | GTEST(primal_dual_qp_tests) 7 | IF (SUITESPARSE_FOUND) 8 | GTEST(sparse_primal_dual_lp_tests) 9 | GTEST(sparse_primal_dual_qp_tests) 10 | ENDIF(SUITESPARSE_FOUND) 11 | GTEST(bfgs_tests) 12 | ENDIF (${OPTIMO_BUILD_TESTING}) -------------------------------------------------------------------------------- /libraries/optimo/optimo/solvers/bfgs.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Victor Fragoso 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of the University of California, Santa Barbara nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 24 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | 32 | #ifndef OPTIMO_SOLVERS_BFGS_H_ 33 | #define OPTIMO_SOLVERS_BFGS_H_ 34 | 35 | #include "optimo/solvers/bfgs_api.h" 36 | #include "optimo/solvers/bfgs_impl.h" 37 | 38 | #endif // OPTIMO_SOLVERS_BFGS_H_ 39 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/solvers/newton.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Victor Fragoso 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of the University of California, Santa Barbara nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 24 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | 32 | #ifndef OPTIMO_SOLVERS_NEWTON_H_ 33 | #define OPTIMO_SOLVERS_NEWTON_H_ 34 | 35 | #include "optimo/solvers/newton_api.h" 36 | #include "optimo/solvers/newton_impl.h" 37 | 38 | #endif // OPTIMO_SOLVERS_NEWTON_H_ 39 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/solvers/primal_dual_lp.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Victor Fragoso 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of the University of California, Santa Barbara nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 24 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | 32 | #ifndef OPTIMO_SOLVERS_PRIMAL_DUAL_LP_H_ 33 | #define OPTIMO_SOLVERS_PRIMAL_DUAL_LP_H_ 34 | #include "optimo/solvers/primal_dual_lp_api.h" 35 | #include "optimo/solvers/primal_dual_lp_impl.h" // Including implementation 36 | #endif // OPTIMO_SOLVERS_PRIMAL_DUAL_LP_H_ 37 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/solvers/primal_dual_qp.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Victor Fragoso 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of the University of California, Santa Barbara nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 24 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | 32 | #ifndef OPTIMO_SOLVERS_PRIMAL_DUAL_QP_H_ 33 | #define OPTIMO_SOLVERS_PRIMAL_DUAL_QP_H_ 34 | #include "optimo/solvers/primal_dual_qp_api.h" 35 | #include "optimo/solvers/primal_dual_qp_impl.h" 36 | #endif // OPTIMO_SOLVERS_PRIMAL_DUAL_QP_H_ 37 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/solvers/sparse_primal_dual_lp.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Victor Fragoso 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of the University of California, Santa Barbara nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 24 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | 32 | #ifndef OPTIMO_SOLVERS_SPARSE_PRIMAL_DUAL_LP_H_ 33 | #define OPTIMO_SOLVERS_SPARSE_PRIMAL_DUAL_LP_H_ 34 | #include "optimo/solvers/sparse_primal_dual_lp_api.h" 35 | #include "optimo/solvers/sparse_primal_dual_lp_impl.h" 36 | #endif // OPTIMO_SOLVERS_SPARSE_PRIMAL_DUAL_LP_H_ 37 | -------------------------------------------------------------------------------- /libraries/optimo/optimo/solvers/sparse_primal_dual_qp.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Victor Fragoso 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of the University of California, Santa Barbara nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 24 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | 32 | #ifndef OPTIMO_SOLVERS_SPARSE_PRIMAL_DUAL_QP_H_ 33 | #define OPTIMO_SOLVERS_SPARSE_PRIMAL_DUAL_QP_H_ 34 | #include "optimo/solvers/sparse_primal_dual_qp_api.h" 35 | #include "optimo/solvers/sparse_primal_dual_qp_impl.h" 36 | #endif // OPTIMO_SOLVERS_SPARSE_PRIMAL_DUAL_QP_H_ 37 | -------------------------------------------------------------------------------- /libraries/spectra/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.out 3 | include/Eigen/* 4 | -------------------------------------------------------------------------------- /libraries/spectra/.travis.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | - develop 5 | 6 | language: cpp 7 | 8 | compiler: 9 | - clang 10 | - gcc 11 | 12 | addons: 13 | apt: 14 | sources: 15 | - ubuntu-toolchain-r-test 16 | - llvm-toolchain-precise-3.8 17 | packages: 18 | - g++-6 19 | - clang-3.8 20 | 21 | before_install: 22 | - if [ "$CXX" = "g++" ]; then export CXX="g++-6"; fi 23 | - if [ "$CXX" = "clang++" ]; then export CXX="clang++-3.8"; fi 24 | - $CXX --version 25 | 26 | install: 27 | - wget https://bitbucket.org/eigen/eigen/get/3.3.3.tar.gz 28 | - tar xzf 3.3.3.tar.gz 29 | - mv eigen-eigen-67e894c6cd8f/Eigen include/ 30 | 31 | script: 32 | - cd test 33 | - make -j 4 all 34 | - make test 35 | -------------------------------------------------------------------------------- /libraries/spectra/AUTHORS.md: -------------------------------------------------------------------------------- 1 | The files 2 | 3 | - `/include/LinAlg/TridiagEigen.h` 4 | - `/include/LinAlg/UpperHessenbergEigen.h` 5 | 6 | were adapted from 7 | 8 | - `Eigen/src/Eigenvaleus/SelfAdjointEigenSolver.h` 9 | - `Eigen/src/Eigenvaleus/EigenSolver.h` 10 | 11 | in the [Eigen](http://eigen.tuxfamily.org/) library. 12 | 13 | The authors for these two files were Gael Guennebaud 14 | and Jitse Niesen . 15 | 16 | The [Catch](https://github.com/philsquared/Catch) library included for unit testing 17 | was written by Phil Nash . 18 | 19 | Other part of Spectra was written by Yixuan Qiu . 20 | -------------------------------------------------------------------------------- /libraries/spectra/benchmark/Makefile: -------------------------------------------------------------------------------- 1 | CXX = g++ 2 | CXXFLAGS = -Wall -O2 3 | CPPFLAGS = -I../include -I. 4 | FC = gfortran 5 | FFLAGS = -O3 6 | LDFLAGS = 7 | LIBS = -larpack -llapack -lblas -lgfortran 8 | 9 | HEADERS = $(wildcard ../include/MatOp/*.h) $(wildcard ../include/LinAlg/*.h) $(wildcard ../include/Util/*.h) $(wildcard ../include/*.h) 10 | OBJS = F77.o Cpp.o wrapper.o 11 | 12 | .PHONY: all clean 13 | 14 | all: benchmark.out 15 | 16 | benchmark.out: $(OBJS) main.cpp 17 | $(CXX) $(CXXFLAGS) $(CPPFLAGS) main.cpp $(OBJS) -o benchmark.out $(LDFLAGS) $(LIBS) 18 | 19 | %.o: %.cpp $(HEADERS) 20 | $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ 21 | 22 | %.o: %.f 23 | $(FC) $(FFLAGS) -c $< -o $@ 24 | 25 | clean: 26 | -rm *.out *.o 27 | -------------------------------------------------------------------------------- /libraries/spectra/benchmark/timer.h: -------------------------------------------------------------------------------- 1 | // http://stackoverflow.com/questions/17432502/how-can-i-measure-cpu-time-and-wall-clock-time-on-both-linux-windows 2 | 3 | // Windows 4 | #ifdef _WIN32 5 | #include 6 | 7 | inline double get_wall_time(){ 8 | LARGE_INTEGER time,freq; 9 | if (!QueryPerformanceFrequency(&freq)){ 10 | // Handle error 11 | return 0; 12 | } 13 | if (!QueryPerformanceCounter(&time)){ 14 | // Handle error 15 | return 0; 16 | } 17 | return (double)time.QuadPart / freq.QuadPart; 18 | } 19 | 20 | inline double get_cpu_time(){ 21 | FILETIME a,b,c,d; 22 | if (GetProcessTimes(GetCurrentProcess(),&a,&b,&c,&d) != 0){ 23 | // Returns total user time. 24 | // Can be tweaked to include kernel times as well. 25 | return 26 | (double)(d.dwLowDateTime | 27 | ((unsigned long long)d.dwHighDateTime << 32)) * 0.0000001; 28 | }else{ 29 | // Handle error 30 | return 0; 31 | } 32 | } 33 | 34 | // Posix/Linux 35 | #else 36 | #include 37 | #include 38 | 39 | inline double get_wall_time(){ 40 | struct timeval time; 41 | if (gettimeofday(&time,NULL)){ 42 | // Handle error 43 | return 0; 44 | } 45 | return (double)time.tv_sec + (double)time.tv_usec * .000001; 46 | } 47 | 48 | inline double get_cpu_time(){ 49 | return (double)clock() / CLOCKS_PER_SEC; 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /libraries/spectra/include/Util/CompInfo.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Yixuan Qiu 2 | // 3 | // This Source Code Form is subject to the terms of the Mozilla 4 | // Public License v. 2.0. If a copy of the MPL was not distributed 5 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | #ifndef COMP_INFO_H 8 | #define COMP_INFO_H 9 | 10 | namespace Spectra { 11 | 12 | 13 | /// 14 | /// \ingroup Enumerations 15 | /// 16 | /// The enumeration to report the status of computation. 17 | /// 18 | enum COMPUTATION_INFO 19 | { 20 | SUCCESSFUL = 0, ///< Computation was successful. 21 | 22 | NOT_COMPUTED, ///< Used in eigen solvers, indicating that computation 23 | ///< has not been conducted. Users should call 24 | ///< the `compute()` member function of solvers. 25 | 26 | NOT_CONVERGING, ///< Used in eigen solvers, indicating that some eigenvalues 27 | ///< did not converge. The `compute()` 28 | ///< function returns the number of converged eigenvalues. 29 | 30 | NUMERICAL_ISSUE ///< Used in Cholesky decomposition, indicating that the 31 | ///< matrix is not positive definite. 32 | }; 33 | 34 | 35 | } // namespace Spectra 36 | 37 | #endif // COMP_INFO_H 38 | -------------------------------------------------------------------------------- /libraries/spectra/include/Util/GEigsMode.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016-2017 Yixuan Qiu 2 | // 3 | // This Source Code Form is subject to the terms of the Mozilla 4 | // Public License v. 2.0. If a copy of the MPL was not distributed 5 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 | 7 | #ifndef GEIGS_MODE_H 8 | #define GEIGS_MODE_H 9 | 10 | namespace Spectra { 11 | 12 | 13 | /// 14 | /// \ingroup Enumerations 15 | /// 16 | /// The enumeration to specify the mode of generalized eigenvalue solver. 17 | /// 18 | enum GEIGS_MODE 19 | { 20 | GEIGS_CHOLESKY = 0, ///< Using Cholesky decomposition to solve generalized eigenvalues. 21 | 22 | GEIGS_REGULAR_INVERSE, ///< Regular inverse mode for generalized eigenvalue solver. 23 | 24 | GEIGS_SHIFT_INVERT, ///< Shift-and-invert mode for generalized eigenvalue solver. 25 | 26 | GEIGS_BUCKLING, ///< Buckling mode for generalized eigenvalue solver. 27 | 28 | GEIGS_CAYLEY ///< Cayley transformation mode for generalized eigenvalue solver. 29 | }; 30 | 31 | 32 | } // namespace Spectra 33 | 34 | #endif // GEIGS_MODE_H 35 | -------------------------------------------------------------------------------- /libraries/spectra/test/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS = -std=c++11 -Wall -O2 -Wno-parentheses -Wno-misleading-indentation 2 | CPPFLAGS = -I../include 3 | LDFLAGS = 4 | LIBS = 5 | 6 | HEADERS = $(wildcard ../include/MatOp/*.h) $(wildcard ../include/LinAlg/*.h) $(wildcard ../include/Util/*.h) $(wildcard ../include/*.h) 7 | 8 | 9 | .PHONY: all test clean 10 | 11 | all: QR.out Eigen.out SymEigs.out SymEigsShift.out GenEigs.out GenEigsRealShift.out GenEigsComplexShift.out \ 12 | SymGEigsCholesky.out SymGEigsRegInv.out 13 | 14 | test: 15 | -./QR.out 16 | -./Eigen.out 17 | -./SymEigs.out 18 | -./SymEigsShift.out 19 | -./GenEigs.out 20 | -./GenEigsRealShift.out 21 | -./GenEigsComplexShift.out 22 | -./SymGEigsCholesky.out 23 | -./SymGEigsRegInv.out 24 | 25 | %.out: %.cpp $(HEADERS) 26 | $(CXX) $(CXXFLAGS) $(CPPFLAGS) $< -o $@ $(LDFLAGS) $(LIBS) 27 | 28 | clean: 29 | -rm *.out 30 | -------------------------------------------------------------------------------- /libraries/statx/LICENSE: -------------------------------------------------------------------------------- 1 | statx - A useful statistical library 2 | Copyright (C) 2014 Victor Fragoso 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * Neither the name of the University of California, Santa Barbara nor the 18 | names of its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 25 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /libraries/statx/README.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 Victor Fragoso 2 | -------------------------------------------------------------------------- 3 | 4 | STATX 5 | ----- 6 | 7 | This library implements several MLE estimators for various statistical 8 | distributions as well as useful statistical functions. 9 | 10 | Installation 11 | ------------ 12 | 13 | To build and install this library CMake (http://www.cmake.org) is required. 14 | The following steps can be used to build the library: 15 | 16 | 1. Invoke Cmake 17 | $ cmake -DCMAKE_INSTALL_PREFIX= . 18 | 19 | The is the installation path, e.g., /opt/local/. 20 | 21 | 2. Compile 22 | $ make 23 | 24 | 3. Make install 25 | $ make install 26 | 27 | Make sure that you have the right permissions to write in the DESTINATION 28 | directory for the installation. 29 | 30 | Dependencies 31 | ------------ 32 | 33 | 1. Eigen: http://eigen.tuxfamily.org/ 34 | 35 | 2. Google Flags: https://code.google.com/p/gflags/ 36 | 37 | 3. Google Glog: https://code.google.com/p/google-glog/ 38 | 39 | 4. Optimo: https://bitbucket.org/vfragoso/optimo 40 | 41 | 42 | Optional dependencies 43 | --------------------- 44 | 45 | 1. ceres-solver: https://code.google.com/p/ceres-solver/ 46 | 47 | Unit Tests 48 | ---------- 49 | 50 | 1. Invoke CMake: 51 | $ cmake -DBUILD_TESTING=TRUE . 52 | 53 | 2. Invoke Makefile: 54 | $ make 55 | 56 | 3. Run tests 57 | $ ./bin/_tests 58 | 59 | Contact: vfragoso@cs.ucsb.edu 60 | 61 | RELEASE NOTES: 62 | 63 | - The parameter estimation for the generalized Pareto distribution is not 64 | yet implemented. -------------------------------------------------------------------------------- /libraries/statx/libraries/burkardt_spec_funcs/asa103.hpp: -------------------------------------------------------------------------------- 1 | // Modified by Victor Fragoso 2 | // 03/19/14 Adding Include header guards and namespace 3 | #ifndef STATS_LIBRARIES_BURKARDT_SPEC_FUNCS_ASA103_H_ 4 | #define STATS_LIBRARIES_BURKARDT_SPEC_FUNCS_ASA103_H_ 5 | namespace asa103 { 6 | double digamma (double x, int* ifault ); 7 | void psi_values (int* n_data, double* x, double* fx ); 8 | void timestamp (void); 9 | } // asa103 10 | #endif // STATS_LIBRARIES_BURKARDT_SPEC_FUNCS_ASA103_H_ 11 | -------------------------------------------------------------------------------- /libraries/statx/libraries/burkardt_spec_funcs/asa121.hpp: -------------------------------------------------------------------------------- 1 | // Modified by Victor Fragoso 2 | // 03/19/14 Adding Include header guards and namespace 3 | #ifndef STATS_LIBRARIES_BURKARDT_SPEC_FUNCS_ASA121_H_ 4 | #define STATS_LIBRARIES_BURKARDT_SPEC_FUNCS_ASA121_H_ 5 | namespace asa121 { 6 | void timestamp (void); 7 | double trigamma (double x, int* ifault); 8 | void trigamma_values (int* n_data, double* x, double* fx); 9 | } // asa121 10 | #endif // STATS_LIBRARIES_BURKARDT_SPEC_FUNCS_ASA121_H_ 11 | -------------------------------------------------------------------------------- /libraries/statx/statx/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #See root directory for macros 2 | ADD_SUBDIRECTORY(distributions) 3 | ADD_SUBDIRECTORY(utils) 4 | -------------------------------------------------------------------------------- /libraries/statx/statx/distributions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Tests: 2 | IF (${STATX_BUILD_TESTING}) 3 | GTEST(gamma_tests statx) 4 | GTEST(rayleigh_tests statx) 5 | ENDIF (${STATX_BUILD_TESTING}) 6 | 7 | #See root directory for macros 8 | ADD_SUBDIRECTORY(evd) 9 | 10 | 11 | -------------------------------------------------------------------------------- /libraries/statx/statx/distributions/evd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Tests: 2 | IF (${STATX_BUILD_TESTING}) 3 | GTEST(gpd_tests statx) 4 | GTEST(gev_tests statx) 5 | GTEST(gumbel_tests statx) 6 | ENDIF (${STATX_BUILD_TESTING}) -------------------------------------------------------------------------------- /libraries/statx/statx/utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | IF (${STATX_BUILD_TESTING}) 2 | GTEST(common_funcs_tests statx) 3 | GTEST(ecdf_tests statx) 4 | ENDIF (${STATX_BUILD_TESTING}) -------------------------------------------------------------------------------- /libraries/statx/statx/utils/ecdf.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2014 Victor Fragoso 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of the University of California, Santa Barbara nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, 24 | // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND 27 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | 32 | 33 | #ifndef STATX_UTILS_ECDF_H_ 34 | #define STATX_UTILS_ECDF_H_ 35 | 36 | #include 37 | 38 | namespace libstatx { 39 | namespace utils { 40 | // Calculates the Empirical Cummulative Distribution Function 41 | // using Kaplan-Meier estimate 42 | void ecdf(const std::vector& y, 43 | std::vector* fx, 44 | std::vector* x); 45 | } // utils 46 | } // libstatx 47 | #endif // STATX_UTILS_ECDF_H_ 48 | -------------------------------------------------------------------------------- /libraries/stlplus3/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sweeneychris/TheiaSfM/d2112f15aa69a53dda68fe6c4bd4b0f1e2fe915b/libraries/stlplus3/.DS_Store -------------------------------------------------------------------------------- /libraries/stlplus3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(stlplus3) 2 | 3 | include_directories(./) 4 | set(stlplus3_sources 5 | file_system.cpp 6 | portability_fixes.cpp 7 | wildcard.cpp) 8 | 9 | add_library(stlplus3 STATIC ${stlplus3_sources}) 10 | install(TARGETS stlplus3 11 | EXPORT TheiaExport 12 | RUNTIME DESTINATION bin 13 | LIBRARY DESTINATION lib${LIB_SUFFIX} 14 | ARCHIVE DESTINATION lib${LIB_SUFFIX}) 15 | -------------------------------------------------------------------------------- /libraries/stlplus3/portability_fixes.cpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | 3 | // Author: Andy Rushton 4 | // Copyright: (c) Southampton University 1999-2004 5 | // (c) Andy Rushton 2004 onwards 6 | // License: BSD License, see ../docs/license.html 7 | 8 | //////////////////////////////////////////////////////////////////////////////// 9 | #include "portability_fixes.hpp" 10 | 11 | #ifdef MSWINDOWS 12 | #include "windows.h" 13 | #endif 14 | 15 | //////////////////////////////////////////////////////////////////////////////// 16 | // problems with missing functions 17 | //////////////////////////////////////////////////////////////////////////////// 18 | 19 | #ifdef MSWINDOWS 20 | unsigned sleep(unsigned seconds) 21 | { 22 | Sleep(1000*seconds); 23 | // should return remaining time if interrupted - however Windoze Sleep cannot be interrupted 24 | return 0; 25 | } 26 | #endif 27 | 28 | //////////////////////////////////////////////////////////////////////////////// 29 | // Function for establishing endian-ness 30 | //////////////////////////////////////////////////////////////////////////////// 31 | 32 | bool stlplus::little_endian(void) 33 | { 34 | int sample = 1; 35 | char* sample_bytes = (char*)&sample; 36 | return sample_bytes[0] != 0; 37 | } 38 | 39 | //////////////////////////////////////////////////////////////////////////////// 40 | -------------------------------------------------------------------------------- /libraries/stlplus3/wildcard.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STLPLUS_WILDCARD 2 | #define STLPLUS_WILDCARD 3 | //////////////////////////////////////////////////////////////////////////////// 4 | 5 | // Author: Andy Rushton 6 | // Copyright: (c) Southampton University 1999-2004 7 | // (c) Andy Rushton 2004 onwards 8 | // License: BSD License, see ../docs/license.html 9 | 10 | // This is a portable interface to wildcard matching. 11 | 12 | // The problem: 13 | // * matches any number of characters - this is achieved by matching 1 and seeing if the remainder matches 14 | // if not, try 2 characters and see if the remainder matches etc. 15 | // this must be recursive, not iterative, so that multiple *s can appear in the same wildcard expression 16 | // ? matches exactly one character so doesn't need the what-if approach 17 | // \ escapes special characters such as *, ? and [ 18 | // [] matches exactly one character in the set - the difficulty is the set can contain ranges, e.g [a-zA-Z0-9] 19 | // a set cannot be empty and the ] character can be included by making it the first character 20 | 21 | //////////////////////////////////////////////////////////////////////////////// 22 | #include "portability_fixes.hpp" 23 | #include 24 | 25 | namespace stlplus 26 | { 27 | 28 | // wild = the wildcard expression 29 | // match = the string to test against that expression 30 | // e.g. wildcard("[a-f]*", "fred") returns true 31 | bool wildcard(const std::string& wild, const std::string& match); 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libraries/visual_sfm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(visual_sfm) 2 | 3 | include_directories(./) 4 | set(visual_sfm_sources 5 | FeaturePoints.cpp 6 | MatchFile.cpp) 7 | 8 | add_library(visual_sfm STATIC ${visual_sfm_sources}) 9 | if (NOT MSVC) 10 | add_definitions("-Wno-unused-result") 11 | endif (NOT MSVC) 12 | install(TARGETS visual_sfm 13 | EXPORT TheiaExport 14 | RUNTIME DESTINATION bin 15 | LIBRARY DESTINATION lib${LIB_SUFFIX} 16 | ARCHIVE DESTINATION lib${LIB_SUFFIX}) 17 | -------------------------------------------------------------------------------- /libraries/vlfeat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(vlfeat) 2 | 3 | include("${CMAKE_MODULE_PATH}/OptimizeTheiaCompilerFlags.cmake") 4 | optimizetheiacompilerflags() 5 | 6 | include_directories(./vl) 7 | set(vl_sources 8 | vl/fisher.c 9 | vl/generic.c 10 | vl/gmm.c 11 | vl/host.c 12 | vl/imopv.c 13 | vl/imopv_sse2.c 14 | vl/kmeans.c 15 | vl/kdtree.c 16 | vl/mathop.c 17 | vl/mathop_sse2.c 18 | vl/random.c 19 | vl/sift.c 20 | vl/vlad.c) 21 | set_source_files_properties(${vl_sources} PROPERTIES LANGUAGE C) 22 | 23 | if (MSVC) 24 | add_definitions(-DVL_BUILD_DLL) 25 | add_definitions(-DVL_DISABLE_SSE2) 26 | endif (MSVC) 27 | 28 | add_library(vlfeat SHARED ${vl_sources}) 29 | install(TARGETS vlfeat 30 | EXPORT TheiaExport 31 | RUNTIME DESTINATION bin 32 | LIBRARY DESTINATION lib${LIB_SUFFIX} 33 | ARCHIVE DESTINATION lib${LIB_SUFFIX}) 34 | -------------------------------------------------------------------------------- /libraries/vlfeat/vl/fisher.h: -------------------------------------------------------------------------------- 1 | /** @file fisher.h 2 | ** @brief Fisher encoding (@ref fisher) 3 | ** @author David Novotny 4 | ** @author Andrea Vedaldi 5 | ** @see @ref fisher 6 | **/ 7 | 8 | /* 9 | Copyright (C) 2013 David Novotny and Andrea Vedaldi. 10 | All rights reserved. 11 | 12 | This file is part of the VLFeat library and is made available under 13 | the terms of the BSD license (see the COPYING file). 14 | */ 15 | 16 | #ifndef VL_FISHER_H 17 | #define VL_FISHER_H 18 | 19 | #include "generic.h" 20 | 21 | /** @name Fisher vector options 22 | ** @{ */ 23 | #define VL_FISHER_FLAG_SQUARE_ROOT (0x1 << 0) 24 | #define VL_FISHER_FLAG_NORMALIZED (0x1 << 1) 25 | #define VL_FISHER_FLAG_IMPROVED (VL_FISHER_FLAG_NORMALIZED|VL_FISHER_FLAG_SQUARE_ROOT) 26 | #define VL_FISHER_FLAG_FAST (0x1 << 2) 27 | 28 | /** @def VL_FISHER_FLAG_SQUARE_ROOT 29 | ** @brief Use signed squared-root (@ref fisher-normalization). 30 | **/ 31 | 32 | /** @def VL_FISHER_FLAG_NORMALIZED 33 | ** @brief Gobally normalize the Fisher vector in L2 norm (@ref fisher-normalization). 34 | **/ 35 | 36 | /** @def VL_FISHER_FLAG_IMPROVED 37 | ** @brief Improved Fisher vector. 38 | ** This is the same as @c VL_FISHER_FLAG_SQUARE_ROOT|VL_FISHER_FLAG_NORMALIZED. 39 | **/ 40 | 41 | /** @def VL_FISHER_FLAG_FAST 42 | ** @brief Fast but more approximate calculations (@ref fisher-fast). 43 | ** Keep only the larges data to cluster assignment (posterior). 44 | **/ 45 | 46 | /** @} */ 47 | 48 | VL_EXPORT vl_size vl_fisher_encode 49 | (void * enc, vl_type dataType, 50 | void const * means, vl_size dimension, vl_size numClusters, 51 | void const * covariances, 52 | void const * priors, 53 | void const * data, vl_size numData, 54 | int flags) ; 55 | 56 | /* VL_FISHER_H */ 57 | #endif 58 | -------------------------------------------------------------------------------- /libraries/vlfeat/vl/imopv_sse2.h: -------------------------------------------------------------------------------- 1 | /** @file imopv_sse2.h 2 | ** @brief Vectorized image operations - SSE2 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #ifndef VL_IMOPV_SSE2_H 15 | #define VL_IMOPV_SSE2_H 16 | 17 | #include "generic.h" 18 | 19 | #ifndef VL_DISABLE_SSE2 20 | 21 | VL_EXPORT 22 | void _vl_imconvcol_vf_sse2 (float* dst, vl_size dst_stride, 23 | float const* src, 24 | vl_size src_width, vl_size src_height, vl_size src_stride, 25 | float const* filt, vl_index filt_begin, vl_index filt_end, 26 | int step, unsigned int flags) ; 27 | 28 | VL_EXPORT 29 | void _vl_imconvcol_vd_sse2 (double* dst, vl_size dst_stride, 30 | double const* src, 31 | vl_size src_width, vl_size src_height, vl_size src_stride, 32 | double const* filt, vl_index filt_begin, vl_index filt_end, 33 | int step, unsigned int flags) ; 34 | 35 | /* 36 | VL_EXPORT 37 | void _vl_imconvcoltri_vf_sse2 (float* dst, int dst_stride, 38 | float const* src, 39 | int src_width, int src_height, int src_stride, 40 | int filt_size, 41 | int step, unsigned int flags) ; 42 | 43 | VL_EXPORT 44 | void _vl_imconvcoltri_vd_sse2 (double* dst, int dst_stride, 45 | double const* src, 46 | int src_width, int src_height, int src_stride, 47 | int filt_size, 48 | int step, unsigned int flags) ; 49 | */ 50 | 51 | #endif 52 | 53 | /* VL_IMOPV_SSE2_H */ 54 | #endif 55 | -------------------------------------------------------------------------------- /libraries/vlfeat/vl/mathop_avx.h: -------------------------------------------------------------------------------- 1 | /** @file mathop_avx.h 2 | ** @brief mathop for avx 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | /* ---------------------------------------------------------------- */ 15 | #ifndef VL_MATHOP_AVX_H_INSTANTIATING 16 | 17 | #ifndef VL_MATHOP_AVX_H 18 | #define VL_MATHOP_AVX_H 19 | 20 | #undef FLT 21 | #define FLT VL_TYPE_DOUBLE 22 | #define VL_MATHOP_AVX_H_INSTANTIATING 23 | #include "mathop_avx.h" 24 | 25 | #undef FLT 26 | #define FLT VL_TYPE_FLOAT 27 | #define VL_MATHOP_AVX_H_INSTANTIATING 28 | #include "mathop_avx.h" 29 | 30 | /* VL_MATHOP_AVX_H */ 31 | #endif 32 | 33 | /* ---------------------------------------------------------------- */ 34 | /* VL_MATHOP_AVX_H_INSTANTIATING */ 35 | #else 36 | 37 | #ifndef VL_DISABLE_AVX 38 | #include "generic.h" 39 | #include "float.th" 40 | 41 | VL_EXPORT T 42 | VL_XCAT(_vl_distance_mahalanobis_sq_avx_, SFX) 43 | (vl_size dimension, T const * X, T const * MU, T const * S); 44 | 45 | VL_EXPORT T 46 | VL_XCAT(_vl_distance_l2_avx_, SFX) 47 | (vl_size dimension, T const * X, T const * Y); 48 | 49 | VL_EXPORT void 50 | VL_XCAT(_vl_weighted_sigma_avx_, SFX) 51 | (vl_size dimension, T * S, T const * X, T const * Y, T const W); 52 | 53 | VL_EXPORT void 54 | VL_XCAT(_vl_weighted_mean_avx_, SFX) 55 | (vl_size dimension, T * MU, T const * X, T const W); 56 | 57 | /* ! VL_DISABLE_AVX */ 58 | #endif 59 | 60 | #undef VL_MATHOP_AVX_H_INSTANTIATING 61 | #endif 62 | -------------------------------------------------------------------------------- /libraries/vlfeat/vl/vlad.h: -------------------------------------------------------------------------------- 1 | /** @file vlad.h 2 | ** @brief VLAD encoding (@ref vlad) 3 | ** @author David Novotny 4 | ** @author Andrea Vedaldi 5 | ** @see @ref vlad 6 | **/ 7 | 8 | /* 9 | Copyright (C) 2013 David Novotny and Andera Vedaldi. 10 | All rights reserved. 11 | 12 | This file is part of the VLFeat library and is made available under 13 | the terms of the BSD license (see the COPYING file). 14 | */ 15 | 16 | #ifndef VL_VLAD_H 17 | #define VL_VLAD_H 18 | 19 | #include "generic.h" 20 | 21 | /** @name VLAD options 22 | ** @{ */ 23 | #define VL_VLAD_FLAG_NORMALIZE_COMPONENTS (0x1 << 0) 24 | #define VL_VLAD_FLAG_SQUARE_ROOT (0x1 << 1) 25 | #define VL_VLAD_FLAG_UNNORMALIZED (0x1 << 2) 26 | #define VL_VLAD_FLAG_NORMALIZE_MASS (0x1 << 3) 27 | 28 | /** @def VL_VLAD_FLAG_NORMALIZE_COMPONENTS 29 | ** @brief Normalize each VLAD component individually. 30 | **/ 31 | 32 | /** @def VL_VLAD_FLAG_SQUARE_ROOT 33 | ** @brief Use signed squared-root. 34 | **/ 35 | 36 | /** @def VL_VLAD_FLAG_UNNORMALIZED 37 | ** @brief Do not globally normalize the VLAD descriptor. 38 | **/ 39 | 40 | /** @def VL_VLAD_FLAG_NORMALIZE_MASS 41 | ** @brief Normalize each component by the number of features assigned to it. 42 | **/ 43 | /** @} */ 44 | 45 | VL_EXPORT void vl_vlad_encode 46 | (void * enc, vl_type dataType, 47 | void const * means, vl_size dimension, vl_size numClusters, 48 | void const * data, vl_size numData, 49 | void const * assignments, 50 | int flags) ; 51 | 52 | /* VL_VLAD_H */ 53 | #endif 54 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2013 The Regents of the University of California (Regents). 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // 11 | // * 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 provided 14 | // with the distribution. 15 | // 16 | // * Neither the name of The Regents or University of California nor the 17 | // names of its contributors may be used to endorse or promote products 18 | // derived from this software without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 | // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 | // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 | // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 | // POSSIBILITY OF SUCH DAMAGE. 31 | // 32 | // Please contact the author of this library if you have any questions. 33 | // Author: Chris Sweeney (cmsweeney@cs.ucsb.edu) 34 | 35 | --------------------------------------------------------------------------------