SDSL
3.0.0
Succinct Data Structure Library
config.hpp
Go to the documentation of this file.
1
// Copyright (c) 2016, the SDSL Project Authors. All rights reserved.
2
// Please see the AUTHORS file for details. Use of this source code is governed
3
// by a BSD license that can be found in the LICENSE file.
4
#ifndef SDSL_CONFIG
5
#define SDSL_CONFIG
6
7
#include <map>
8
#include <string>
9
10
#include <
sdsl/uintx_t.hpp
>
11
12
#ifndef MSVC_COMPILER
13
#define SDSL_UNUSED __attribute__((unused))
14
#else
15
#define SDSL_UNUSED
16
#endif
17
18
namespace
sdsl
19
{
20
21
// forward declarations
22
namespace
util
23
{
24
template
<
typename
T>
25
std::string
to_string
(
const
T & t,
int
w = 1);
26
uint64_t
pid
();
27
uint64_t
id
();
28
}
// namespace util
29
30
namespace
conf
// namespace for library constant
31
{
32
// size of the buffer for reading and writing data in elements (not in bytes)
33
const
uint64_t
SDSL_BLOCK_SIZE
= (uint64_t)1 << 22;
34
35
constexpr
char
KEY_BWT
[] =
"bwt"
;
36
constexpr
char
KEY_BWT_INT
[] =
"bwt_int"
;
37
constexpr
char
KEY_SA
[] =
"sa"
;
38
constexpr
char
KEY_CSA
[] =
"csa"
;
39
constexpr
char
KEY_CST
[] =
"cst"
;
40
constexpr
char
KEY_ISA
[] =
"isa"
;
41
constexpr
char
KEY_TEXT
[] =
"text"
;
42
constexpr
char
KEY_TEXT_INT
[] =
"text_int"
;
43
constexpr
char
KEY_PSI
[] =
"psi"
;
44
constexpr
char
KEY_LCP
[] =
"lcp"
;
45
constexpr
char
KEY_SAMPLE_CHAR
[] =
"sample_char"
;
46
}
// namespace conf
47
48
typedef
uint64_t
int_vector_size_type
;
49
50
typedef
std::map<std::string, std::string>
tMSS
;
51
52
enum
format_type
53
{
54
JSON_FORMAT
,
55
R_FORMAT
,
56
HTML_FORMAT
57
};
58
59
enum
byte_sa_algo_type
60
{
61
LIBDIVSUFSORT
,
62
SE_SAIS
63
};
64
66
struct
cache_config
67
{
68
bool
delete_files
;
// Flag which indicates if all files which were created
69
bool
delete_data
;
// Flag which indicates if the original data can be deleted
70
// during construction should be deleted.
71
std::string
dir
;
// Directory for temporary files.
72
std::string
id
;
// Identifier is part of temporary file names. If
73
// id is the empty string, then it will be replace
74
// a concatenation of PID and a unique ID inside the
75
// current process.
76
tMSS
file_map
;
// Files stored during the construction process.
77
cache_config
(
bool
f_delete_files =
true
, std::string f_dir =
"./"
, std::string f_id =
""
,
tMSS
f_file_map =
tMSS
())
78
:
delete_files
(f_delete_files)
79
,
delete_data
(false)
80
,
dir
(f_dir)
81
,
id
(f_id)
82
,
file_map
(f_file_map)
83
{
84
if
(
""
==
id
) {
id
=
sdsl::util::to_string
(
sdsl::util::pid
()) +
"_"
+
sdsl::util::to_string
(
sdsl::util::id
()); }
85
}
86
};
87
89
template
<u
int
8_t w
id
th,
typename
T =
void
>
90
struct
key_text_trait_impl
91
{
92
static
const
char
*
KEY_TEXT
;
93
};
94
95
template
<
typename
T>
96
struct
key_text_trait_impl
<0, T>
97
{
98
static
const
char
*
KEY_TEXT
;
99
};
100
101
template
<
typename
T>
102
struct
key_text_trait_impl
<8, T>
103
{
104
static
const
char
*
KEY_TEXT
;
105
};
106
108
template
<u
int
8_t w
id
th,
typename
T =
void
>
109
struct
key_bwt_trait_impl
110
{
111
static
const
char
*
KEY_BWT
;
112
};
113
114
template
<
typename
T>
115
struct
key_bwt_trait_impl
<0, T>
116
{
117
static
const
char
*
KEY_BWT
;
118
};
119
120
template
<
typename
T>
121
struct
key_bwt_trait_impl
<8, T>
122
{
123
static
const
char
*
KEY_BWT
;
124
};
125
126
template
<
typename
T>
127
const
char
*
key_text_trait_impl<0, T>::KEY_TEXT
=
conf::KEY_TEXT_INT
;
128
129
template
<
typename
T>
130
const
char
*
key_text_trait_impl<8, T>::KEY_TEXT
=
conf::KEY_TEXT
;
131
132
template
<
typename
T>
133
const
char
*
key_bwt_trait_impl<0, T>::KEY_BWT
=
conf::KEY_BWT_INT
;
134
135
template
<
typename
T>
136
const
char
*
key_bwt_trait_impl<8, T>::KEY_BWT
=
conf::KEY_BWT
;
137
138
template
<u
int
8_t w
id
th>
139
using
key_text_trait
=
key_text_trait_impl<width, void>
;
140
141
template
<u
int
8_t w
id
th>
142
using
key_bwt_trait
=
key_bwt_trait_impl<width, void>
;
143
144
}
// namespace sdsl
145
146
#endif
sdsl::conf::KEY_CSA
constexpr char KEY_CSA[]
Definition:
config.hpp:38
sdsl::conf::KEY_SAMPLE_CHAR
constexpr char KEY_SAMPLE_CHAR[]
Definition:
config.hpp:45
sdsl::conf::KEY_SA
constexpr char KEY_SA[]
Definition:
config.hpp:37
sdsl::conf::KEY_CST
constexpr char KEY_CST[]
Definition:
config.hpp:39
sdsl::conf::SDSL_BLOCK_SIZE
const uint64_t SDSL_BLOCK_SIZE
Definition:
config.hpp:33
sdsl::conf::KEY_BWT_INT
constexpr char KEY_BWT_INT[]
Definition:
config.hpp:36
sdsl::conf::KEY_TEXT
constexpr char KEY_TEXT[]
Definition:
config.hpp:41
sdsl::conf::KEY_LCP
constexpr char KEY_LCP[]
Definition:
config.hpp:44
sdsl::conf::KEY_TEXT_INT
constexpr char KEY_TEXT_INT[]
Definition:
config.hpp:42
sdsl::conf::KEY_PSI
constexpr char KEY_PSI[]
Definition:
config.hpp:43
sdsl::conf::KEY_ISA
constexpr char KEY_ISA[]
Definition:
config.hpp:40
sdsl::conf::KEY_BWT
constexpr char KEY_BWT[]
Definition:
config.hpp:35
sdsl::util::id
uint64_t id()
sdsl::util::pid
uint64_t pid()
sdsl::util::to_string
std::string to_string(const T &t, int w=1)
sdsl
Namespace for the succinct data structure library.
Definition:
bit_vector_il.hpp:20
sdsl::tMSS
std::map< std::string, std::string > tMSS
Definition:
config.hpp:50
sdsl::byte_sa_algo_type
byte_sa_algo_type
Definition:
config.hpp:60
sdsl::LIBDIVSUFSORT
@ LIBDIVSUFSORT
Definition:
config.hpp:61
sdsl::SE_SAIS
@ SE_SAIS
Definition:
config.hpp:62
sdsl::int_vector_size_type
uint64_t int_vector_size_type
Definition:
config.hpp:48
sdsl::format_type
format_type
Definition:
config.hpp:53
sdsl::JSON_FORMAT
@ JSON_FORMAT
Definition:
config.hpp:54
sdsl::R_FORMAT
@ R_FORMAT
Definition:
config.hpp:55
sdsl::HTML_FORMAT
@ HTML_FORMAT
Definition:
config.hpp:56
sdsl::cache_config
Helper class for construction process.
Definition:
config.hpp:67
sdsl::cache_config::cache_config
cache_config(bool f_delete_files=true, std::string f_dir="./", std::string f_id="", tMSS f_file_map=tMSS())
Definition:
config.hpp:77
sdsl::cache_config::file_map
tMSS file_map
Definition:
config.hpp:76
sdsl::cache_config::delete_files
bool delete_files
Definition:
config.hpp:68
sdsl::cache_config::id
std::string id
Definition:
config.hpp:72
sdsl::cache_config::dir
std::string dir
Definition:
config.hpp:71
sdsl::cache_config::delete_data
bool delete_data
Definition:
config.hpp:69
sdsl::key_bwt_trait_impl< 0, T >::KEY_BWT
static const char * KEY_BWT
Definition:
config.hpp:117
sdsl::key_bwt_trait_impl< 8, T >::KEY_BWT
static const char * KEY_BWT
Definition:
config.hpp:123
sdsl::key_bwt_trait_impl
Helper classes to transform width=0 and width=8 to corresponding bwt key.
Definition:
config.hpp:110
sdsl::key_bwt_trait_impl::KEY_BWT
static const char * KEY_BWT
Definition:
config.hpp:111
sdsl::key_text_trait_impl< 0, T >::KEY_TEXT
static const char * KEY_TEXT
Definition:
config.hpp:98
sdsl::key_text_trait_impl< 8, T >::KEY_TEXT
static const char * KEY_TEXT
Definition:
config.hpp:104
sdsl::key_text_trait_impl
Helper classes to transform width=0 and width=8 to corresponding text key.
Definition:
config.hpp:91
sdsl::key_text_trait_impl::KEY_TEXT
static const char * KEY_TEXT
Definition:
config.hpp:92
uintx_t.hpp
include
sdsl
config.hpp
Generated by
1.9.1