├── sdsl ├── VERSION ├── test │ ├── test_cases │ │ ├── crafted │ │ │ ├── empty.txt │ │ │ ├── example01.txt │ │ │ ├── abc_abc_abc.txt │ │ │ ├── abc_abc_abc2.txt │ │ │ ├── 100a.txt │ │ │ └── README │ │ └── small │ │ │ ├── .gitignore │ │ │ ├── README │ │ │ └── get_corpus.sh │ ├── tmp │ │ └── .gitignore │ ├── CMakeLists.txt │ ├── .gitignore │ ├── Makefile │ ├── Makefile.cmake │ ├── README │ ├── CstHelper.hpp │ └── BitMagicTest.cpp ├── libdivsufsort-2.0.1 │ ├── VERSION │ ├── build │ │ └── .gitignore │ ├── AUTHORS │ ├── lib │ │ ├── libdivsufsort.sym │ │ ├── libdivsufsort64.sym │ │ ├── Makefile.am │ │ └── CMakeLists.txt │ ├── examples │ │ ├── Makefile.am │ │ └── CMakeLists.txt │ ├── Makefile.am │ ├── include │ │ ├── Makefile.am │ │ └── lfs.h.cmake │ ├── pkgconfig │ │ ├── libdivsufsort.pc.cmake │ │ └── CMakeLists.txt │ ├── CMakeModules │ │ ├── CheckFunctionKeywords.cmake │ │ ├── cmake_uninstall.cmake.in │ │ ├── AppendCompilerFlags.cmake │ │ └── ProjectCPack.cmake │ ├── INSTALL │ ├── m4 │ │ └── ltversion.m4 │ ├── COPYING │ ├── NEWS │ └── ChangeLog.old ├── gtest-1.6.0 │ ├── build │ │ └── .gitignore │ ├── xcode │ │ ├── Config │ │ │ ├── TestTarget.xcconfig │ │ │ ├── FrameworkTarget.xcconfig │ │ │ ├── StaticLibraryTarget.xcconfig │ │ │ ├── DebugProject.xcconfig │ │ │ ├── ReleaseProject.xcconfig │ │ │ └── General.xcconfig │ │ ├── Samples │ │ │ └── FrameworkSample │ │ │ │ ├── Info.plist │ │ │ │ └── widget.h │ │ └── Resources │ │ │ └── Info.plist │ ├── m4 │ │ └── ltversion.m4 │ ├── CONTRIBUTORS │ ├── COPYING │ ├── test │ │ ├── production.cc │ │ ├── gtest_main_unittest.cc │ │ ├── gtest_uninitialized_test_.cc │ │ ├── gtest_xml_outfile1_test_.cc │ │ ├── gtest_xml_outfile2_test_.cc │ │ ├── gtest-typed-test2_test.cc │ │ ├── gtest_help_test_.cc │ │ ├── production.h │ │ ├── gtest_all_test.cc │ │ ├── gtest_prod_test.cc │ │ └── gtest_sole_header_test.cc │ ├── src │ │ ├── gtest_main.cc │ │ └── gtest-all.cc │ ├── fused-src │ │ └── gtest │ │ │ └── gtest_main.cc │ ├── codegear │ │ ├── gtest_all.cc │ │ ├── gtest_link.cc │ │ └── gtest.groupproj │ ├── scripts │ │ └── test │ │ │ └── Makefile │ ├── samples │ │ ├── sample4_unittest.cc │ │ ├── sample1.h │ │ ├── sample4.cc │ │ ├── sample4.h │ │ └── sample2.cc │ ├── build-aux │ │ └── config.h.in │ └── include │ │ └── gtest │ │ └── gtest_prod.h ├── include │ ├── CMakeLists.txt │ └── sdsl │ │ ├── .gitignore │ │ ├── TODO.txt │ │ ├── vectors.hpp │ │ ├── uintx_t.hpp.cmake │ │ ├── compatibility.hpp │ │ ├── typedefs.hpp │ │ ├── bit_vectors.hpp │ │ ├── wt_helper.hpp │ │ ├── fast_cache.hpp │ │ ├── suffixarrays.hpp │ │ ├── uint128_t.hpp │ │ ├── CMakeLists.txt │ │ ├── isa_construct.hpp │ │ ├── wavelet_trees.hpp │ │ ├── sdsl_concepts.hpp │ │ ├── bp_support.hpp │ │ ├── config.hpp.cmake │ │ ├── bwt_construct.hpp │ │ ├── tikz.hpp │ │ ├── rmq_support.hpp │ │ ├── wt_coding_strategy.hpp │ │ └── select_support_dummy.hpp ├── build │ ├── .gitignore │ ├── clean.sh │ └── build.sh ├── lib │ ├── construct.cpp │ ├── wt_coding_strategy.cpp │ ├── louds_tree.cpp │ ├── rrr_vector_15.cpp │ ├── nn_dict_dynamic.cpp │ ├── config.cpp │ ├── test_index_performance.cpp │ ├── uint128_t.cpp │ ├── uint256_t.cpp │ ├── CMakeLists.txt │ ├── wt_helper.cpp │ ├── int_vector.cpp │ ├── tikz.cpp │ ├── isa_construct.cpp │ ├── select_support_dummy.cpp │ ├── algorithms_for_suffix_array_construction.cpp │ └── algorithms.cpp ├── examples │ ├── .gitignore │ ├── CMakeLists.txt │ ├── hugepage_rrr.cpp │ ├── Makefile.cmake │ ├── hugepage_int_vector.cpp │ ├── wt_huff_from_text.cpp │ ├── import_non_sdsl_data.cpp │ ├── import_non_sdsl_data2.cpp │ ├── cst_bfs_iterator.cpp │ ├── text_statistics.cpp │ ├── hugepages.cpp │ ├── int_vector_file_buffer.cpp │ ├── range_minimum_queries.cpp │ ├── csa_alphabet_strategy.cpp │ ├── import_non_sdsl_data_gen_tests.cpp │ └── louds_tree.cpp ├── sandbox │ ├── Makefile │ └── wavelet_trees.cpp ├── scripts │ └── download.sh ├── CMakeModules │ ├── Finddivsufsort64.cmake │ ├── Finddivsufsort.cmake │ ├── CheckSSE4_2.cmake │ └── AppendCompilerFlags.cmake ├── COPYING ├── INSTALL └── CHANGES ├── SPIRE2013 ├── aaaaaaaaaa.txt ├── miss_mississippi.txt ├── tmp │ └── .gitignore ├── example1.txt ├── barbarabar.txt ├── template │ └── x.tex └── generate_figure.sh ├── bin └── .gitignore ├── tmp └── .gitignore ├── data └── output │ ├── indexes │ └── .gitignore │ └── mem_size │ └── .gitignore ├── query_performance ├── query_performance_loc_web-64GB.txt ├── result.tex ├── mac_teardown.sh ├── mac_setup.sh ├── fm_index_cnt.txt ├── query_web-4GB.sh ├── query_web-64GB.sh ├── query_loc_web-64GB.sh ├── query_loc_web-4GB.sh ├── query_details_web-64GB.sh ├── query_details_web-4GB.sh ├── query_usb_web-4GB.sh ├── query_web-256MB.sh └── usb.tex ├── pattern ├── web-4GB.10.1000.0.1.1.pattern ├── web-4GB.20.1000.0.1.1.pattern ├── web-4GB.4.1000.0.1.1.pattern ├── web-4GB.4.1000.0.8.12.pattern ├── web-4GB.40.1000.0.1.1.pattern ├── web-64GB.4.1000.0.1.1.pattern ├── web-256MB.10.1000.0.1.1.pattern ├── web-256MB.20.1000.0.1.1.pattern ├── web-256MB.4.1000.0.1.1.pattern ├── web-256MB.4.1000.0.8.12.pattern ├── web-256MB.40.1000.0.1.1.pattern ├── web-4GB.10.1000.0.8.12.pattern ├── web-4GB.100.1000.0.1.1.pattern ├── web-4GB.100.1000.0.8.12.pattern ├── web-4GB.20.1000.0.8.12.pattern ├── web-4GB.4.1000.0.75.125.pattern ├── web-4GB.40.1000.0.8.12.pattern ├── web-64GB.10.1000.0.1.1.pattern ├── web-64GB.10.1000.0.8.12.pattern ├── web-64GB.100.1000.0.1.1.pattern ├── web-64GB.20.1000.0.1.1.pattern ├── web-64GB.20.1000.0.8.12.pattern ├── web-64GB.4.1000.0.8.12.pattern ├── web-64GB.40.1000.0.1.1.pattern ├── web-64GB.40.1000.0.8.12.pattern ├── web-256MB.10.1000.0.75.125.pattern ├── web-256MB.10.1000.0.8.12.pattern ├── web-256MB.100.1000.0.1.1.pattern ├── web-256MB.100.1000.0.8.12.pattern ├── web-256MB.20.1000.0.75.125.pattern ├── web-256MB.20.1000.0.8.12.pattern ├── web-256MB.4.1000.0.75.125.pattern ├── web-256MB.40.1000.0.75.125.pattern ├── web-256MB.40.1000.0.8.12.pattern ├── web-4GB.10.1000.0.75.125.pattern ├── web-4GB.10.1000.0.750.1250.pattern ├── web-4GB.100.1000.0.75.125.pattern ├── web-4GB.100.10000.0.8.12.pattern ├── web-4GB.20.1000.0.75.125.pattern ├── web-4GB.20.1000.0.750.1250.pattern ├── web-4GB.4.1000.0.750.1250.pattern ├── web-4GB.40.1000.0.75.125.pattern ├── web-4GB.40.1000.0.750.1250.pattern ├── web-64GB.10.1000.0.75.125.pattern ├── web-64GB.100.1000.0.75.125.pattern ├── web-64GB.100.1000.0.8.12.pattern ├── web-64GB.20.1000.0.75.125.pattern ├── web-64GB.4.1000.0.75.125.pattern ├── web-64GB.4.1000.0.750.1250.pattern ├── web-64GB.40.1000.0.75.125.pattern ├── web-256MB.10.1000.0.750.1250.pattern ├── web-256MB.100.1000.0.75.125.pattern ├── web-256MB.20.1000.0.750.1250.pattern ├── web-256MB.4.1000.0.750.1250.pattern ├── web-256MB.40.1000.0.750.1250.pattern ├── web-4GB.10.1000.0.7500.12500.pattern ├── web-4GB.100.1000.0.750.1250.pattern ├── web-4GB.20.1000.0.7500.12500.pattern ├── web-4GB.4.1000.0.7500.12500.pattern ├── web-4GB.40.1000.0.7500.12500.pattern ├── web-64GB.10.1000.0.750.1250.pattern ├── web-64GB.100.1000.0.750.1250.pattern ├── web-64GB.20.1000.0.750.1250.pattern ├── web-64GB.4.1000.0.7500.12500.pattern ├── web-64GB.40.1000.0.750.1250.pattern ├── web-256MB.10.1000.0.7500.12500.pattern ├── web-256MB.100.1000.0.750.1250.pattern ├── web-256MB.100.1000.0.7500.12500.pattern ├── web-256MB.20.1000.0.7500.12500.pattern ├── web-256MB.4.1000.0.7500.12500.pattern ├── web-256MB.40.1000.0.7500.12500.pattern ├── web-4GB.100.1000.0.7500.12500.pattern ├── web-64GB.10.1000.0.7500.12500.pattern ├── web-64GB.100.1000.0.7500.12500.pattern ├── web-64GB.20.1000.0.7500.12500.pattern └── web-64GB.40.1000.0.7500.12500.pattern ├── INSTALL ├── src ├── replace_0_byte_by_255_byte.sh ├── bu_interval.cpp ├── bu_interval.hpp ├── basic_functions.R └── rosa_helping_structures.cpp └── README.md /sdsl/VERSION: -------------------------------------------------------------------------------- 1 | 0.9.10 2 | -------------------------------------------------------------------------------- /SPIRE2013/aaaaaaaaaa.txt: -------------------------------------------------------------------------------- 1 | aaaaaaaaaa -------------------------------------------------------------------------------- /bin/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /sdsl/test/test_cases/crafted/empty.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/VERSION: -------------------------------------------------------------------------------- 1 | 2.0.1 2 | -------------------------------------------------------------------------------- /SPIRE2013/miss_mississippi.txt: -------------------------------------------------------------------------------- 1 | miss_mississippi -------------------------------------------------------------------------------- /SPIRE2013/tmp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /sdsl/test/tmp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /data/output/indexes/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /query_performance/query_performance_loc_web-64GB.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /sdsl/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(sdsl) 2 | -------------------------------------------------------------------------------- /sdsl/test/test_cases/crafted/example01.txt: -------------------------------------------------------------------------------- 1 | mississippi 2 | -------------------------------------------------------------------------------- /SPIRE2013/example1.txt: -------------------------------------------------------------------------------- 1 | el_anele_lepanelen_el_aneel_lepanllelen -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /sdsl/test/test_cases/crafted/abc_abc_abc.txt: -------------------------------------------------------------------------------- 1 | abcabcabc 2 | -------------------------------------------------------------------------------- /sdsl/test/test_cases/crafted/abc_abc_abc2.txt: -------------------------------------------------------------------------------- 1 | abcabcabc 2 | -------------------------------------------------------------------------------- /data/output/mem_size/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !*.html 4 | -------------------------------------------------------------------------------- /SPIRE2013/barbarabar.txt: -------------------------------------------------------------------------------- 1 | barbarabar_barbarbier_rabarbar_barbar_bierbar -------------------------------------------------------------------------------- /sdsl/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | !build.sh 4 | !clean.sh 5 | -------------------------------------------------------------------------------- /sdsl/test/test_cases/small/.gitignore: -------------------------------------------------------------------------------- 1 | *.txt 2 | *.int 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /sdsl/lib/construct.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/construct.hpp" 2 | 3 | namespace sdsl{ 4 | 5 | } 6 | -------------------------------------------------------------------------------- /sdsl/examples/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !*.cpp 3 | !Makefile.cmake 4 | !CMakeLists.txt 5 | !.gitignore 6 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/.gitignore: -------------------------------------------------------------------------------- 1 | rrr_vector2.hpp 2 | rrr_vector3.hpp 3 | rrr_vector4.hpp 4 | wt_rlg4.hpp 5 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/AUTHORS: -------------------------------------------------------------------------------- 1 | -- AUTHORS for libdivsufsort 2 | 3 | Yuta Mori 4 | -------------------------------------------------------------------------------- /pattern/web-4GB.10.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.10.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.20.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.20.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.4.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.4.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.4.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.4.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.40.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.40.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.4.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.4.1000.0.1.1.pattern -------------------------------------------------------------------------------- /sdsl/lib/wt_coding_strategy.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/wt_coding_strategy.hpp" 2 | 3 | namespace sdsl{ 4 | 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /pattern/web-256MB.10.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.10.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.20.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.20.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.4.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.4.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.4.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.4.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.40.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.40.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.10.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.10.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.100.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.100.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.100.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.100.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.20.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.20.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.4.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.4.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.40.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.40.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.10.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.10.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.10.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.10.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.100.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.100.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.20.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.20.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.20.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.20.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.4.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.4.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.40.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.40.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.40.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.40.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.10.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.10.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.10.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.10.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.100.1000.0.1.1.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.100.1000.0.1.1.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.100.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.100.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.20.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.20.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.20.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.20.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.4.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.4.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.40.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.40.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.40.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.40.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.10.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.10.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.10.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.10.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.100.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.100.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.100.10000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.100.10000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.20.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.20.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.20.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.20.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.4.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.4.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.40.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.40.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.40.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.40.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.10.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.10.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.100.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.100.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.100.1000.0.8.12.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.100.1000.0.8.12.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.20.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.20.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.4.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.4.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.4.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.4.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.40.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.40.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.10.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.10.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.100.1000.0.75.125.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.100.1000.0.75.125.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.20.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.20.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.4.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.4.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.40.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.40.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.10.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.10.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.100.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.100.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.20.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.20.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.4.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.4.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.40.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.40.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.10.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.10.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.100.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.100.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.20.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.20.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.4.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.4.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.40.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.40.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /sdsl/test/test_cases/crafted/100a.txt: -------------------------------------------------------------------------------- 1 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -------------------------------------------------------------------------------- /pattern/web-256MB.10.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.10.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.100.1000.0.750.1250.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.100.1000.0.750.1250.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.100.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.100.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.20.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.20.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.4.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.4.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-256MB.40.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-256MB.40.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-4GB.100.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-4GB.100.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.10.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.10.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.100.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.100.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.20.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.20.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /pattern/web-64GB.40.1000.0.7500.12500.pattern: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simongog/RoSA/HEAD/pattern/web-64GB.40.1000.0.7500.12500.pattern -------------------------------------------------------------------------------- /sdsl/include/sdsl/TODO.txt: -------------------------------------------------------------------------------- 1 | wt_rlgX: do a generalize version of the implementations so that 2 | the X is a template parameter of wt_rlg 3 | -------------------------------------------------------------------------------- /query_performance/result.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \begin{document} 4 | 5 | \newcommand{\D}[0]{\hphantom{0}} 6 | 7 | 8 | \end{document} 9 | -------------------------------------------------------------------------------- /sdsl/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Makefile.cmake" 2 | "${CMAKE_CURRENT_SOURCE_DIR}/Makefile" @ONLY) 3 | -------------------------------------------------------------------------------- /query_performance/mac_teardown.sh: -------------------------------------------------------------------------------- 1 | sudo mdutil -a -i on # restart spotlight indexing 2 | sudo tmutil enablelocal # restart local Time Machine backup 3 | -------------------------------------------------------------------------------- /query_performance/mac_setup.sh: -------------------------------------------------------------------------------- 1 | sudo mdutil -a -i off # quit spotlight indexing 2 | sudo tmutil disablelocal # quit local Time Machine backup storage 3 | 4 | 5 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Let RoSA_ROOT be the project's root directory / 2 | 3 | (1) cd into RoSA_ROOT/sdsl directory 4 | (2) call ./install.sh RoSA_ROOT 5 | (3) cd .. 6 | (4) make 7 | 8 | 9 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/lib/libdivsufsort.sym: -------------------------------------------------------------------------------- 1 | divsufsort 2 | divbwt 3 | divsufsort_version 4 | bw_transform 5 | inverse_bw_transform 6 | sufcheck 7 | sa_search 8 | sa_simplesearch 9 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/lib/libdivsufsort64.sym: -------------------------------------------------------------------------------- 1 | divsufsort64 2 | divbwt64 3 | divsufsort64_version 4 | bw_transform64 5 | inverse_bw_transform64 6 | sufcheck64 7 | sa_search64 8 | sa_simplesearch64 9 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/vectors.hpp: -------------------------------------------------------------------------------- 1 | /** \defgroup int_vector int_vector */ 2 | 3 | #include "int_vector.hpp" 4 | #include "enc_vector.hpp" 5 | #include "enc_vector_theo.hpp" 6 | #include "enc_vector_dna.hpp" 7 | -------------------------------------------------------------------------------- /sdsl/build/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # activate globbing 3 | shopt -s extglob 4 | # removes all but the listed files in the directory 5 | # and subdirectories 6 | rm -rf !(build.sh|clean.sh|.gitignore) 7 | 8 | -------------------------------------------------------------------------------- /sdsl/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) 2 | 3 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Makefile.cmake" 4 | "${CMAKE_CURRENT_SOURCE_DIR}/Makefile" @ONLY) 5 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/examples/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am for libdivsufsort 2 | 3 | noinst_PROGRAMS = suftest mksary sasearch bwt unbwt 4 | LDADD = $(top_builddir)/lib/libdivsufsort.la 5 | 6 | EXTRA_DIST = CMakeLists.txt 7 | -------------------------------------------------------------------------------- /sdsl/lib/louds_tree.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/louds_tree.hpp" 2 | 3 | namespace sdsl 4 | { 5 | std::ostream& operator<<(std::ostream& os, const louds_node& v) 6 | { 7 | os<<"("< // this enables the use of logical operators ,,and'', ,,or'', ,,not'' 7 | -------------------------------------------------------------------------------- /sdsl/lib/nn_dict_dynamic.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/nn_dict_dynamic.hpp" 2 | #include "sdsl/util.hpp" 3 | 4 | namespace sdsl 5 | { 6 | namespace util 7 | { 8 | void set_zero_bits(nn_dict_dynamic& nn) 9 | { 10 | util::set_zero_bits(nn.m_tree); 11 | } 12 | } // end util 13 | } // end sdsl 14 | -------------------------------------------------------------------------------- /sdsl/test/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | ./* # ignore every file in the current directory 3 | !*/ # don't ignore subdirectories 4 | !*.cpp # don't ignore .cpp-files 5 | !.gitignore # don't ignore the .gitignore file 6 | !README # don't ignore the README file 7 | -------------------------------------------------------------------------------- /sdsl/examples/hugepage_rrr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace sdsl; 5 | using namespace std; 6 | 7 | int main(){ 8 | bit_vector b(100,0); 9 | b[5]=1; 10 | rrr_vector<15> v(b); 11 | cout << v[0] << endl; 12 | cout << v[5] << endl; 13 | } 14 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am for libdivsufsort 2 | 3 | SUBDIRS = include lib examples 4 | 5 | EXTRA_DIST = ChangeLog.old CMakeLists.txt VERSION CMakeModules pkgconfig 6 | 7 | ACLOCAL_AMFLAGS = -I m4 8 | 9 | libtool: $(LIBTOOL_DEPS) 10 | $(SHELL) ./config.status --recheck 11 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/include/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am for libdivsufsort 2 | 3 | nodist_include_HEADERS = divsufsort.h 4 | if DIVSUFSORT64 5 | nodist_include_HEADERS += divsufsort64.h 6 | endif 7 | EXTRA_DIST = divsufsort_private.h divsufsort.h.cmake divsufsort64.h.in config.h.cmake CMakeLists.txt lfs.h.cmake 8 | -------------------------------------------------------------------------------- /sdsl/test/test_cases/crafted/README: -------------------------------------------------------------------------------- 1 | This directory contains crafted inputs. Here are details about the inputs: 2 | 3 | 100a.txt Consists of exactly 100 a-characters. 4 | abc_abc_abc.txt Contains 3 0-bytes: At position 3 6 and 9. 5 | abc_abc_abc2.txt Contains 3 255-bytes: At position 3 6 and 9. 6 | -------------------------------------------------------------------------------- /src/replace_0_byte_by_255_byte.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Author: Simon Gog (simon.gog@unimelb.edu.au) 3 | 4 | if [ $# -le 1 ]; 5 | then 6 | echo "usage: $0 original_file destination_file" 7 | echo " Replaces all 0-bytes in original_file by 255-bytes " 8 | echo " and writes the result into destination_file" 9 | else 10 | tr '\000' '\377' < $1 > $2 11 | fi 12 | 13 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/pkgconfig/libdivsufsort.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: @PROJECT_NAME@@W64BIT@ 7 | Description: @PROJECT_DESCRIPTION@ 8 | Version: @PROJECT_VERSION_FULL@ 9 | URL: @PROJECT_URL@ 10 | Libs: -L${libdir} -ldivsufsort@W64BIT@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /sdsl/sandbox/Makefile: -------------------------------------------------------------------------------- 1 | CC=g++ 2 | CC_FLAGS=-Wall -g -O3 -I/Users/simon.gog/include -L/Users/simon.gog/lib -DNDEBUG -funroll-loops -msse4.2 -pg 3 | CCLIB=-lsdsl -ldivsufsort -ldivsufsort64 4 | SOURCES=$(wildcard *.cpp) 5 | EXECS=$(SOURCES:.cpp=) 6 | 7 | all: $(EXECS) 8 | 9 | %:%.cpp 10 | $(CC) $(CC_FLAGS) -o $@ $< $(CCLIB) 11 | 12 | clean: 13 | rm -f $(EXECS) 14 | rm -rf *.dSYM 15 | 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This software is the implementation of the papers 2 | 3 | Simon Gog, Alistair Moffat, J Shane Culpepper, Andrew Turpin, Anthony Wirth 4 | Large-Scale Pattern Search Using Reduced-Space On-Disk Suffix Arrays 5 | Accepted for publication at TKDE. 6 | 7 | Simon Gog and Alistair Moffat. Adding Compression and Blended Search to a Compact Two-Level Suffix Array 8 | Proceedings of SPIRE 2013. 9 | 10 | -------------------------------------------------------------------------------- /sdsl/examples/Makefile.cmake: -------------------------------------------------------------------------------- 1 | CC=g++ 2 | CC_FLAGS=-Wall -g -O3 -I@CMAKE_INSTALL_PREFIX@/include -L@CMAKE_INSTALL_PREFIX@/lib -DNDEBUG -funroll-loops -msse4.2 3 | CCLIB=-lsdsl -ldivsufsort -ldivsufsort64 4 | SOURCES=$(wildcard *.cpp) 5 | EXECS=$(SOURCES:.cpp=) 6 | 7 | all: $(EXECS) 8 | 9 | %:%.cpp 10 | $(CC) $(CC_FLAGS) -o $@ $< $(CCLIB) 11 | 12 | clean: 13 | rm -f $(EXECS) 14 | rm -rf *.dSYM 15 | 16 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/typedefs.hpp: -------------------------------------------------------------------------------- 1 | /*! This files includes typedef of stl data types 2 | * \file typedefs.hpp contains typedefs for some data structures composed of stl data types 3 | */ 4 | #ifndef INCLUDED_SDSL_TYPEDEFS 5 | #define INCLUDED_SDSL_TYPEDEFS 6 | 7 | #include 8 | #include 9 | 10 | namespace sdsl 11 | { 12 | 13 | typedef std::vector tVS; 14 | 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /sdsl/lib/config.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/config.hpp" 2 | #include "sdsl/util.hpp" 3 | 4 | namespace sdsl{ 5 | cache_config::cache_config(bool f_delete_files, std::string f_dir, std::string f_id, tMSS f_file_map) : delete_files(f_delete_files), dir(f_dir), id(f_id), file_map(f_file_map) { 6 | if ( "" == id ){ 7 | id = util::to_string(util::get_pid())+"_"+util::to_string(util::get_id()); 8 | } 9 | } 10 | }// end namespace sdsl 11 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/bit_vectors.hpp: -------------------------------------------------------------------------------- 1 | /*! \file bit_vectors.hpp 2 | \brief bit_vectors.hpp contains classes for uncompressed and compressed bit vector representations. 3 | \author Simon Gog 4 | */ 5 | #ifndef INCLUDED_SDSL_BITVECTORS 6 | #define INCLUDED_SDSL_BITVECTORS 7 | 8 | #include "int_vector.hpp" 9 | #include "bit_vector_interleaved.hpp" 10 | #include "rrr_vector.hpp" 11 | #include "sd_vector.hpp" 12 | #include "gap_vector.hpp" 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /sdsl/lib/test_index_performance.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/test_index_performance.hpp" 2 | 3 | namespace sdsl 4 | { 5 | 6 | int_vector<64> get_rnd_positions(uint8_t log_s, uint64_t& mask, uint64_t mod, uint64_t seed) 7 | { 8 | mask = (1< rands(1<0) { 12 | util::all_elements_mod(rands, mod); 13 | } 14 | return rands; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /sdsl/sandbox/wavelet_trees.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace sdsl; 5 | using namespace std; 6 | 7 | int main(int argc, char* argv[]){ 8 | // wt_int<> wt; 9 | // wt<> wt; 10 | // wt_rlmn<> wt; 11 | // wt_rlg<> wt; 12 | // wt_rlg8<> wt; 13 | wt_huff<> wt; 14 | construct(wt, argv[1], 1); 15 | for (wt_int<>::size_type i=0; i> 64), (uint64_t)x}; 10 | for (int j=0; j < 2; ++j) { 11 | for (int i=0; i < 16; ++i) { 12 | os << std::hex << ((X[j]>>60)&0xFULL); 13 | X[j] <<= 4; 14 | } 15 | } 16 | return os; 17 | } 18 | 19 | } // end namespace 20 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## Add definitions ## 2 | add_definitions(-D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64) 3 | 4 | ## Targets ## 5 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include" 6 | "${CMAKE_CURRENT_BINARY_DIR}/../include") 7 | link_directories("${CMAKE_CURRENT_BINARY_DIR}/../lib") 8 | foreach(src suftest mksary sasearch bwt unbwt) 9 | add_executable(${src} ${src}.c) 10 | target_link_libraries(${src} divsufsort) 11 | endforeach(src) 12 | -------------------------------------------------------------------------------- /sdsl/lib/uint256_t.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/uint256_t.hpp" 2 | 3 | //! Namespace for the succinct data structure library 4 | namespace sdsl 5 | { 6 | std::ostream& operator<<(std::ostream& os, const uint256_t& x) 7 | { 8 | uint64_t X[4] = {(uint64_t)(x.m_high >> 64), (uint64_t)x.m_high, x.m_mid, x.m_lo}; 9 | for (int j=0; j < 4; ++j) { 10 | for (int i=0; i < 16; ++i) { 11 | os << std::hex << ((X[j]>>60)&0xFULL) << std::dec; 12 | X[j] <<= 4; 13 | } 14 | } 15 | return os; 16 | } 17 | } // end namespace 18 | -------------------------------------------------------------------------------- /sdsl/examples/hugepage_int_vector.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace sdsl; 6 | using namespace std; 7 | 8 | int main(){ 9 | { 10 | bit_vector v(1ULL<<30); 11 | bool mapped = mm::map_hp(); 12 | cout << v[0] << endl; 13 | if ( mapped ){ 14 | mm::unmap_hp(); 15 | } 16 | } 17 | { 18 | bit_vector_interleaved<> v(1ULL<<30); 19 | bool mapped = mm::map_hp(); 20 | cout << v[0] << endl; 21 | if ( mapped ){ 22 | mm::unmap_hp(); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/bu_interval.cpp: -------------------------------------------------------------------------------- 1 | #include "bu_interval.hpp" 2 | 3 | 4 | bu_interval::bu_interval(size_type _lb, size_type _rb, size_type _lcp) : lb(_lb), rb(_rb), lcp(_lcp){}; 5 | 6 | bu_interval::~bu_interval(){ delete_children(); } 7 | 8 | void bu_interval::delete_children(){ 9 | for (size_t i=0; ilcp<<"-["<lb<<","<rb<<"]"< 2 | #include 3 | 4 | using namespace sdsl; 5 | using namespace std; 6 | 7 | int main(int argc, char* argv[]) 8 | { 9 | if (argc < 2) { 10 | cout << "usage: "< file_buf; 13 | file_buf.load_from_plain(argv[1]); 14 | wt_huff<> wt(file_buf, file_buf.int_vector_size); 15 | 16 | for (size_t i=0; i 7 | #include 8 | 9 | // bottom up interval 10 | struct bu_interval{ 11 | typedef sdsl::int_vector<>::size_type size_type; 12 | size_type lcp, lb, rb; // lcp = depth of the interval, lb/rb = lef/right border of the interval 13 | std::vector children; 14 | bu_interval(size_type _lb, size_type _rb, size_type _lcp); 15 | ~bu_interval(); 16 | void delete_children(); 17 | size_type size()const; 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /sdsl/scripts/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Helper function to download files. It tries 4 | # to use either wget or curl. 5 | # Argument 1: URL of the download file 6 | function download_from_url { 7 | wget_path=`which wget` # returns an empty path if wget is not found 8 | if [[ -z ${wget_path} ]] ; then # if empty path => wget not found 9 | curl_path=`which curl` 10 | if [[ -z ${curl_path} ]] ; then 11 | echo "ERROR: Neither wget nor curl is installed. Can not download required files." 12 | else # curl found => download with curl 13 | curl -O $1 14 | fi 15 | else # wget found => download with wget 16 | wget $1 17 | fi 18 | } 19 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/pkgconfig/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## generate libdivsufsort.pc ## 2 | set(prefix "${CMAKE_INSTALL_PREFIX}") 3 | set(W64BIT "") 4 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libdivsufsort.pc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/libdivsufsort.pc" @ONLY) 5 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libdivsufsort.pc" DESTINATION lib/pkgconfig) 6 | if(BUILD_DIVSUFSORT64) 7 | set(W64BIT "64") 8 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libdivsufsort.pc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/libdivsufsort64.pc" @ONLY) 9 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libdivsufsort64.pc" DESTINATION lib/pkgconfig) 10 | endif(BUILD_DIVSUFSORT64) 11 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/CMakeModules/CheckFunctionKeywords.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCSourceCompiles) 2 | 3 | macro(check_function_keywords _wordlist) 4 | set(${_result} "") 5 | foreach(flag ${_wordlist}) 6 | string(REGEX REPLACE "[-+/ ()]" "_" flagname "${flag}") 7 | string(TOUPPER "${flagname}" flagname) 8 | set(have_flag "HAVE_${flagname}") 9 | check_c_source_compiles("${flag} void func(); void func() { } int main() { func(); return 0; }" ${have_flag}) 10 | if(${have_flag} AND NOT ${_result}) 11 | set(${_result} "${flag}") 12 | # break() 13 | endif(${have_flag} AND NOT ${_result}) 14 | endforeach(flag) 15 | endmacro(check_function_keywords) 16 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/CMakeModules/Finddivsufsort64.cmake: -------------------------------------------------------------------------------- 1 | # find the 64 bit version divsufsort64 2 | 3 | find_path(divsufsort64_INCLUDE_DIRS divsufsort64.h /usr/local/include ~/include "$ENV{divsufsort64_ROOT}") 4 | find_library(divsufsort64_LIBRARIES divsufsort64 /usr/local/lib ~/lib "$ENV{divsufsort64_ROOT}") 5 | 6 | set(divsufsort64_FOUND TRUE) 7 | 8 | if(NOT divsufsort64_INCLUDE_DIRS) 9 | set(divsufsort64_FOUND FALSE) 10 | endif(NOT divsufsort64_INCLUDE_DIRS) 11 | 12 | if(NOT divsufsort64_LIBRARIES) 13 | set(divsufsort64_FOUND FALSE) 14 | else() 15 | get_filename_component(divsufsort64_LIBRARY_DIRS ${divsufsort_LIBRARIES} PATH) 16 | message("FOUND divsufsort library in ${divsufsort64_LIBRARY_DIRS}") 17 | 18 | endif(NOT divsufsort64_LIBRARIES) 19 | -------------------------------------------------------------------------------- /sdsl/COPYING: -------------------------------------------------------------------------------- 1 | The sdsl copyright is as follows: 2 | 3 | Copyright (C) 2007-2012 Simon Gog All Right Reserved. 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see http://www.gnu.org/licenses/ . 17 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/INSTALL: -------------------------------------------------------------------------------- 1 | -- INSTALL for libdivsufsort 2 | 3 | 4 | Requirements: 5 | ============= 6 | 7 | * CMake version 2.4.2 or newer (http://www.cmake.org/) 8 | * An ANSI C compiler 9 | * GNU Make 10 | 11 | 12 | Compilation and Installation (with Unix Makefiles): 13 | =================================================== 14 | 15 | 1. Create a 'build' directory in the package source directory. 16 | 17 | $ cd libdivsufsort-?.?.? 18 | $ mkdir build 19 | $ cd build 20 | 21 | 2. Configure the package for your system. 22 | 23 | $ cmake -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX="/usr/local" .. 24 | 25 | 3. Compile the package. 26 | 27 | $ make 28 | 29 | 4. Install the library and header files. 30 | 31 | # make install 32 | -------------------------------------------------------------------------------- /sdsl/test/Makefile: -------------------------------------------------------------------------------- 1 | CC=g++ 2 | CC_FLAGS=-Wall -g -O3 -I/Users/sgog/RoSADev/include -L/Users/sgog/RoSADev/lib -DNDEBUG -funroll-loops 3 | CCLIB=-lsdsl -ldivsufsort -ldivsufsort64 -lgtest 4 | SOURCES=$(wildcard *Test.cpp) 5 | EXECS=$(SOURCES:.cpp=) 6 | EXEC_LIST=$(patsubst %,./%;,$(EXECS)) # list of executables 7 | EXEC_LIST_VAL=$(patsubst %,valgrind ./%;,$(EXECS)) # list of executables preceded by valgrind command 8 | 9 | all: $(EXECS) 10 | 11 | %:%.cpp 12 | $(CC) $(CC_FLAGS) -o $@ $< $(CCLIB) 13 | 14 | clean: 15 | rm -f $(EXECS) 16 | rm -rf *.dSYM 17 | 18 | # TODO special test case for BitMagicTestSSE 19 | 20 | test: 21 | ./test_cases/small/get_corpus.sh 22 | $(EXEC_LIST) 23 | 24 | 25 | vtest: 26 | ./test_cases/small/get_corpus.sh 27 | $(EXEC_LIST_VAL) 28 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | # Makefile.am for libdivsufsort 2 | 3 | lib_LTLIBRARIES = libdivsufsort.la 4 | libdivsufsort_la_SOURCES = divsufsort.c sssort.c trsort.c utils.c 5 | libdivsufsort_la_CPPFLAGS = -I$(top_srcdir)/include 6 | libdivsufsort_la_LDFLAGS = -version-info @LT_CURRENT@:@LT_REVISION@:@LT_AGE@ -export-symbols $(srcdir)/libdivsufsort.sym 7 | 8 | if DIVSUFSORT64 9 | lib_LTLIBRARIES += libdivsufsort64.la 10 | libdivsufsort64_la_SOURCES = divsufsort.c sssort.c trsort.c utils.c 11 | libdivsufsort64_la_CPPFLAGS = -I$(top_srcdir)/include -DBUILD_DIVSUFSORT64 12 | libdivsufsort64_la_LDFLAGS = -version-info @LT_CURRENT@:@LT_REVISION@:@LT_AGE@ -export-symbols $(srcdir)/libdivsufsort64.sym 13 | endif 14 | 15 | EXTRA_DIST = libdivsufsort.sym libdivsufsort64.sym CMakeLists.txt 16 | -------------------------------------------------------------------------------- /sdsl/lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(#"${CMAKE_CURRENT_SOURCE_DIR}/../include" 2 | "${CMAKE_CURRENT_BINARY_DIR}/../include" 3 | "${divsufsort_INCLUDE_DIRS}" 4 | "${divsufsort64_INCLUDE_DIRS}" 5 | ) 6 | 7 | 8 | file(GLOB libFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") # select all .cpp-files 9 | 10 | set( sdsl_SRCS ${libFiles} ) 11 | 12 | add_library( sdsl ${sdsl_SRCS} ) 13 | 14 | install(TARGETS sdsl 15 | RUNTIME DESTINATION bin 16 | LIBRARY DESTINATION lib 17 | ARCHIVE DESTINATION lib) 18 | 19 | set_target_properties(sdsl PROPERTIES 20 | VERSION "${LIBRARY_VERSION_FULL}" 21 | SOVERSION "${LIBRARY_VERSION_MAJOR}" 22 | # DEFINE_SYMBOL SDSL_BUILD_DLL 23 | # RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../examples" 24 | ) 25 | -------------------------------------------------------------------------------- /sdsl/test/Makefile.cmake: -------------------------------------------------------------------------------- 1 | CC=g++ 2 | CC_FLAGS=-Wall -g -O3 -I@CMAKE_INSTALL_PREFIX@/include -L@CMAKE_INSTALL_PREFIX@/lib -DNDEBUG -funroll-loops 3 | CCLIB=-lsdsl -ldivsufsort -ldivsufsort64 -lgtest 4 | SOURCES=$(wildcard *Test.cpp) 5 | EXECS=$(SOURCES:.cpp=) 6 | EXEC_LIST=$(patsubst %,./%;,$(EXECS)) # list of executables 7 | EXEC_LIST_VAL=$(patsubst %,valgrind ./%;,$(EXECS)) # list of executables preceded by valgrind command 8 | 9 | all: $(EXECS) 10 | 11 | %:%.cpp 12 | $(CC) $(CC_FLAGS) -o $@ $< $(CCLIB) 13 | 14 | clean: 15 | rm -f $(EXECS) 16 | rm -rf *.dSYM 17 | 18 | # TODO special test case for BitMagicTestSSE 19 | 20 | test: 21 | ./test_cases/small/get_corpus.sh 22 | $(EXEC_LIST) 23 | 24 | 25 | vtest: 26 | ./test_cases/small/get_corpus.sh 27 | $(EXEC_LIST_VAL) 28 | -------------------------------------------------------------------------------- /sdsl/lib/wt_helper.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/wt_helper.hpp" 2 | 3 | namespace sdsl{ 4 | 5 | void calculate_character_occurences(int_vector_file_buffer<8>& text, const int_vector_size_type size, int_vector_size_type* C) 6 | { 7 | text.reset(); 8 | if (text.int_vector_size < size) { 9 | throw std::logic_error("calculate_character_occurrences: stream size is smaller than size!"); 10 | return; 11 | } 12 | for (int_vector_size_type i=0, r_sum=0, r = text.load_next_block(); r_sum < size;) { 13 | if (r_sum + r > size) { // read not more than size chars in the next loop 14 | r = size-r_sum; 15 | } 16 | for (; i < r_sum+r; ++i) { 17 | ++C[text[i-r_sum]]; 18 | } 19 | r_sum += r; r = text.load_next_block(); 20 | } 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /sdsl/examples/import_non_sdsl_data.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace sdsl; 6 | using namespace std; 7 | 8 | int main(int argc, char* argv[]){ 9 | if ( argc < 2 ){ 10 | cout << "Usage: " << argv[0] << " text_file nr" << endl; 11 | cout << " Reads a text file and outputs the first nr symbols." << endl; 12 | return 1; 13 | } 14 | int_vector<8> text; 15 | 16 | util::load_vector_from_file(text, argv[1], 1); 17 | 18 | cout << "text.size() = " << text.size() << endl; 19 | cout << "text ="; 20 | size_t max_out = 10; 21 | if ( argc > 2 ){ 22 | max_out = atoll(argv[2]); 23 | } 24 | for (size_t i=0; i < max_out and i < text.size(); ++i) 25 | cout << " " << text[i]; 26 | if (text.size() > max_out) 27 | cout << "...."; 28 | cout << endl; 29 | } 30 | -------------------------------------------------------------------------------- /sdsl/CMakeModules/Finddivsufsort.cmake: -------------------------------------------------------------------------------- 1 | # find divsufsort library of Yuta Mori 2 | 3 | # search in /usr/local/include and ~/include for divsufsort includes 4 | find_path(divsufsort_INCLUDE_DIRS divsufsort.h /usr/local/include ~/include "$ENV{divsufsort_ROOT}") 5 | # search in /usr/local/lib and ~/lib for divsufsort library 6 | find_library(divsufsort_LIBRARIES divsufsort /usr/local/lib ~/lib "$ENV{divsufsort_ROOT}") 7 | 8 | set(divsufsort_FOUND TRUE) 9 | 10 | if(NOT divsufsort_INCLUDE_DIRS) 11 | set(divsufsort_FOUND FALSE) 12 | endif(NOT divsufsort_INCLUDE_DIRS) 13 | 14 | if(NOT divsufsort_LIBRARIES) 15 | set(divsufsort_FOUND FALSE) 16 | else() 17 | get_filename_component(divsufsort_LIBRARY_DIRS ${divsufsort_LIBRARIES} PATH) 18 | message("FOUND divsufsort library in ${divsufsort_LIBRARY_DIRS}") 19 | endif(NOT divsufsort_LIBRARIES) 20 | -------------------------------------------------------------------------------- /sdsl/examples/import_non_sdsl_data2.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace sdsl; 6 | using namespace std; 7 | 8 | int main(int argc, char* argv[]){ 9 | if ( argc < 2 ){ 10 | cout << "Usage: " << argv[0] << " int32_file nr" << endl; 11 | cout << " Reads a file containing 32-bit integers and outputs the first nr of them." << endl; 12 | return 1; 13 | } 14 | int_vector<> v; 15 | 16 | util::load_vector_from_file(v, argv[1], 4); 17 | 18 | cout << "v.size() = " << v.size() << endl; 19 | cout << "v.get_int_width() = " << (int)v.get_int_width() << endl; 20 | cout << "v ="; 21 | size_t max_out = 10; 22 | if ( argc > 2 ){ 23 | max_out = atoll(argv[2]); 24 | } 25 | for (size_t i=0; i < max_out and i < v.size(); ++i) 26 | cout << " " << v[i]; 27 | if (v.size() > max_out) 28 | cout << "...."; 29 | cout << endl; 30 | } 31 | -------------------------------------------------------------------------------- /sdsl/lib/int_vector.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/int_vector.hpp" 2 | 3 | namespace sdsl{ 4 | 5 | int_vector_size_type char_array_serialize_wrapper::serialize(std::ostream& out) const { 6 | size_type size = m_n*8; // number of bits 7 | size_type written_bytes = 0; 8 | written_bytes += _sdsl_serialize_size_and_int_width(out, 8, 8, size); 9 | const char* p = (const char*)m_cp; 10 | size_type idx = 0; 11 | while (idx+constants::SDSL_BLOCK_SIZE < m_n) { 12 | out.write(p, constants::SDSL_BLOCK_SIZE); 13 | written_bytes += constants::SDSL_BLOCK_SIZE; 14 | p += constants::SDSL_BLOCK_SIZE; 15 | idx += constants::SDSL_BLOCK_SIZE; 16 | } 17 | // now: m_n-idx <= SDSL_BLOCK_SIZE 18 | out.write(p , m_n-idx); 19 | written_bytes += m_n-idx; 20 | uint32_t r= (sizeof(uint64_t)-(m_n % sizeof(uint64_t))) % sizeof(uint64_t); 21 | out.write("\0\0\0\0\0\0\0\0", r); 22 | written_bytes += r; 23 | return written_bytes; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /sdsl/CMakeModules/CheckSSE4_2.cmake: -------------------------------------------------------------------------------- 1 | # Check if the CPU provides fast operations 2 | # for popcount, leftmost and rightmost bit 3 | 4 | set(BUILTIN_POPCNT 0) 5 | # Check if we are on a Linux system 6 | if(CMAKE_SYSTEM_NAME STREQUAL "Linux") 7 | # Use /proc/cpuinfo to get the information 8 | file(STRINGS "/proc/cpuinfo" _cpuinfo) 9 | if(_cpuinfo MATCHES "(sse4_2)|(sse4a)") 10 | set(BUILTIN_POPCNT 1) 11 | message("hey dude, builtin popcnt!") 12 | else() 13 | message("sorry dude, no builtin popcnt") 14 | endif() 15 | elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") 16 | # handle windows 17 | # get_filename_component(_vendor_id "[HKEY_LOCAL_MACHINE\\Hardware\\Description\\System\\CentralProcessor\\0;VendorIdentifier]" NAME CACHE) 18 | # get_filename_component(_cpu_id "[HKEY_LOCAL_MACHINE\\Hardware\\Description\\System\\CentralProcessor\\0;Identifier]" NAME CACHE) 19 | elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") 20 | # handle MacOs 21 | endif() 22 | 23 | -------------------------------------------------------------------------------- /sdsl/examples/cst_bfs_iterator.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | using namespace sdsl; 8 | 9 | 10 | template 11 | void test(const char* file) { 12 | std::cout << file << std::endl; 13 | tCst cst; 14 | // util::verbose = true; 15 | construct(cst, file, 1); 16 | 17 | typedef cst_bfs_iterator iterator; 18 | iterator begin = iterator(&cst, cst.root()); 19 | iterator end = iterator(&cst, cst.root(), true, true); 20 | 21 | for (iterator it = begin; it != end; ++it) { 22 | std::cout << cst.depth(*it) << "-[" << cst.lb(*it) << "," << cst.rb(*it) << "]" << std::endl; 23 | } 24 | } 25 | 26 | int main(int argc, char* argv[]) 27 | { 28 | if (argc < 2) { 29 | cout << "usage: "< >(argv[1]); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /query_performance/fm_index_cnt.txt: -------------------------------------------------------------------------------- 1 | 400L-95262:RoSA sgog$ ./bin/fm16_huff_rrr --input_file=web-4GB --benchmark_ext --pattern_file=pattern/web-4GB.40.1000.0.8.12.pattern 2 | run benchmark 3 | pattern_file_name pattern/web-4GB.40.1000.0.8.12.pattern 4 | # index_suf = fm16_huff_rrr 5 | # repeated_in_memory_search = 0 6 | # pattern_file_name = pattern/web-4GB.40.1000.0.8.12.pattern 7 | call generate_index 8 | factorization is not stored in 9 | load index from file .//web-4GB.fm16_huff_rrr.int_idx 10 | # file_name = web-4GB 11 | # b = 4096 12 | # fac_dens = 1 13 | # index_load_rtime = 8781.95 14 | # index_load_utime = 164.871 15 | # full_queries = 1000 16 | # cnt4 = 9355 17 | # cnt5 = 1000 18 | # rtime_full = 104.834 19 | # utime_full = 103.813 20 | # stime_full = 0.418 21 | # disk_access_per_query = 40 22 | # gap_disk_access_per_query = 1.40735e+11 23 | # avg_int_match_depth = 1.40735e+11 24 | # ratio_of_int_matched_queries = 1 25 | # block_length_per_ext_query = 9.24968e+08 -------------------------------------------------------------------------------- /sdsl/examples/text_statistics.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | using namespace sdsl; 6 | 7 | int main(int argc, char* argv[]){ 8 | if ( argc < 2 ){ 9 | cout << "Usage: "< cst; 13 | typedef cst_sct3<>::size_type size_type; 14 | typedef cst_sct3<>::char_type char_type; 15 | construct(cst, argv[1], 1); 16 | 17 | long double red = 0; 18 | long double lcp_mean = 0; 19 | if( cst.csa.size() ){ 20 | char_type bwti_1 = cst.csa.bwt[0]; 21 | for(size_type i=1; i& text, const int_vector_size_type size, int_vector_size_type* C); 16 | 17 | 18 | template 19 | void calculate_effective_alphabet_size(const size_type* C, sigma_type& sigma) 20 | { 21 | sigma = 0; // initialize with 0 22 | for (size_type i=0; i < 256; ++i) // for all possible symbols 23 | if (C[i] > 0) // increase sigma, if it 24 | ++sigma; // exists in the text 25 | } 26 | 27 | } // end namespace sdsl 28 | #endif 29 | -------------------------------------------------------------------------------- /SPIRE2013/template/x.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage{tikz} 4 | \usetikzlibrary{calc, positioning, arrows, backgrounds} 5 | \usepackage{pgf} 6 | \input{../macros/rosa_tikz.tex} 7 | \input{../macros/rosa_definitions.tex} 8 | 9 | \begin{document} 10 | 11 | \newcommand{\exampleFile}[0]{XXXXXXXXXX} 12 | 13 | \begin{figure} 14 | \tikzstyle{st_sa} = [xshift=3.2cm] 15 | \tikzstyle{st_elem_lcp} = [transparent] 16 | \tikzstyle{st_bwt} = [xshift=2cm] 17 | \tikzstyle{st_elem_fwdbf} = [transparent] 18 | \tikzstyle{st_text} = [xshift=3.6cm] 19 | \tikzstyle{st_interval_edge} = [transparent] 20 | \tikzstyle{st_block_header} = [transparent] 21 | \input{\exampleFile.fwd_idx.tex} 22 | \drawheaderfwd 23 | \end{figure} 24 | 25 | \begin{figure} 26 | \bwdIndexLayout 27 | \input{\exampleFile.bwd_idx.tex} 28 | \drawheaderbwd 29 | \markFwdBlocksInBwdIndex 30 | \printBlAndCBWT \\ 31 | \printBmAndMinDepth 32 | 33 | \input{\exampleFile.fac.tex} 34 | \printFac 35 | \end{figure} 36 | 37 | \end{document} 38 | -------------------------------------------------------------------------------- /sdsl/INSTALL: -------------------------------------------------------------------------------- 1 | The installation requires the cross-platoform 2 | build-tool cmake to be installed first. 3 | 4 | You can download cmake here: 5 | 6 | http://cmake.org/cmake/resources/software.html 7 | 8 | With cmake installed, the library then can be 9 | installed automatically by running the command 10 | ./install.sh YOUR_SDSL_INSTALL_PREFIX 11 | 12 | YOUR_SDSL_INSTALL_PREFIX should be an existing 13 | directory other then the directory where this 14 | INSTALL file is located in. 15 | 16 | After running the script you can change into 17 | the test directory and make and execute the tests by 18 | make && make test 19 | 20 | Check out also the examples directory. 21 | 22 | You can compile your own program example.cc by 23 | 24 | g++ -O3 -DNDEBUG -funroll-loops -I YOUR_SDSL_INSTALL_PREFIX/include \ 25 | -LYOUR_SDSL_INSTALL_PREFIX/lib -o example example.cc \ 26 | -lsdsl -ldivsufsort -ldivsufsort64 27 | 28 | or you can copy the Makefile from the examples directory 29 | to build you programs using sdsl. 30 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/test/README: -------------------------------------------------------------------------------- 1 | This is a set of tests for the succinct data structure library (sdsl). 2 | 3 | You can compile the tests by calling 4 | `make` 5 | and execute them by calling 6 | `make test` 7 | or 8 | `make vtest`, if you would like to 9 | call the test with valgrind. 10 | . 11 | 12 | In some test instances we generate data structures, e.g. 13 | compressed suffix trees, for real world inputs. 14 | These inputs are downloaded with the command 15 | `curl` from a ``Project Gutenberg'' mirror and Simon's 16 | homepage before the first execution of the test. 17 | 18 | The tests use google's gtest framework which should 19 | be installed, since you have already executed 20 | the `install.sh` bash script to install the sdsl 21 | library. 22 | 23 | If you find a bug, please report it to us. Thanks. 24 | 25 | ### Acknowledgements 26 | We thank 27 | * Project Gutenberg for providing test inputs for the 28 | byte-alphabet data structures. 29 | * Shane Culpepper for providing the test inputs 30 | `keeper.int` and `moby.int` for the integer-alphabet CSA and CSTs. 31 | -------------------------------------------------------------------------------- /src/basic_functions.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Read a file called file_name and create a data frame the following way 4 | # (1) Parse all the lines of the form 5 | # '# key = value' 6 | # (2) Each unique key gets a column 7 | data_frame_from_key_value_pairs <- function(file_name){ 8 | lines <- readLines(file_name) 9 | lines <- lines[grep("^#.*=.*",lines)] 10 | d <- gsub("^#","",gsub("[[:space:]]","",unlist(strsplit(lines,split="=")))) 11 | keys <- unique(d[seq(1,length(d),2)]) 12 | keynr <- length(keys) 13 | dd <- d[seq(2,length(d),2)] 14 | dim(dd) <- c( keynr, length(dd)/keynr ) 15 | data <- data.frame(t(dd)) 16 | names(data) <- keys 17 | 18 | for (col in keys){ 19 | t <- as.character(data[[col]]) 20 | suppressWarnings( tt <- as.numeric(t) ) 21 | if ( length( tt[is.na(tt)] ) == 0 ){ # if there are not NA in tt 22 | data[[col]] <- tt 23 | } 24 | } 25 | data 26 | } 27 | 28 | format_str_fixed_width <- function(x, width=4){ 29 | sx <- as.character(x) 30 | if ( nchar(sx) < width ){ 31 | for (i in 1:(width-nchar(sx))){ 32 | sx <- paste("\\D",sx, sep="") 33 | } 34 | } 35 | sx 36 | } 37 | -------------------------------------------------------------------------------- /query_performance/query_web-4GB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bin_dir="../bin" 4 | output_dir=".." 5 | pattern_dir="../pattern" 6 | tmp_dir="../tmp" 7 | file="../web-4GB" 8 | file_basename=`basename ${file}` 9 | 10 | threshold=4096 11 | 12 | pattern_number=1000 13 | pattern_len=20 14 | result_file="query_performance_web-4GB.txt" 15 | repetitions=5 16 | 17 | rm -f ${result_file} 18 | 19 | for fac_dens in 0 1 2 4 8 16 32 64 128 256 512 1024; do 20 | for i in `seq 1 ${repetitions}`; do 21 | for pattern_len in 4 10 20 40 100; do 22 | for occ in "1 1" "8 12" "75 125" "750 1250" "7500 12500"; do 23 | min_occ=${occ% *} 24 | max_occ=${occ#* } 25 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 26 | pattern_file=${pattern_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 27 | echo "${pattern_file}" 28 | ${bin_dir}/rosa_sd2_delta --input_file=${file} --threshold=${threshold} --output_dir=${output_dir} \ 29 | --benchmark --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${result_file} 30 | done 31 | done 32 | done 33 | done 34 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/fast_cache.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef INCLUDED_SDSL_FAST_CACHE 3 | #define INCLUDED_SDSL_FAST_CACHE 4 | 5 | #include "int_vector.hpp" 6 | 7 | namespace sdsl 8 | { 9 | 10 | #define CACHE_SIZE 0x3FFULL 11 | 12 | struct fast_cache { 13 | typedef int_vector<>::size_type size_type; 14 | size_type m_table[2*(CACHE_SIZE+1)]; 15 | // Constructor 16 | fast_cache() { 17 | for (size_type i=0; i < (CACHE_SIZE+1); ++i) { 18 | m_table[i<<1] = (size_type)-1; 19 | } 20 | } 21 | // Returns true if the request i is cached and 22 | // x is set to the answer of request i 23 | bool exists(size_type i, size_type& x) { 24 | if (m_table[(i&CACHE_SIZE)<<1 ] == i) { 25 | x = m_table[((i&CACHE_SIZE)<<1) + 1 ]; 26 | return true; 27 | } else 28 | return false; 29 | } 30 | // Writes the answer for request i to the cache 31 | void write(size_type i, size_type x) { 32 | m_table[(i&CACHE_SIZE)<<1 ] = i; 33 | m_table[((i&CACHE_SIZE)<<1) + 1 ] = x; 34 | } 35 | }; 36 | 37 | } // end namespace sdsl 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /query_performance/query_web-64GB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bin_dir="../bin" 4 | output_dir=".." 5 | pattern_dir="../pattern" 6 | tmp_dir="../tmp" 7 | file="../web-64GB" 8 | file_basename=`basename ${file}` 9 | 10 | threshold=4096 11 | 12 | pattern_number=1000 13 | pattern_len=20 14 | result_file="query_performance_web-64GB.txt" 15 | repetitions=5 16 | 17 | if [[ $# -lt 1 ]] ; then 18 | echo "Please give the fac_dens as first command line argument " 19 | exit 20 | fi 21 | 22 | fac_dens=${1} 23 | os=`uname` 24 | 25 | for i in `seq 1 ${repetitions}`; do 26 | for pattern_len in 40; do 27 | for occ in "8 12" "75 125"; do 28 | if [[ "$os" == 'Darwin' ]]; then 29 | purge 30 | fi 31 | 32 | min_occ=${occ% *} 33 | max_occ=${occ#* } 34 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 35 | pattern_file=${pattern_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 36 | echo "${pattern_file}" 37 | ${bin_dir}/rosa_sd2_delta --input_file=${file} --threshold=${threshold} --output_dir=${output_dir} \ 38 | --benchmark_ext --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${result_file} 39 | done 40 | done 41 | done 42 | -------------------------------------------------------------------------------- /sdsl/test/test_cases/small/get_corpus.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | OLD_DIR=`pwd` 4 | CUR_DIR="$( cd "$( dirname "$0" )" && pwd )" # gets the directory where the script is located in 5 | cd ${CUR_DIR} 6 | 7 | # Download test cases 8 | GUTENBERG_MIRROR="ftp://www.artfiles.org/gutenberg.org" 9 | FAUST_URL="${GUTENBERG_MIRROR}/2/2/2/2229/2229-8.txt" 10 | FAUST_BASENAME=`basename ${FAUST_URL}` 11 | FAUST_NAME='faust.txt' 12 | 13 | ZARATHUSTRA_URL="${GUTENBERG_MIRROR}/7/2/0/7205/7205-8.txt" 14 | ZARATHUSTRA_BASENAME=`basename ${ZARATHUSTRA_URL}` 15 | ZARATHUSTRA_NAME='zarathustra.txt' 16 | 17 | SIMONS_HOMEPAGE="http://people.eng.unimelb.edu.au/sgog/test_cases" 18 | INT_TEST_CASES='keeper.int moby.int' 19 | 20 | # Include download function 21 | source "${CUR_DIR}/../../../scripts/download.sh" 22 | 23 | if [[ ! -e ${FAUST_NAME} ]]; then 24 | download_from_url "${FAUST_URL}" 25 | mv ${FAUST_BASENAME} ${FAUST_NAME} 26 | fi 27 | 28 | if [[ ! -e ${ZARATHUSTRA_NAME} ]]; then 29 | download_from_url "${ZARATHUSTRA_URL}" 30 | mv ${ZARATHUSTRA_BASENAME} ${ZARATHUSTRA_NAME} 31 | fi 32 | 33 | for int_file in ${INT_TEST_CASES}; do 34 | if [[ ! -e ${int_file} ]]; then 35 | download_from_url "${SIMONS_HOMEPAGE}/${int_file}" 36 | fi 37 | done 38 | 39 | cd ${OLD_DIR} 40 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include" 2 | "${CMAKE_CURRENT_BINARY_DIR}/../include") 3 | 4 | set(divsufsort_SRCS divsufsort.c sssort.c trsort.c utils.c) 5 | 6 | ## libdivsufsort ## 7 | add_library(divsufsort ${divsufsort_SRCS}) 8 | install(TARGETS divsufsort 9 | RUNTIME DESTINATION bin 10 | LIBRARY DESTINATION lib 11 | ARCHIVE DESTINATION lib) 12 | set_target_properties(divsufsort PROPERTIES 13 | VERSION "${LIBRARY_VERSION_FULL}" 14 | SOVERSION "${LIBRARY_VERSION_MAJOR}" 15 | DEFINE_SYMBOL DIVSUFSORT_BUILD_DLL 16 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../examples") 17 | 18 | ## libdivsufsort64 ## 19 | if(BUILD_DIVSUFSORT64) 20 | add_library(divsufsort64 ${divsufsort_SRCS}) 21 | install(TARGETS divsufsort64 22 | RUNTIME DESTINATION bin 23 | LIBRARY DESTINATION lib 24 | ARCHIVE DESTINATION lib) 25 | set_target_properties(divsufsort64 PROPERTIES 26 | VERSION "${LIBRARY_VERSION_FULL}" 27 | SOVERSION "${LIBRARY_VERSION_MAJOR}" 28 | DEFINE_SYMBOL DIVSUFSORT_BUILD_DLL 29 | COMPILE_FLAGS "-DBUILD_DIVSUFSORT64" 30 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../examples") 31 | endif(BUILD_DIVSUFSORT64) 32 | -------------------------------------------------------------------------------- /SPIRE2013/generate_figure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | threshold=3 4 | fac_dens=1 5 | rosa_exec=../bin/rosa_sd2_delta 6 | tmp_dir=tmp 7 | 8 | if [ $# -lt 1 ]; then 9 | echo "Usage: ${0} file [threshold] [fac_dens]" 10 | echo " file : File containing the example string" 11 | echo " threshold: Block threshold; default=${threshold}" 12 | echo " fac_dens : Sampling parameter for factorization pointer; default=${fac_dens}" 13 | exit 1 14 | fi 15 | 16 | if [ $# -gt 1 ]; then 17 | threshold=${2} 18 | fi 19 | if [ $# -gt 2]; then 20 | fac_dens=${3} 21 | fi 22 | 23 | basename=`basename ${1}` 24 | 25 | ${rosa_exec} --input_file=${1} --threshold=${threshold} --fac_dens=${fac_dens} --generate_index --tmp_file_dir=${tmp_dir}/ --output_dir=${tmp_dir}/ 26 | ${rosa_exec} --input_file=${1} --threshold=${threshold} --fac_dens=${fac_dens} --output_tikz --tmp_file_dir=${tmp_dir}/ --output_dir=${tmp_dir}/ 27 | 28 | tmp_tex_file=${basename}.${threshold}.tex 29 | tmp_pdf_file=${basename}.${threshold}.pdf 30 | 31 | sed "s|XXXXXXXXXX|${basename}.${threshold}|g" template/x.tex > ${tmp_dir}/${tmp_tex_file} 32 | 33 | cd ${tmp_dir} 34 | pdflatex ${tmp_tex_file} 35 | pdflatex ${tmp_tex_file} 36 | mv ${tmp_pdf_file} .. 37 | cd .. 38 | 39 | #rm ${tmp_dir}/* 40 | rm ${basename}_rev 41 | -------------------------------------------------------------------------------- /sdsl/examples/hugepages.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | using namespace sdsl; 10 | using namespace std; 11 | 12 | template 13 | void do_something(const tCsa &csa){ 14 | stop_watch sw; 15 | uint64_t sum=0; 16 | sw.start(); 17 | for(size_t i=0; i 25 | #include "bitmagic.hpp" 26 | 27 | namespace sdsl { 28 | 29 | typedef unsigned int uint128_t __attribute__((mode(TI))); 30 | 31 | std::ostream& operator<<(std::ostream& os, const uint128_t& x); 32 | 33 | } // end namespace 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/COPYING: -------------------------------------------------------------------------------- 1 | The libdivsufsort copyright is as follows: 2 | 3 | Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | See also the libdivsufsort web site: 27 | http://libdivsufsort.googlecode.com/ for more information. 28 | -------------------------------------------------------------------------------- /sdsl/lib/tikz.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/tikz.hpp" 2 | 3 | namespace sdsl 4 | { 5 | 6 | void begin_tikzpicture(ostream& out, string options) 7 | { 8 | out << "\\begin{tikzpicture}[" << options << "]%\n" << endl; 9 | } 10 | 11 | void end_tikzpicture(ostream& out) 12 | { 13 | out << "\\end{tikzpicture}%\n" << endl; 14 | } 15 | 16 | void begin_tikzscope(ostream& out, string options) 17 | { 18 | out << "\\begin{scope}[" << options << "]\n" << endl; 19 | } 20 | 21 | void end_tikzscope(ostream& out) 22 | { 23 | out << "\\end{scope}%\n" << endl; 24 | } 25 | 26 | void tikz_node(ostream& out, string content, string at, string name, string options) 27 | { 28 | out<< "\\node[" << options << "] (" << name << ") at ("<< at <<") {" << content << "};%\n"; 29 | } 30 | 31 | void tikz_coordinate(ostream& out, string at, string name, string option) 32 | { 33 | out<< "\\coordinate[" << option << "] (" << name << ")"; 34 | if (at != "") 35 | out <<" at ("<< at <<")"; 36 | out << ";%\n"; 37 | } 38 | 39 | void write_y_column(ostream& out, size_t n) 40 | { 41 | begin_tikzscope(out, "st_y"); 42 | tikz_coordinate(out, "0,0", "y0"); 43 | for (size_t i=1; i 6 | 7 | namespace sdsl 8 | { 9 | 10 | void construct_isa(cache_config &config) { 11 | typedef int_vector<>::size_type size_type; 12 | tMSS::const_iterator key = config.file_map.find(constants::KEY_ISA); 13 | if ( config.file_map.end() == key ) { // if isa is not already on disk => calculate it 14 | write_R_output("cst", "construct ISA", "begin", 1, 0); 15 | int_vector<> isa; 16 | if (!util::load_from_file(isa, config.file_map[constants::KEY_SA].c_str())) { 17 | throw std::ios_base::failure("cst_construct: Cannot load SA from file system!"); 18 | } 19 | { 20 | int_vector_file_buffer<> sa_buf(config.file_map[constants::KEY_SA].c_str()); 21 | 22 | for (size_type i=0, r_sum=0, r = sa_buf.load_next_block(); r_sum < isa.size();) { 23 | for (; i 2 | #include 3 | #include 4 | 5 | using namespace sdsl; 6 | using namespace std; 7 | 8 | int main(int argc, char* argv[]){ 9 | size_t size = 10000000; 10 | // create a int_vector (each int of fixed size 8 bits) of length 10000000 11 | int_vector<8> v(size); 12 | 13 | // initialize vector with random bits, seed of the random process = 42 14 | util::set_random_bits(v, 42); 15 | 16 | // store int_vector to temporary file 17 | string tmp_file = "file_buffer_example.int_vector"; 18 | util::store_to_file(v, tmp_file.c_str()); 19 | 20 | // open file buffer 21 | int_vector_file_buffer<8> v_buf(tmp_file.c_str()); 22 | 23 | if ( v.size() != v_buf.int_vector_size ) { 24 | std::cerr << "ERROR: v.size() = " << v.size() << " != " << v_buf.int_vector_size << " = v_buf.int_vector_size" << std::endl; 25 | } 26 | 27 | // stream vector data from disk and compare it with in-memory data 28 | for (size_t i = 0, r_sum = 0, r = v_buf.load_next_block(); i < v.size();){ 29 | for(; i < r_sum +r; ++i){ 30 | if( v[i] != v_buf[i-r_sum] ){ 31 | std::cerr << "ERROR: v["<< i << "] != v_buf[" << i-r_sum << "]" << std::endl; 32 | return 1; 33 | } 34 | } 35 | r_sum += r; r = v_buf.load_next_block(); 36 | } 37 | 38 | // remove temporary file 39 | std::remove(tmp_file.c_str()); 40 | } 41 | -------------------------------------------------------------------------------- /sdsl/lib/select_support_dummy.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/select_support_dummy.hpp" 2 | 3 | namespace sdsl 4 | { 5 | 6 | select_support_dummy::select_support_dummy(const bit_vector* v):select_support(v) { } 7 | 8 | 9 | select_support_dummy::select_support_dummy(const select_support_dummy& ss):select_support(ss.m_v) { } 10 | 11 | 12 | select_support_dummy& select_support_dummy::operator=(const select_support_dummy& ss) { 13 | return *this; 14 | } 15 | 16 | void select_support_dummy::swap(select_support_dummy& ss) { } 17 | 18 | select_support_dummy::~select_support_dummy() { } 19 | 20 | const select_support_dummy::size_type select_support_dummy::select(size_type i)const { 21 | throw std::logic_error("select_dummy does not implement select"); 22 | return 0; 23 | } 24 | 25 | 26 | const select_support_dummy::size_type select_support_dummy::operator()(size_type i)const { 27 | return select(i); 28 | } 29 | 30 | void select_support_dummy::set_vector(const bit_vector* v) { } 31 | 32 | select_support_dummy::size_type select_support_dummy::serialize(std::ostream& out, structure_tree_node* v, std::string name)const { 33 | structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); 34 | structure_tree::add_size(child, 0); 35 | return 0; 36 | } 37 | 38 | void select_support_dummy::load(std::istream& in, const bit_vector* v) { } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /sdsl/lib/algorithms_for_suffix_array_construction.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/algorithms_for_suffix_array_construction.hpp" 2 | 3 | namespace sdsl 4 | { 5 | 6 | namespace algorithm 7 | { 8 | // \param c Char array pointing to the text 9 | // \param n Length of the text 10 | bool shift_text(char* c, uint64_t n, bool shift) 11 | { 12 | uint64_t cnt_c[256] = {0}; 13 | for (uint64_t i=0; i0; 20 | if (i > 0 and cnt_c[i] < cnt_c[min_cnt]) 21 | min_cnt = i; 22 | } 23 | if (cnt_cc == 256) { 24 | std::cerr << "# ERROR: Alphabet size>255!!!" << std::endl; 25 | std::cerr << "min_cnt = "<< min_cnt << " C[min_cnt]="<< cnt_c[min_cnt] << std::endl; 26 | for (uint64_t i=0; i" ) 12 | elseif( HAVE_INTTYPES_H ) 13 | set( INTINCFILE "#include " ) 14 | else() 15 | set( INTINCFILE "" ) 16 | endif() 17 | 18 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/uintx_t.hpp.cmake" 19 | "${CMAKE_CURRENT_BINARY_DIR}/uintx_t.hpp" @ONLY) 20 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.cmake" 21 | "${CMAKE_CURRENT_BINARY_DIR}/config.hpp" @ONLY) 22 | 23 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/uintx_t.hpp" DESTINATION include/sdsl) 24 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/config.hpp" DESTINATION include/sdsl) 25 | 26 | ## copy hpp files to the binary tree ## 27 | 28 | file(GLOB hppFiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp") # select all .hpp-files 29 | 30 | foreach(hppFile ${hppFiles}) # copy each file 31 | configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/${hppFile}" "${CMAKE_CURRENT_BINARY_DIR}/${hppFile}" COPYONLY ) 32 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${hppFile}" DESTINATION include/sdsl) 33 | # MESSAGE(${hppFile}) 34 | endforeach(hppFile) 35 | 36 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/isa_construct.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2010 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file isa_construct.hpp 18 | \brief isa_construct.hpp contains a space and time efficient construction method for the inverse suffix array 19 | \author Simon Gog 20 | */ 21 | #ifndef INCLUDED_SDSL_ISA_CONSTRUCT 22 | #define INCLUDED_SDSL_ISA_CONSTRUCT 23 | 24 | #include "int_vector.hpp" 25 | #include "util.hpp" 26 | #include "testutils.hpp" 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | namespace sdsl 33 | { 34 | 35 | void construct_isa(cache_config &config); 36 | // TODO methode die den isa auf der bwt berechnet 37 | 38 | }// end namespace 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/wavelet_trees.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2011 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file wavelet_trees.hpp 18 | \brief wavelet_trees.hpp contains wavelet tree implementations. 19 | \author Simon Gog 20 | */ 21 | #ifndef INCLUDED_SDSL_WAVELET_TREES 22 | #define INCLUDED_SDSL_WAVELET_TREES 23 | 24 | /** \defgroup wt Wavelet Trees (WT) 25 | * This group contains data structures for wavelet trees. The following methods are supported: 26 | * - []-operator 27 | * - rank(i, c) 28 | * - select(i, c) 29 | * - inverse_select(i) 30 | */ 31 | 32 | #include "wt.hpp" 33 | #include "wt_int.hpp" 34 | #include "wt_huff.hpp" 35 | #include "wt_rlmn.hpp" 36 | #include "wt_rlg.hpp" 37 | #include "wt_rlg8.hpp" 38 | #include "construct.hpp" 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /query_performance/query_loc_web-64GB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bin_dir="../bin" 4 | output_dir=".." 5 | pattern_dir="../pattern" 6 | tmp_dir="../tmp" 7 | file="../web-64GB" 8 | file_basename=`basename ${file}` 9 | 10 | threshold=4096 11 | 12 | pattern_number=1000 13 | result_file="query_performance_loc_web-64GB.txt" 14 | repetitions=5 15 | 16 | # rm -f ${result_file} 17 | 18 | os=`uname` 19 | #if [[ "$os" == 'Darwin' ]]; then 20 | # echo "Setup Mac OS for experiments" 21 | # ./mac_setup.sh 22 | #fi 23 | 24 | #for fac_dens in 0 1 2 4 8 16 32 64 128 256 512 1024; do 25 | for fac_dens in 0; do 26 | for i in `seq 1 ${repetitions}`; do 27 | for pattern_len in 40; do 28 | for occ in "8 12" "75 125"; do 29 | if [[ "$os" == 'Darwin' ]]; then 30 | purge 31 | fi 32 | min_occ=${occ% *} 33 | max_occ=${occ#* } 34 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 35 | pattern_file=${pattern_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 36 | echo "${pattern_file} " 37 | echo "# phase = ${suffix}" >> ${result_file} 38 | ${bin_dir}/rosa_sd2_delta --input_file=${file} --threshold=${threshold} --output_dir="${output_dir}/" \ 39 | --benchmark_loc --benchmark_ext --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${result_file} 40 | done 41 | done 42 | done 43 | done 44 | 45 | #if [[ "$os" == 'Darwin' ]]; then 46 | # echo "Activate services on Mac OS again" 47 | # ./mac_teardown.sh 48 | #fi 49 | -------------------------------------------------------------------------------- /query_performance/query_loc_web-4GB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bin_dir="../bin" 4 | output_dir=".." 5 | pattern_dir="../pattern" 6 | tmp_dir="../tmp" 7 | file="../web-4GB" 8 | file_basename=`basename ${file}` 9 | 10 | threshold=4096 11 | 12 | pattern_number=1000 13 | result_file="query_performance_loc_web-4GB.txt" 14 | repetitions=1 15 | 16 | rm -f ${result_file} 17 | 18 | os=`uname` 19 | #if [[ "$os" == 'Darwin' ]]; then 20 | # echo "Setup Mac OS for experiments" 21 | # ./mac_setup.sh 22 | #fi 23 | 24 | #for fac_dens in 0 1 2 4 8 16 32 64 128 256 512 1024; do 25 | for fac_dens in 0 1 4 16 64 256 1024; do 26 | for i in `seq 1 ${repetitions}`; do 27 | for pattern_len in 40; do 28 | for occ in "8 12" "75 125"; do 29 | if [[ "$os" == 'Darwin' ]]; then 30 | purge 31 | fi 32 | min_occ=${occ% *} 33 | max_occ=${occ#* } 34 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 35 | pattern_file=${pattern_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 36 | echo "${pattern_file} " 37 | echo "# phase = ${suffix}" >> ${result_file} 38 | ${bin_dir}/rosa_sd2_delta --input_file=${file} --threshold=${threshold} --output_dir="${output_dir}/" \ 39 | --benchmark_loc --benchmark_ext --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${result_file} 40 | done 41 | done 42 | done 43 | done 44 | 45 | #if [[ "$os" == 'Darwin' ]]; then 46 | # echo "Activate services on Mac OS again" 47 | # ./mac_teardown.sh 48 | #fi 49 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/sdsl_concepts.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2010 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file suffixarray_helper.hpp 18 | \brief suffixarray_helper.hpp contains some helper classes for (compressed suffix arrays) 19 | \author Simon Gog 20 | */ 21 | #ifndef INCLUDED_SDSL_CONCEPTS 22 | #define INCLUDED_SDSL_CONCEPTS 23 | 24 | namespace sdsl 25 | { 26 | 27 | struct csa_tag {}; // compressed suffix array tag 28 | struct cst_tag {}; // compressed suffix tree tag 29 | struct wt_tag {}; // wavelet tree tag 30 | 31 | struct lcp_plain_tag {}; 32 | struct lcp_permuted_tag {}; 33 | struct lcp_tree_compressed_tag {}; 34 | struct lcp_tree_and_lf_compressed_tag {}; 35 | 36 | 37 | struct byte_alphabet_tag{}; 38 | struct int_alphabet_tag{}; 39 | 40 | } // end namespace sdsl 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/CMakeModules/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 3 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | STRING(REGEX REPLACE "\n" ";" files "${files}") 7 | 8 | SET(NUM 0) 9 | FOREACH(file ${files}) 10 | IF(EXISTS "$ENV{DESTDIR}${file}") 11 | MESSAGE(STATUS "Looking for \"$ENV{DESTDIR}${file}\" - found") 12 | SET(UNINSTALL_CHECK_${NUM} 1) 13 | ELSE(EXISTS "$ENV{DESTDIR}${file}") 14 | MESSAGE(STATUS "Looking for \"$ENV{DESTDIR}${file}\" - not found") 15 | SET(UNINSTALL_CHECK_${NUM} 0) 16 | ENDIF(EXISTS "$ENV{DESTDIR}${file}") 17 | MATH(EXPR NUM "1 + ${NUM}") 18 | ENDFOREACH(file) 19 | 20 | SET(NUM 0) 21 | FOREACH(file ${files}) 22 | IF(${UNINSTALL_CHECK_${NUM}}) 23 | MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 24 | EXEC_PROGRAM( 25 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 26 | OUTPUT_VARIABLE rm_out 27 | RETURN_VALUE rm_retval 28 | ) 29 | IF(NOT "${rm_retval}" STREQUAL 0) 30 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 31 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 32 | ENDIF(${UNINSTALL_CHECK_${NUM}}) 33 | MATH(EXPR NUM "1 + ${NUM}") 34 | ENDFOREACH(file) 35 | 36 | FILE(REMOVE "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 37 | -------------------------------------------------------------------------------- /sdsl/examples/range_minimum_queries.cpp: -------------------------------------------------------------------------------- 1 | #include // include header for range minimum queries 2 | #include 3 | #include // for atoi 4 | 5 | using namespace sdsl; 6 | using namespace std; 7 | 8 | int main(int argc, char **argv){ 9 | size_t len = 50; 10 | if( argc > 1 ){ 11 | len = atoi(argv[1]); 12 | } 13 | int_vector<> v(len, 7); // create a vector of length 50 14 | for(size_t i=1; i < v.size(); ++i){ 15 | size_t x = v[i-1]; 16 | v[i] = (x*7-1) % 97; 17 | } 18 | cout << "get_size_in_bytes(v)=" << util::get_size_in_bytes(v) << endl; 19 | 20 | rmq_succinct_sct<> rmq(&v); 21 | cout << "get_size_in_bytes(rmq)/v.size()=" << ((double)util::get_size_in_bytes(rmq))/v.size() << endl; 22 | 23 | if ( v.size() < 100 ) { // if the vector is small 24 | cout << "v = " << v << endl; // output it 25 | } 26 | size_t left = 0, right = v.size()-1; 27 | 28 | // rmq does not need v to answer the queries 29 | util::clear(v); // so we can free the space for v 30 | 31 | size_t count = 0; 32 | 33 | while( left < right ){ 34 | size_t min_pos = rmq(left, right); 35 | if ( ++count < 10 ){ 36 | cout << "minimum of v[" << left << "..." << right << "] at index "; 37 | cout << min_pos << endl; 38 | } 39 | if ( min_pos - left > right - min_pos ){ 40 | right = min_pos - 1; 41 | }else{ 42 | left = min_pos + 1; 43 | } 44 | } 45 | cout << endl; 46 | cout << "Breakdown of the data structure: " << endl; 47 | util::write_structure(rmq, cout); 48 | cout << endl; 49 | } 50 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/bp_support.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2009 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file bp_support.hpp 18 | \brief bp_support.hpp contains several classed which support find_open, find_close, enclose and rr-enclose queries. 19 | \author Simon Gog 20 | */ 21 | 22 | #ifndef INCLUDED_SDSL_BP_SUPPORT 23 | #define INCLUDED_SDSL_BP_SUPPORT 24 | 25 | /** \defgroup bps Balanced Parentheses Supports (BPS) 26 | * This group contains data structures which supports a sdsl::bit_vector with the following methods: 27 | * - find_open 28 | * - find_close 29 | * - enclose 30 | * - rank 31 | * - select 32 | * - excess 33 | * - (rr_enclose) 34 | */ 35 | 36 | #include "bp_support_j.hpp" 37 | #include "bp_support_g.hpp" 38 | #include "bp_support_gg.hpp" 39 | #include "bp_support_sada.hpp" 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /query_performance/query_details_web-64GB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bin_dir="../bin" 4 | output_dir=".." 5 | pattern_dir="../pattern" 6 | tmp_dir="../tmp" 7 | file="../web-64GB" 8 | file_basename=`basename ${file}` 9 | 10 | threshold=4096 11 | 12 | pattern_number=1000 13 | result_file="query_performance_details_web-64GB.txt" 14 | repetitions=5 15 | 16 | #rm -f ${result_file} 17 | 18 | os=`uname` 19 | #if [[ "$os" == 'Darwin' ]]; then 20 | # echo "Setup Mac OS for experiments" 21 | # ./mac_setup.sh 22 | #fi 23 | 24 | #for fac_dens in 0 1 2 4 8 16 32 64 128 256 512 1024; do 25 | for fac_dens in 16; do 26 | for i in `seq 1 ${repetitions}`; do 27 | for pattern_len in 40; do 28 | for occ in "8 12" "75 125"; do 29 | for suffix in '0' '1' '2' '3' '4' '5'; do 30 | if [[ "$os" == 'Darwin' ]]; then 31 | purge 32 | fi 33 | min_occ=${occ% *} 34 | max_occ=${occ#* } 35 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 36 | pattern_file=${pattern_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 37 | echo "${pattern_file} " 38 | echo "# phase = ${suffix}" >> ${result_file} 39 | ${bin_dir}/rosa_sd2_delta_P${suffix} --input_file=${file} --threshold=${threshold} --output_dir="${output_dir}/" \ 40 | --benchmark_ext --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${result_file} 41 | done 42 | done 43 | done 44 | done 45 | done 46 | 47 | #if [[ "$os" == 'Darwin' ]]; then 48 | # echo "Activate services on Mac OS again" 49 | # ./mac_teardown.sh 50 | #fi 51 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/COPYING: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /query_performance/query_details_web-4GB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bin_dir="../bin" 4 | output_dir=".." 5 | pattern_dir="../pattern" 6 | tmp_dir="../tmp" 7 | file="../web-4GB" 8 | file_basename=`basename ${file}` 9 | 10 | threshold=4096 11 | 12 | pattern_number=1000 13 | result_file="query_performance_details_web-4GB.txt" 14 | repetitions=5 15 | 16 | rm -f ${result_file} 17 | 18 | os=`uname` 19 | #if [[ "$os" == 'Darwin' ]]; then 20 | # echo "Setup Mac OS for experiments" 21 | # ./mac_setup.sh 22 | #fi 23 | 24 | #for fac_dens in 0 1 2 4 8 16 32 64 128 256 512 1024; do 25 | for fac_dens in 0 1 4 16 64 256 1024; do 26 | for i in `seq 1 ${repetitions}`; do 27 | for pattern_len in 40; do 28 | for occ in "8 12" "75 125"; do 29 | for suffix in '0' '1' '2' '3' '4' '5'; do 30 | if [[ "$os" == 'Darwin' ]]; then 31 | purge 32 | fi 33 | min_occ=${occ% *} 34 | max_occ=${occ#* } 35 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 36 | pattern_file=${pattern_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 37 | echo "${pattern_file} " 38 | echo "# phase = ${suffix}" >> ${result_file} 39 | ${bin_dir}/rosa_sd2_delta_P${suffix} --input_file=${file} --threshold=${threshold} --output_dir="${output_dir}/" \ 40 | --benchmark_ext --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${result_file} 41 | done 42 | done 43 | done 44 | done 45 | done 46 | 47 | #if [[ "$os" == 'Darwin' ]]; then 48 | # echo "Activate services on Mac OS again" 49 | # ./mac_teardown.sh 50 | #fi 51 | -------------------------------------------------------------------------------- /sdsl/examples/csa_alphabet_strategy.cpp: -------------------------------------------------------------------------------- 1 | /* This example shows how the representation of the alphabet dependent 2 | * part of a CST can be altered by using policy classes. 3 | * 4 | * Author: Simon Gog 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace sdsl; 12 | using namespace std; 13 | 14 | template 15 | void csa_info(Csa &csa, const char* file, bool json){ 16 | cout << "file: " << file << endl; 17 | construct(csa, file, 1); 18 | cout << "csa of type " << util::demangle(typeid(csa).name()) << endl; 19 | cout << "size in bytes : " << util::get_size_in_bytes(csa) << endl; 20 | if ( json ){ 21 | cout << "json output: " << endl; 22 | util::write_structure( csa, cout ); 23 | cout << endl; 24 | } 25 | } 26 | 27 | int main(int argc, char* argv[]){ 28 | if ( argc < 2 ){ 29 | cout << "Usage: " << argv[0] << " file [json]" << endl; 30 | return 1; 31 | } 32 | bool json = false; 33 | if ( argc > 2 ){ 34 | json = true; 35 | } 36 | csa_sada, 32, 32, sa_order_sa_sampling<>, int_vector<>, byte_alphabet_strategy> csa1; 37 | csa_sada, 32, 32, sa_order_sa_sampling<>, int_vector<>, succinct_byte_alphabet_strategy<> > csa2; 38 | csa_wt, 32, 32, sa_order_sa_sampling<>, int_vector<>, byte_alphabet_strategy> csa3; 39 | csa_wt, 32, 32, sa_order_sa_sampling<>, int_vector<>, succinct_byte_alphabet_strategy<> > csa4; 40 | csa_info(csa1, argv[1], json); 41 | csa_info(csa2, argv[1], json); 42 | csa_info(csa3, argv[1], json); 43 | csa_info(csa4, argv[1], json); 44 | } 45 | -------------------------------------------------------------------------------- /sdsl/examples/import_non_sdsl_data_gen_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace sdsl; 7 | using namespace std; 8 | 9 | template 10 | void write_inc_file(const char *name, size_t len){ 11 | ofstream out(name); 12 | for(size_t i=1; i<=len; ++i){ 13 | T x = i; 14 | out.write((char*)&x,sizeof(x)); 15 | } 16 | out.close(); 17 | } 18 | 19 | template 20 | void write_const_file(const char *name, size_t len){ 21 | int_vector<8> v(len, 42); 22 | util::store_to_plain_array(v, name); 23 | } 24 | 25 | int main(int argc, char* argv[]){ 26 | if ( argc < 2 ){ 27 | cout << "Usage: "<("v.8bit", len); 38 | write_inc_file("v.16bit", len); 39 | write_inc_file("v.32bit", len); 40 | write_inc_file("v.64bit", len); 41 | 42 | write_const_file("v42.8bit", len); 43 | write_const_file("v42.16bit", len); 44 | write_const_file("v42.32bit", len); 45 | write_const_file("v42.64bit", len); 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/config.hpp.cmake: -------------------------------------------------------------------------------- 1 | #ifndef SDSL_CONFIG 2 | #define SDSL_CONFIG 3 | 4 | #define CMAKE_SOURCE_DIR @CMAKE_SOURCE_DIR@ 5 | #cmakedefine divsufsort_FOUND 6 | #cmakedefine divsufsort64_FOUND 7 | 8 | #include "uintx_t.hpp" 9 | #include 10 | #include 11 | 12 | namespace sdsl{ 13 | namespace constants{ // namespace for library constant 14 | // size of the buffer for reading and writing data in elements (not in bytes) 15 | const uint64_t SDSL_BLOCK_SIZE = (uint64_t)1<<22; 16 | 17 | const char KEY_BWT[] = "bwt"; 18 | const char KEY_BWT_INT[] = "bwt_int"; 19 | const char KEY_SA[] = "sa"; 20 | const char KEY_ISA[] = "isa"; 21 | const char KEY_TEXT[] = "text"; 22 | const char KEY_TEXT_INT[] = "text_int"; 23 | const char KEY_PSI[] = "psi"; 24 | const char KEY_LCP[] = "lcp"; 25 | } 26 | typedef uint64_t int_vector_size_type; 27 | 28 | typedef std::map tMSS; 29 | 30 | //! Helper class for construction process 31 | struct cache_config{ 32 | bool delete_files; // Flag which indicates if all files which were created 33 | // during construction should be deleted. 34 | std::string dir; // Directory for temporary files. 35 | std::string id; // Identifier is part of temporary file names. If 36 | // id is the empty string, then it will be replace 37 | // a concatenation of PID and a unique ID inside the 38 | // current process. 39 | tMSS file_map; // Files stored during the construction process. 40 | cache_config(bool f_delete_files=true, std::string f_dir="./", std::string f_id="", tMSS f_file_map=tMSS()); 41 | }; 42 | } 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /query_performance/query_usb_web-4GB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bin_dir="../bin" 4 | output_dir=".." 5 | usb_dir="/Volumes/USB" 6 | pattern_dir="../pattern" 7 | tmp_dir="../tmp" 8 | file="${usb_dir}/web-4GB" 9 | file_basename=`basename ${file}` 10 | 11 | threshold=4096 12 | 13 | pattern_number=1000 14 | pattern_len=20 15 | result_file="query_performance_usb_web-4GB.txt" 16 | repetitions=5 17 | 18 | rm -f ${result_file} 19 | 20 | os=`uname` 21 | if [[ "$os" == 'Darwin' ]]; then 22 | echo "Setup Mac OS for experiments" 23 | ./mac_setup.sh 24 | fi 25 | 26 | #for fac_dens in 0 1 2 4 8 16 32 64 128 256 512 1024; do 27 | #for fac_dens in 0 1 4 16 64 256 1024; do 28 | for fac_dens in 0; do 29 | # cp ${output_dir}/web-4GB.${threshold}.${fac_dens}.2.1.* ${usb_dir} 30 | for i in `seq 1 ${repetitions}`; do 31 | for pattern_len in 4 10 20 40 100; do 32 | for occ in "1 1" "8 12" "75 125" "750 1250" "7500 12500"; do 33 | if [[ "$os" == 'Darwin' ]]; then 34 | purge 35 | fi 36 | min_occ=${occ% *} 37 | max_occ=${occ#* } 38 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 39 | pattern_file=${pattern_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 40 | echo "${pattern_file}" 41 | ${bin_dir}/rosa_sd2_delta --input_file=${file} --threshold=${threshold} --output_dir="${usb_dir}" \ 42 | --benchmark --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${result_file} 43 | done 44 | done 45 | done 46 | # rm ${usb_dir}/web-4GB.${threshold}.${fac_dens}.2.1.* 47 | done 48 | 49 | if [[ "$os" == 'Darwin' ]]; then 50 | echo "Activate services on Mac OS again" 51 | ./mac_teardown.sh 52 | fi 53 | -------------------------------------------------------------------------------- /sdsl/CHANGES: -------------------------------------------------------------------------------- 1 | 2012-02-08: Fixed handling of last block in rrr_vector in the constructor. Bug was discover through 2 | new tests (using gtest) for rank data structures. 3 | 2012-02-04: Moved non-template functions from lcp_constract.hpp and isa_construct.hpp into .cpp files. 4 | Thanks to Matthias Petri to pointing this out. 5 | 2012-01-27: Fixed a problem with compiling the library in C++0x. Thanks to Sebastian Me\ssmer for the patch. 6 | 2012-01-27: Fixed a bug in the Winer link operation of cst_sct* and cst_sada. Thanks to 7 | Kalle Karhu for pointing this out. 8 | 2012-01-25: Fixed some issues with GCC (Version 4.6.1). Thanks to Sebastian Me\ssmer. 9 | 2011-11-30: When the compile your programs with GCC (Version >= 3.4) 10 | and option -msse4.2 and your CPU supports 11 | sse 4.2, then a single instruction is used for the 12 | popcount method (bitmagic::b1Cnt). 13 | 14 | 2011-11-14: Added the template parameter "BitVector" to wt_huff and wt_rlmn. 15 | This may cause compile errors, when you compile code where you have 16 | specified template paramters for wt_huff and wt_rlmn. You should 17 | add the class bit_vector as first template parameter to wt_huff 18 | and wt_rlmn in this cases. 19 | 2011-11-13: Added the class rrr_vector. 20 | 21 | 2011-11-04: Added header cstddef in int_vector for ptrdiff_t 22 | 23 | 24 | From 9.0 to 9.1 25 | - accelerated BWT calculation 26 | - fixed a bug in the construction of int_wavelet_tree 27 | - added new lcp construction method (goPHI) 28 | 29 | From 0.8 to 9.0 30 | - added int_wavelet_tree 31 | - added semi-external construction of csts 32 | - added new lcp construction methods (go, go2) 33 | -------------------------------------------------------------------------------- /sdsl/test/CstHelper.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SDSL_TEST_CST_HELPER 2 | #define SDSL_TEST_CST_HELPER 3 | 4 | #include 5 | #include 6 | #include "gtest/gtest.h" 7 | 8 | template 9 | std::string format_node(const Cst& cst, const typename Cst::node_type& v) { 10 | std::stringstream ss; 11 | ss << cst.depth(v) << "-["< 16 | void check_node_method(const tCst& cst) { 17 | typedef typename tCst::const_iterator const_iterator; 18 | typedef typename tCst::node_type node_type; 19 | typedef typename tCst::size_type size_type; 20 | for (const_iterator it = cst.begin(), end = cst.end(); it != end; ++it) { 21 | if (it.visit() == 1) { 22 | node_type v = *it; 23 | size_type d = cst.depth(v); 24 | size_type lb = cst.lb(v), rb = cst.rb(v); 25 | ASSERT_EQ(v, cst.node(lb, rb, d)); 26 | } 27 | } 28 | } 29 | 30 | template 31 | typename Cst::node_type naive_lca(const Cst& cst, typename Cst::node_type v, typename Cst::node_type w, bool output=false) { 32 | typedef typename Cst::size_type size_type; 33 | size_type steps = 0; 34 | while (v != w and steps < cst.csa.size()) { 35 | if (cst.depth(v) > cst.depth(w)) { 36 | v = cst.parent(v); 37 | if (output) { 38 | std::cout << "v="<> ${result_file} 30 | done 31 | done 32 | done 33 | 34 | for i in `seq 1 ${repetitions}`; do 35 | for pattern_len in 4 10 20 40 100; do 36 | for occ in "1 1" "8 12" "75 125" "750 1250" "7500 12500"; do 37 | min_occ=${occ% *} 38 | max_occ=${occ#* } 39 | echo "pattern_len=${pattern_len} min_occ=${min_occ} max_occ=${max_occ}" 40 | pattern_file=${output_dir}/${file_basename}.${pattern_len}.${pattern_number}.0.${min_occ}.${max_occ}.pattern 41 | echo "${pattern_file}" 42 | ${bin_dir}/rosa_sd2_delta --input_file=${file} --threshold=${threshold} --output_dir=${output_dir} \ 43 | --benchmark_loc --pattern_file=${pattern_file} --fac_dens=${fac_dens} >> ${loc_result_file} 44 | done 45 | done 46 | done 47 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/CMakeModules/AppendCompilerFlags.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCSourceCompiles) 2 | include(CheckCXXSourceCompiles) 3 | 4 | macro(append_c_compiler_flags _flags _name _result) 5 | set(SAFE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) 6 | string(REGEX REPLACE "[-+/ ]" "_" cname "${_name}") 7 | string(TOUPPER "${cname}" cname) 8 | foreach(flag ${_flags}) 9 | string(REGEX REPLACE "^[-+/ ]+(.*)[-+/ ]*$" "\\1" flagname "${flag}") 10 | string(REGEX REPLACE "[-+/ ]" "_" flagname "${flagname}") 11 | string(TOUPPER "${flagname}" flagname) 12 | set(have_flag "HAVE_${cname}_${flagname}") 13 | set(CMAKE_REQUIRED_FLAGS "${flag}") 14 | check_c_source_compiles("int main() { return 0; }" ${have_flag}) 15 | if(${have_flag}) 16 | set(${_result} "${${_result}} ${flag}") 17 | endif(${have_flag}) 18 | endforeach(flag) 19 | set(CMAKE_REQUIRED_FLAGS ${SAFE_CMAKE_REQUIRED_FLAGS}) 20 | endmacro(append_c_compiler_flags) 21 | 22 | macro(append_cxx_compiler_flags _flags _name _result) 23 | set(SAFE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) 24 | string(REGEX REPLACE "[-+/ ]" "_" cname "${_name}") 25 | string(TOUPPER "${cname}" cname) 26 | foreach(flag ${_flags}) 27 | string(REGEX REPLACE "^[-+/ ]+(.*)[-+/ ]*$" "\\1" flagname "${flag}") 28 | string(REGEX REPLACE "[-+/ ]" "_" flagname "${flagname}") 29 | string(TOUPPER "${flagname}" flagname) 30 | set(have_flag "HAVE_${cname}_${flagname}") 31 | set(CMAKE_REQUIRED_FLAGS "${flag}") 32 | check_cxx_source_compiles("int main() { return 0; }" ${have_flag}) 33 | if(${have_flag}) 34 | set(${_result} "${${_result}} ${flag}") 35 | endif(${have_flag}) 36 | endforeach(flag) 37 | set(CMAKE_REQUIRED_FLAGS ${SAFE_CMAKE_REQUIRED_FLAGS}) 38 | endmacro(append_cxx_compiler_flags) 39 | -------------------------------------------------------------------------------- /sdsl/examples/louds_tree.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | using namespace sdsl; 9 | 10 | template 11 | void print_tree(const tTree& tree, const tNode& v, int depth, bit_vector& visited) 12 | { 13 | typedef typename tTree::size_type size_type; 14 | if (tree.nodes() < 60) { 15 | for (int i=0; i >(argv[1]); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/CMakeModules/ProjectCPack.cmake: -------------------------------------------------------------------------------- 1 | # If the cmake version includes cpack, use it 2 | IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") 3 | SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}") 4 | SET(CPACK_PACKAGE_VENDOR "${PROJECT_VENDOR}") 5 | SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") 6 | SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") 7 | SET(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") 8 | SET(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") 9 | SET(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") 10 | # SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME} ${PROJECT_VERSION}") 11 | SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_FULL}") 12 | 13 | IF(NOT DEFINED CPACK_SYSTEM_NAME) 14 | SET(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") 15 | ENDIF(NOT DEFINED CPACK_SYSTEM_NAME) 16 | 17 | IF(${CPACK_SYSTEM_NAME} MATCHES Windows) 18 | IF(CMAKE_CL_64) 19 | SET(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR}) 20 | ELSE(CMAKE_CL_64) 21 | SET(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR}) 22 | ENDIF(CMAKE_CL_64) 23 | ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows) 24 | 25 | IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) 26 | SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") 27 | ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) 28 | 29 | SET(CPACK_PACKAGE_CONTACT "${PROJECT_CONTACT}") 30 | IF(UNIX) 31 | SET(CPACK_STRIP_FILES "") 32 | SET(CPACK_SOURCE_STRIP_FILES "") 33 | # SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") 34 | ENDIF(UNIX) 35 | SET(CPACK_SOURCE_IGNORE_FILES "/CVS/" "/build/" "/\\\\.build/" "/\\\\.svn/" "~$") 36 | # include CPack model once all variables are set 37 | INCLUDE(CPack) 38 | ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") 39 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/bwt_construct.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2010 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file bwt_construct.hpp 18 | \brief bwt_construct.hpp contains a space and time efficient construction method for the Burrows and Wheeler Transform (BWT). 19 | \author Simon Gog 20 | */ 21 | #ifndef INCLUDED_SDSL_BWT_CONSTRUCT 22 | #define INCLUDED_SDSL_BWT_CONSTRUCT 23 | 24 | #include "typedefs.hpp" 25 | #include "int_vector.hpp" 26 | #include "util.hpp" 27 | #include "testutils.hpp" 28 | #include "config.hpp" // for cache_config 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | namespace sdsl 36 | { 37 | 38 | /*! Constructs the Burrows and Wheeler Transform (BWT) from text and suffix array store on disk 39 | * \param bwt Will contain the resulting BWT after the call of the method. 40 | * \param config Config object for location of suffix array and text on disk. 41 | * \par Space complexity: 42 | * \f$n\f$ bytes 43 | */ 44 | void construct_bwt(int_vector<8>& bwt, const cache_config& conf); 45 | 46 | void construct_int_bwt(int_vector<> &bwt, const cache_config& conf); 47 | 48 | }// end namespace 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | std::cout << "Running main() from gtest_main.cc\n"; 36 | 37 | testing::InitGoogleTest(&argc, argv); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/fused-src/gtest/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 | std::cout << "Running main() from gtest_main.cc\n"; 36 | 37 | testing::InitGoogleTest(&argc, argv); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/include/lfs.h.cmake: -------------------------------------------------------------------------------- 1 | /* 2 | * lfs.h for libdivsufsort 3 | * Copyright (c) 2003-2008 Yuta Mori All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, 9 | * copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following 12 | * conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | * OTHER DEALINGS IN THE SOFTWARE. 25 | */ 26 | 27 | #ifndef _LFS_H 28 | #define _LFS_H 1 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif /* __cplusplus */ 33 | 34 | #ifndef __STRICT_ANSI__ 35 | # define LFS_OFF_T @LFS_OFF_T@ 36 | # define LFS_FOPEN @LFS_FOPEN@ 37 | # define LFS_FTELL @LFS_FTELL@ 38 | # define LFS_FSEEK @LFS_FSEEK@ 39 | # define LFS_PRId @LFS_PRID@ 40 | #else 41 | # define LFS_OFF_T long 42 | # define LFS_FOPEN fopen 43 | # define LFS_FTELL ftell 44 | # define LFS_FSEEK fseek 45 | # define LFS_PRId "ld" 46 | #endif 47 | #ifndef PRIdOFF_T 48 | # define PRIdOFF_T LFS_PRId 49 | #endif 50 | 51 | 52 | #ifdef __cplusplus 53 | } /* extern "C" */ 54 | #endif /* __cplusplus */ 55 | 56 | #endif /* _LFS_H */ 57 | -------------------------------------------------------------------------------- /src/rosa_helping_structures.cpp: -------------------------------------------------------------------------------- 1 | #include "rosa_helping_structures.hpp" 2 | 3 | block_info::block_info(size_type bwd_lb, size_type depth, size_type fwd_lb, size_type size): 4 | bwd_lb(bwd_lb), depth(depth), fwd_lb(fwd_lb), size(size){} 5 | 6 | bool block_info::operator<(const struct block_info &b)const{ 7 | if( bwd_lb != b.bwd_lb ) 8 | return bwd_lb < b.bwd_lb; 9 | else if(depth != b.depth) 10 | return depth < b.depth; 11 | else if(fwd_lb != b.fwd_lb) 12 | return fwd_lb < b.fwd_lb; 13 | else 14 | return size < b.size; 15 | } 16 | 17 | block_node::block_node(size_type delta_x, size_type delta_d, size_type dest_block, 18 | size_type bwd_id): delta_x(delta_x), delta_d(delta_d), 19 | dest_block(dest_block), bwd_id(bwd_id) {} 20 | 21 | bwd_block_info::bwd_block_info(size_type bwd_lb, size_type bwd_rb, size_type depth, size_type block_id): 22 | bwd_lb(bwd_lb), bwd_rb(bwd_rb), depth(depth), block_id(block_id){} 23 | 24 | bool bwd_block_info::operator<(const struct bwd_block_info &b)const{ 25 | if ( bwd_lb != b.bwd_lb ) 26 | return bwd_lb < b.bwd_lb; 27 | else if (depth != b.depth) 28 | return depth < b.depth; 29 | return block_id < b.block_id; 30 | } 31 | 32 | std::ostream& operator<<(std::ostream &out, const bwd_block_info &x){ 33 | out << "{" << x.bwd_lb << "," << x.bwd_rb << "," << x.depth << ","; 34 | out << x.block_id << "}" << std::endl; 35 | return out; 36 | } 37 | 38 | header_item::header_item(size_type bwd_id, size_type delta_x, size_type delta_d): 39 | bwd_id(bwd_id),delta_x(delta_x),delta_d(delta_d){} 40 | 41 | bool header_item::operator<(const struct header_item &it)const{ 42 | if ( bwd_id != it.bwd_id ) 43 | return bwd_id < it.bwd_id; 44 | else if ( delta_x != it.delta_x) 45 | return delta_x < it.delta_x; 46 | else 47 | return delta_d < it.delta_d; 48 | } 49 | 50 | 51 | std::ostream& operator<<(std::ostream &out, const header_item &x){ 52 | out << "{" << x.bwd_id << "," << x.delta_x << "," << x.delta_d << "}" << std::endl; 53 | return out; 54 | } 55 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/tikz.hpp: -------------------------------------------------------------------------------- 1 | //! Author: Simon Gog (simon.gog@unimelb.edu.au) 2 | 3 | #ifndef INCLUDED_SDSL_TIKZ 4 | #define INCLUDED_SDSL_TIKZ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using std::string; 12 | using std::ostream; 13 | using std::endl; 14 | 15 | namespace sdsl 16 | { 17 | 18 | void begin_tikzpicture(ostream& out, string options=""); 19 | void end_tikzpicture(ostream& out); 20 | void begin_tikzscope(ostream& out, string options=""); 21 | void end_tikzscope(ostream& out); 22 | void tikz_node(ostream& out, string content="", string at="0,0", string name="", string options=""); 23 | void tikz_coordinate(ostream& out, string at="0,0", string name="", string option=""); 24 | 25 | template 26 | void write_tikz_column_from_container(ostream& out, const T& vec, string name_prefix="i") 27 | { 28 | tikz_node(out, "", "0,0cm", name_prefix, "st_"+name_prefix); 29 | for (typename T::size_type i=0; i < vec.size(); ++i) { 30 | tikz_node(out, util::to_latex_string(vec[i]), name_prefix + "|- y" + util::to_string(i) , 31 | name_prefix+util::to_string(i), "st_elem_"+name_prefix); 32 | } 33 | } 34 | 35 | template 36 | void write_tikz_array(ostream& out, const tContainer& v, string array_name="", bool escape=false) 37 | { 38 | if (array_name != "") { 39 | out << "\\def\\" << array_name << "{%" << endl; 40 | } else { 41 | out << "{"; 42 | } 43 | for (typename tContainer::size_type i=0; i < v.size(); ++i) { 44 | if (i > 0) 45 | out << ","; 46 | string w = util::to_latex_string(v[i]); 47 | if (escape) { 48 | if (w.size() > 0 and w[0]=='\\') 49 | w = "\\noexpand"+w; 50 | out << "\"" << w << "\""; 51 | } else { 52 | out << w; 53 | } 54 | } 55 | out << "}"; 56 | if (array_name != "") { 57 | out << "%" << endl; 58 | } 59 | } 60 | 61 | void write_y_column(ostream& out, size_t n); 62 | 63 | } // end namespace 64 | #endif 65 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/build-aux/config.h.in: -------------------------------------------------------------------------------- 1 | /* build-aux/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_MEMORY_H 11 | 12 | /* Define if you have POSIX threads libraries and header files. */ 13 | #undef HAVE_PTHREAD 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_STDINT_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_STDLIB_H 20 | 21 | /* Define to 1 if you have the header file. */ 22 | #undef HAVE_STRINGS_H 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STRING_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_SYS_STAT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_SYS_TYPES_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_UNISTD_H 35 | 36 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 37 | */ 38 | #undef LT_OBJDIR 39 | 40 | /* Name of package */ 41 | #undef PACKAGE 42 | 43 | /* Define to the address where bug reports for this package should be sent. */ 44 | #undef PACKAGE_BUGREPORT 45 | 46 | /* Define to the full name of this package. */ 47 | #undef PACKAGE_NAME 48 | 49 | /* Define to the full name and version of this package. */ 50 | #undef PACKAGE_STRING 51 | 52 | /* Define to the one symbol short name of this package. */ 53 | #undef PACKAGE_TARNAME 54 | 55 | /* Define to the home page for this package. */ 56 | #undef PACKAGE_URL 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to necessary symbol if this constant uses a non-standard name on 62 | your system. */ 63 | #undef PTHREAD_CREATE_JOINABLE 64 | 65 | /* Define to 1 if you have the ANSI C header files. */ 66 | #undef STDC_HEADERS 67 | 68 | /* Version number of package */ 69 | #undef VERSION 70 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/lib/algorithms.cpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2008 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | #include "sdsl/algorithms.hpp" 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | typedef std::map tMSS; 24 | 25 | namespace sdsl 26 | { 27 | 28 | double algorithm::H_0(const unsigned char* c) 29 | { 30 | size_t n = strlen((const char*)c); 31 | if (n==0) 32 | return 0; 33 | size_t cnt[256] = {}; 34 | double res = 0; 35 | for (size_t i=0; i0) { 39 | res += (double)cnt[i]/(double)n * log2((double)n/(double)cnt[i]); 40 | // std::cerr<<"cnt["< 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 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/rmq_support.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2009 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file rmq_support.hpp 18 | \brief rmq_support.hpp contains different range minimum support data structures. 19 | \author Simon Gog 20 | */ 21 | #ifndef INCLUDED_SDSL_RMQ_SUPPORT 22 | #define INCLUDED_SDSL_RMQ_SUPPORT 23 | 24 | /** \defgroup rmq_group Range Minimum/Maximum Support (RMS) */ 25 | 26 | template // for range minimum queries 27 | struct min_max_trait { 28 | static inline bool strict_compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2) { 29 | return v1 < v2; 30 | } 31 | static inline bool compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2) { 32 | return v1 <= v2; 33 | } 34 | }; 35 | 36 | template // for range maximum queries 37 | struct min_max_trait { 38 | static inline bool strict_compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2) { 39 | return v1 > v2; 40 | } 41 | static inline bool compare(const typename RandomAccessContainer::value_type v1, const typename RandomAccessContainer::value_type v2) { 42 | return v1 >= v2; 43 | } 44 | }; 45 | 46 | #include "rmq_support_sparse_table.hpp" 47 | #include "rmq_succinct_sct.hpp" 48 | #include "rmq_succinct_sada.hpp" 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/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 | -------------------------------------------------------------------------------- /sdsl/libdivsufsort-2.0.1/ChangeLog.old: -------------------------------------------------------------------------------- 1 | Version 1.0.2 (2006-01-01): 2 | 3 | * Release 1.0.2 4 | 5 | Version 1.0.2b (2005-12-11): 6 | 7 | * lib/divsufsort.c (_construct_typeBstar): Completely rewrite. 8 | 9 | Version 1.0.2a (2005-12-04): 10 | 11 | * lib/substringsort.c: Completely rewrite. 12 | * lib/drsort.c: Completely rewrite. 13 | * lib/divsufsort.c (_sort_typeBstar): Fix some bugs. 14 | 15 | Version 1.0.1 (2005-11-08): 16 | 17 | * Release 1.0.1 18 | 19 | Version 1.0.1a (2005-11-06): 20 | 21 | * configure.ac: Add AM_ENABLE_STATIC, AM_DISABLE_SHARED and AC_LIBTOOL_WIN32_DLL 22 | 23 | * Makefile.am (EXTRA_DIST): Add ChangeLog.old. 24 | 25 | * lib/divsufsort.c (_construct_typeBstar): Fix. 26 | 27 | * AUTHORS: New file. 28 | * ChangeLog: New file. 29 | * ChangeLog.old: New file. 30 | * INSTALL: New file. 31 | * NEWS: New file. 32 | 33 | Version 1.0.0 (2005-10-31) 34 | * Introduced autoconf and automake. 35 | * Added new example programs. 36 | 37 | Version 0.2.1 (2005-08-27) 38 | * divsufsort.c: Kao's algorithm was replaced with Improved Two-Stage algorithm. 39 | * divsufsort.c: Reduced memory usage. 40 | * substringsort.c: Added mergesort for sorting large groups of suffixes. 41 | 42 | Version 0.1.6 (2005-06-10) 43 | * divsufsort.h: Renamed from libdivsufsort.h. (again...) 44 | * divsufsort.c: Renamed from libdivsufsort.c. (again...) 45 | * divsufsort.c: Reduced memory usage. 46 | * substringsort.c, substringsort.h, drsort.c, drsort.h: Modify. 47 | * mksary_mmap/makefile, mksary_mmap/mksary.c, 48 | mksary_mmap/mmap.c, mksary_mmap/mmap.h: Removed. 49 | 50 | Version 0.1.5 (2005-04-07) 51 | * libdivsufsort.c: ranksort and doublingsort were replaced with drsort. 52 | * def.h, drsort.c, drsort.h: New file. 53 | * doublingsort.c, doublingsort.h, ranksort.c, ranksort.h: Removed. 54 | 55 | Version 0.1.4 (2005-03-27) 56 | * mksary/mksary.c, mksary_mmap/mksary.c, suftest.c: Added error handling. 57 | 58 | Version 0.1.3 (2005-01-28) 59 | * mksary/makefile, mksary/mksary.c, mksary_mmap/makefile, 60 | mksary_mmap/mksary.c, mksary_mmap/mmap.c, mksary_mmap/mmap.h: New file. 61 | * libdivsufsort.c: Modify. 62 | 63 | Version 0.1.2 (2005-01-01) 64 | * suftest.c: New file. 65 | * libdivsufsort.c: Renamed from divsufsort.c. 66 | * libdivsufsort.h: Renamed from divsufsort.h. 67 | 68 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/samples/sample4.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_SAMPLE4_H_ 35 | #define GTEST_SAMPLES_SAMPLE4_H_ 36 | 37 | // A simple monotonic counter. 38 | class Counter { 39 | private: 40 | int counter_; 41 | 42 | public: 43 | // Creates a counter that starts at 0. 44 | Counter() : counter_(0) {} 45 | 46 | // Returns the current counter value, and increments it. 47 | int Increment(); 48 | 49 | // Prints the current counter value to STDOUT. 50 | void Print() const; 51 | }; 52 | 53 | #endif // GTEST_SAMPLES_SAMPLE4_H_ 54 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/test/gtest_help_test_.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: wan@google.com (Zhanyong Wan) 31 | 32 | // This program is meant to be run by gtest_help_test.py. Do not run 33 | // it directly. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | // When a help flag is specified, this program should skip the tests 38 | // and exit with 0; otherwise the following test will be executed, 39 | // causing this program to exit with a non-zero code. 40 | TEST(HelpFlagTest, ShouldNotBeRun) { 41 | ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified."; 42 | } 43 | 44 | #if GTEST_HAS_DEATH_TEST 45 | TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {} 46 | #endif 47 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/src/gtest-all.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: mheule@google.com (Markus Heule) 31 | // 32 | // Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build Google Test by compiling a single file. 35 | // This file serves this purpose. 36 | 37 | // This line ensures that gtest.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gtest/gtest.h" 40 | 41 | // The following lines pull in the real gtest *.cc files. 42 | #include "src/gtest.cc" 43 | #include "src/gtest-death-test.cc" 44 | #include "src/gtest-filepath.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/wt_coding_strategy.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2012 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file wt_coding_strategy.hpp 18 | \brief wt_coding_strategy.hpp contains policy classes for the realization of prefix-free codes in wavelet trees. 19 | \author Simon Gog 20 | */ 21 | 22 | #ifndef INCLUDED_WT_CODING_STRATEGY 23 | #define INCLUDED_WT_CODING_STRATEGY 24 | 25 | #include "int_vector.hpp" 26 | 27 | namespace sdsl{ 28 | 29 | //! Class for tree based Huffman solution on byte alphabets. 30 | class fat_huff_byte{ 31 | public: 32 | typedef bit_vector::size_type size_type; 33 | public: 34 | // Default constructor 35 | fat_huff_byte(); 36 | // Construct from byte stream 37 | template 38 | fat_huff_byte(int_vector_file_buffer<8>& text_buf); 39 | // The length of the code for symbol `c` 40 | uint8_t code_len(uint8_t c); 41 | // The code for symbol `c` 42 | uint64_t code(uint8_t c); 43 | // The symbol for a codeword `code` of length `len` 44 | uint8_t symbol(uint64_t code, uint8_t len); 45 | 46 | bool valid_code(uint64_t code, uint8_t len); 47 | 48 | size_type serialize(std::ostream& out, structure_tree_node* v=NULL, 49 | std::string name="")const; 50 | void load(std::istream &in); 51 | }; 52 | 53 | 54 | //! Class for canonical Huffman solution on byte alphabets. 55 | /* 56 | class canonical_huff_tree_byte{ 57 | private: 58 | int_vector<> freq_order; // decreasing order 59 | int_vector<> code_len; // 60 | 61 | public: 62 | 63 | inline uint64_t code_len(uint8_t c){ 64 | return code_len[c]; 65 | } 66 | 67 | } 68 | */ 69 | 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /query_performance/usb.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \begin{document} 4 | 5 | \newcommand{\D}[0]{\hphantom{0}} 6 | % latex table generated in R 2.15.2 by xtable 1.7-0 package 7 | % Wed Jan 9 10:01:02 2013 8 | input: web-4GB, disk: USB device 9 | 10 | \begin{table}[ht] 11 | \begin{center} 12 | \begin{tabular}{rllllll} 13 | \hline 14 | & & 1 & 10 & 100 & 1000 & 10000 \\ 15 | \hline 16 | \D\D4 & & 1.4 & 1.5 & 1.1 & 0.3 & 0 \\ 17 | \D10 & & 2 & 2 & 2 & 1.7 & 0 \\ 18 | \D20 & & 2 & 2 & 2 & 1.8 & 0 \\ 19 | \D40 & & 2 & 2 & 2 & 1.9 & 0 \\ 20 | 100 & & 2 & 2 & 2 & 1.9 & 0 \\ 21 | \hline 22 | \end{tabular} 23 | \caption{disk accesses for $b= 4096 $ $K= 1024 $} 24 | \end{center} 25 | \end{table} 26 | % latex table generated in R 2.15.2 by xtable 1.7-0 package 27 | % Wed Jan 9 10:01:02 2013 28 | \begin{table}[ht] 29 | \begin{center} 30 | \begin{tabular}{rllllll} 31 | \hline 32 | & & 1 & 10 & 100 & 1000 & 10000 \\ 33 | \hline 34 | \D\D4 & & \D8886 & \D9518 & \D7917 & \D2257 & \D\D\D\D6 \\ 35 | \D10 & & 14917 & 13539 & 14760 & 12801 & \D\D\D12 \\ 36 | \D20 & & 16084 & 13776 & 15326 & 15857 & \D\D\D21 \\ 37 | \D40 & & 24813 & 14208 & 16480 & 15862 & \D\D\D39 \\ 38 | 100 & & 17401 & 14909 & 17758 & 15836 & \D\D\D88 \\ 39 | \hline 40 | \end{tabular} 41 | \caption{elapsed time for $b= 4096 $ $K= 1024 $} 42 | \end{center} 43 | \end{table} 44 | % latex table generated in R 2.15.2 by xtable 1.7-0 package 45 | % Wed Jan 9 10:01:02 2013 46 | \begin{table}[ht] 47 | \begin{center} 48 | \begin{tabular}{rllllll} 49 | \hline 50 | & & 1 & 10 & 100 & 1000 & 10000 \\ 51 | \hline 52 | \D\D4 & & \D6969 & \D7301 & \D6141 & \D1602 & \D\D\D\D6 \\ 53 | \D10 & & 12695 & 10435 & 11270 & \D9461 & \D\D\D12 \\ 54 | \D20 & & 14009 & 10505 & 11842 & 12384 & \D\D\D21 \\ 55 | \D40 & & 23050 & 10841 & 13010 & 12460 & \D\D\D39 \\ 56 | 100 & & 15510 & 11683 & 14545 & 12939 & \D\D\D88 \\ 57 | \hline 58 | \end{tabular} 59 | \caption{user time for $b= 4096 $ $K= 1024 $} 60 | \end{center} 61 | \end{table} 62 | 63 | \end{document} 64 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/test/production.h: -------------------------------------------------------------------------------- 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 | #ifndef GTEST_TEST_PRODUCTION_H_ 35 | #define GTEST_TEST_PRODUCTION_H_ 36 | 37 | #include "gtest/gtest_prod.h" 38 | 39 | class PrivateCode { 40 | public: 41 | // Declares a friend test that does not use a fixture. 42 | FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers); 43 | 44 | // Declares a friend test that uses a fixture. 45 | FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers); 46 | 47 | PrivateCode(); 48 | 49 | int x() const { return x_; } 50 | private: 51 | void set_x(int an_x) { x_ = an_x; } 52 | int x_; 53 | }; 54 | 55 | #endif // GTEST_TEST_PRODUCTION_H_ 56 | -------------------------------------------------------------------------------- /sdsl/include/sdsl/select_support_dummy.hpp: -------------------------------------------------------------------------------- 1 | /* sdsl - succinct data structures library 2 | Copyright (C) 2011 Simon Gog 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see http://www.gnu.org/licenses/ . 16 | */ 17 | /*! \file select_support_dummy.hpp 18 | \brief select_support_dummy.hpp contains classes that support a sdsl::bit_vector with constant time select information. 19 | \author Simon Gog 20 | */ 21 | #ifndef INCLUDED_SDSL_SELECT_SUPPORT_DUMMY 22 | #define INCLUDED_SDSL_SELECT_SUPPORT_DUMMY 23 | 24 | #include "int_vector.hpp" 25 | #include "select_support.hpp" 26 | #include 27 | #include 28 | 29 | //#define SDSL_DEBUG_SELECT_SUPPORT_JMC 30 | 31 | #ifdef SDSL_DEBUG_SELECT_SUPPORT_DUMMY 32 | #include "testutils.hpp" 33 | #endif 34 | 35 | //! Namespace for the succinct data structure library. 36 | namespace sdsl 37 | { 38 | 39 | 40 | //! A dummy class for select 41 | /*! 42 | * @ingroup select_support_group 43 | */ 44 | class select_support_dummy : public select_support 45 | { 46 | public: 47 | select_support_dummy(const bit_vector* v=NULL); 48 | select_support_dummy(const select_support_dummy& ss); 49 | ~select_support_dummy(); 50 | //! Select function 51 | /*! \sa select_support.select 52 | */ 53 | inline const size_type select(size_type i) const; 54 | //! Alias for select(i). 55 | inline const size_type operator()(size_type i)const; 56 | size_type serialize(std::ostream& out, structure_tree_node* v=NULL, std::string name="")const; 57 | void load(std::istream& in, const bit_vector* v=NULL); 58 | void set_vector(const bit_vector* v=NULL); 59 | select_support_dummy& operator=(const select_support_dummy& ss); 60 | void swap(select_support_dummy& ss); 61 | }; 62 | 63 | 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/test/gtest_all_test.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: wan@google.com (Zhanyong Wan) 31 | // 32 | // Tests for Google C++ Testing Framework (Google Test) 33 | // 34 | // Sometimes it's desirable to build most of Google Test's own tests 35 | // by compiling a single file. This file serves this purpose. 36 | #include "test/gtest-filepath_test.cc" 37 | #include "test/gtest-linked_ptr_test.cc" 38 | #include "test/gtest-message_test.cc" 39 | #include "test/gtest-options_test.cc" 40 | #include "test/gtest-port_test.cc" 41 | #include "test/gtest_pred_impl_unittest.cc" 42 | #include "test/gtest_prod_test.cc" 43 | #include "test/gtest-test-part_test.cc" 44 | #include "test/gtest-typed-test_test.cc" 45 | #include "test/gtest-typed-test2_test.cc" 46 | #include "test/gtest_unittest.cc" 47 | #include "test/production.cc" 48 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/test/gtest_prod_test.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 | // Unit test for include/gtest/gtest_prod.h. 33 | 34 | #include "gtest/gtest.h" 35 | #include "test/production.h" 36 | 37 | // Tests that private members can be accessed from a TEST declared as 38 | // a friend of the class. 39 | TEST(PrivateCodeTest, CanAccessPrivateMembers) { 40 | PrivateCode a; 41 | EXPECT_EQ(0, a.x_); 42 | 43 | a.set_x(1); 44 | EXPECT_EQ(1, a.x_); 45 | } 46 | 47 | typedef testing::Test PrivateCodeFixtureTest; 48 | 49 | // Tests that private members can be accessed from a TEST_F declared 50 | // as a friend of the class. 51 | TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) { 52 | PrivateCode a; 53 | EXPECT_EQ(0, a.x_); 54 | 55 | a.set_x(2); 56 | EXPECT_EQ(2, a.x_); 57 | } 58 | -------------------------------------------------------------------------------- /sdsl/test/BitMagicTest.cpp: -------------------------------------------------------------------------------- 1 | #include "sdsl/int_vector.hpp" 2 | #include "sdsl/bitmagic.hpp" 3 | #include "sdsl/util.hpp" 4 | #include "gtest/gtest.h" 5 | #include 6 | #include // for rand() 7 | #include 8 | 9 | namespace 10 | { 11 | 12 | typedef sdsl::int_vector<>::size_type size_type; 13 | 14 | // The fixture for testing class int_vector. 15 | class BitMagicTest : public ::testing::Test 16 | { 17 | protected: 18 | 19 | BitMagicTest() { 20 | // You can do set-up work for each test here. 21 | } 22 | 23 | virtual ~BitMagicTest() { 24 | // You can do clean-up work that doesn't throw exceptions here. 25 | } 26 | 27 | // If the constructor and destructor are not enough for setting up 28 | // and cleaning up each test, you can define the following methods: 29 | virtual void SetUp() { 30 | // Code here will be called immediately after the constructor (right 31 | // before each test). 32 | } 33 | 34 | virtual void TearDown() { 35 | // Code here will be called immediately after each test (right 36 | // before the destructor). 37 | } 38 | 39 | // Objects declared here can be used by all tests in the test case for Foo. 40 | }; 41 | 42 | //! Test the default constructor 43 | TEST_F(BitMagicTest, Rank) 44 | { 45 | for (size_type i=0; i<64; ++i) { 46 | ASSERT_EQ(sdsl::bit_magic::b1Cnt(1ULL<> j)&1) { 62 | ++ones; 63 | ASSERT_EQ(sdsl::bit_magic::i1BP(x, ones), j); 64 | ASSERT_EQ(sdsl::bit_magic::j1BP(x, ones), j); 65 | ASSERT_EQ(sdsl::bit_magic::k1BP(x, ones), j); 66 | } 67 | } 68 | } 69 | } 70 | 71 | 72 | } // namespace 73 | 74 | int main(int argc, char** argv) 75 | { 76 | ::testing::InitGoogleTest(&argc, argv); 77 | return RUN_ALL_TESTS(); 78 | } 79 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/test/gtest_sole_header_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: mheule@google.com (Markus Heule) 31 | // 32 | // This test verifies that it's possible to use Google Test by including 33 | // the gtest.h header file alone. 34 | 35 | #include "gtest/gtest.h" 36 | 37 | namespace { 38 | 39 | void Subroutine() { 40 | EXPECT_EQ(42, 42); 41 | } 42 | 43 | TEST(NoFatalFailureTest, ExpectNoFatalFailure) { 44 | EXPECT_NO_FATAL_FAILURE(;); 45 | EXPECT_NO_FATAL_FAILURE(SUCCEED()); 46 | EXPECT_NO_FATAL_FAILURE(Subroutine()); 47 | EXPECT_NO_FATAL_FAILURE({ SUCCEED(); }); 48 | } 49 | 50 | TEST(NoFatalFailureTest, AssertNoFatalFailure) { 51 | ASSERT_NO_FATAL_FAILURE(;); 52 | ASSERT_NO_FATAL_FAILURE(SUCCEED()); 53 | ASSERT_NO_FATAL_FAILURE(Subroutine()); 54 | ASSERT_NO_FATAL_FAILURE({ SUCCEED(); }); 55 | } 56 | 57 | } // namespace 58 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/samples/sample2.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 "sample2.h" 35 | 36 | #include 37 | 38 | // Clones a 0-terminated C string, allocating memory using new. 39 | const char* MyString::CloneCString(const char* a_c_string) { 40 | if (a_c_string == NULL) return NULL; 41 | 42 | const size_t len = strlen(a_c_string); 43 | char* const clone = new char[ len + 1 ]; 44 | memcpy(clone, a_c_string, len + 1); 45 | 46 | return clone; 47 | } 48 | 49 | // Sets the 0-terminated C string this MyString object 50 | // represents. 51 | void MyString::Set(const char* a_c_string) { 52 | // Makes sure this works when c_string == c_string_ 53 | const char* const temp = MyString::CloneCString(a_c_string); 54 | delete[] c_string_; 55 | c_string_ = temp; 56 | } 57 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/xcode/Samples/FrameworkSample/widget.h: -------------------------------------------------------------------------------- 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: preston.a.jackson@gmail.com (Preston Jackson) 31 | // 32 | // Google Test - FrameworkSample 33 | // widget.h 34 | // 35 | 36 | // Widget is a very simple class used for demonstrating the use of gtest. It 37 | // simply stores two values a string and an integer, which are returned via 38 | // public accessors in multiple forms. 39 | 40 | #import 41 | 42 | class Widget { 43 | public: 44 | Widget(int number, const std::string& name); 45 | ~Widget(); 46 | 47 | // Public accessors to number data 48 | float GetFloatValue() const; 49 | int GetIntValue() const; 50 | 51 | // Public accessors to the string data 52 | std::string GetStringValue() const; 53 | void GetCharPtrValue(char* buffer, size_t max_size) const; 54 | 55 | private: 56 | // Data members 57 | float number_; 58 | std::string name_; 59 | }; 60 | -------------------------------------------------------------------------------- /sdsl/gtest-1.6.0/include/gtest/gtest_prod.h: -------------------------------------------------------------------------------- 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 | // Google C++ Testing Framework definitions useful in production code. 33 | 34 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 35 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 36 | 37 | // When you need to test the private or protected members of a class, 38 | // use the FRIEND_TEST macro to declare your tests as friends of the 39 | // class. For example: 40 | // 41 | // class MyClass { 42 | // private: 43 | // void MyMethod(); 44 | // FRIEND_TEST(MyClassTest, MyMethod); 45 | // }; 46 | // 47 | // class MyClassTest : public testing::Test { 48 | // // ... 49 | // }; 50 | // 51 | // TEST_F(MyClassTest, MyMethod) { 52 | // // Can call MyClass::MyMethod() here. 53 | // } 54 | 55 | #define FRIEND_TEST(test_case_name, test_name)\ 56 | friend class test_case_name##_##test_name##_Test 57 | 58 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 59 | --------------------------------------------------------------------------------