sdsl库编译安装和使用

1. 下载和编译

git clone https://github.com/simongog/sdsl-lite.git
cd sdsl-lite

# 建一个conda环境 激活环境,安装cmake。
./install.sh /usr/local/

2. 示例代码

#include <sdsl/suffix_arrays.hpp>
#include <fstream>

using namespace sdsl;

int main() {
    csa_wt<> fm_index;
    construct_im(fm_index, "mississippi!", 1);
    std::cout << "'si' occurs " << count(fm_index,"si") << " times.\n";
    store_to_file(fm_index,"fm_index-file.sdsl");
    std::ofstream out("fm_index-file.sdsl.html");
    write_structure<HTML_FORMAT>(fm_index,out);
}

3. xcode编译链接库添加

参考:

https://github.com/simongog/sdsl-lite

上一篇:每日五道java面试题之mybatis篇(三)


下一篇:排序算法之插入排序算法介绍