-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
13,601 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
g++ -fpermissive -O9 -msse4.2 -std=c++11 -DNODEBUG -I ~/include -L ~/lib src/nfa/src/bitmasks.c src/nfa/src/options.c src/nfa/src/parser.c src/nfa/src/regular.c src/build-index.cpp -o build-index -lsdsl -ldivsufsort -ldivsufsort64 | ||
|
||
g++ -fpermissive -Ofast -msse4.2 -frename-registers -std=c++11 -DNODEBUG -I ~/include -L ~/lib src/nfa/src/bitmasks.c src/nfa/src/options.c src/nfa/src/parser.c src/nfa/src/regular.c src/query-index.cpp -o query-index -lsdsl -ldivsufsort -ldivsufsort64 | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Config.hpp | ||
* Copyright (C) 2020 Author removed for double-blind evaluation | ||
* | ||
* This is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef CONFIG_BWT | ||
#define CONFIG_BWT | ||
|
||
#include <set> | ||
#include <map> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
#include <sdsl/suffix_arrays.hpp> | ||
#include <sdsl/vectors.hpp> | ||
#include <sdsl/bit_vectors.hpp> | ||
#include <sdsl/wavelet_trees.hpp> | ||
#include <sdsl/wt_algorithm.hpp> | ||
#include <sdsl/init_array.hpp> | ||
|
||
using namespace sdsl; | ||
using namespace std; | ||
|
||
typedef std::tuple<uint32_t, uint32_t, uint32_t> spo_triple; | ||
//typedef sdsl::wm_int<bit_vector, rank_support_v<>, select_support_mcl<>, select_support_mcl<>> bwt_type; | ||
typedef sdsl::wm_int<bit_vector> bwt_type; | ||
|
||
typedef sdsl::bit_vector C_type; | ||
typedef sdsl::rank_support_v<> C_rank_type; | ||
typedef sdsl::select_support_mcl<> C_select_type; | ||
typedef sdsl::select_support_mcl<0> C_select0_type; | ||
|
||
#endif |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include <iostream> | ||
#include "triple_bwt.hpp" | ||
#include <fstream> | ||
#include <sdsl/construct.hpp> | ||
|
||
using namespace std; | ||
|
||
using namespace std::chrono; | ||
using timer = std::chrono::high_resolution_clock; | ||
|
||
|
||
int main(int argc, char **argv) | ||
{ | ||
|
||
vector<spo_triple> D, E; | ||
|
||
std::ifstream ifs(argv[1]); | ||
uint64_t s, p , o; | ||
//set<spo_triple> S; | ||
do { | ||
ifs >> s >> p >> o; | ||
//S.insert(spo_triple(s, p, o)); | ||
D.push_back(spo_triple(s, p, o)); | ||
} while (!ifs.eof()); | ||
|
||
//for (set<spo_triple>::iterator it=S.begin(); it!=S.end(); it++) | ||
// D.push_back(*it); | ||
|
||
//S.clear(); | ||
|
||
if (D[D.size()-1] == D[D.size()-2]) | ||
D.pop_back(); | ||
|
||
D.shrink_to_fit(); | ||
|
||
uint64_t input_size = D.size(); | ||
|
||
cout << "--Indexing " << D.size() << " triples" << endl; | ||
memory_monitor::start(); | ||
auto start = timer::now(); | ||
|
||
ring_rpq A(D); | ||
auto stop = timer::now(); | ||
memory_monitor::stop(); | ||
cout << " Index built " << (float)A.size()/input_size << " bytes per triple" << endl; | ||
|
||
A.save(string(argv[1])); | ||
cout << "Index saved" << endl; | ||
cout << duration_cast<seconds>(stop-start).count() << " seconds." << endl; | ||
// cout << memory_monitor::peak() << " bytes." << endl; | ||
return 0; | ||
} | ||
|
Oops, something went wrong.