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