4 #include <boost/shared_ptr.hpp>
5 #include <boost/foreach.hpp>
10 #include "concordia/common/config.hpp"
11 #include "concordia/concordia_exception.hpp"
12 #include "concordia/interval.hpp"
13 #include "concordia/matched_pattern_fragment.hpp"
14 #include <divsufsort.h>
38 INDEX_CHARACTER_TYPE character);
47 SUFFIX_MARKER_TYPE marker);
63 static SUFFIX_MARKER_TYPE
readMarker(std::ifstream & file);
70 const std::vector<INDEX_CHARACTER_TYPE> & input);
77 const std::vector<INDEX_CHARACTER_TYPE> & input);
84 boost::shared_ptr<std::vector<sauchar_t> > vector,
85 INDEX_CHARACTER_TYPE character);
92 std::vector<sauchar_t> & vector,
93 INDEX_CHARACTER_TYPE character);
99 static void printVector(
const std::vector<T> & vector);
125 static SUFFIX_MARKER_TYPE
createMarker(SUFFIX_MARKER_TYPE
id,
126 SUFFIX_MARKER_TYPE offset,
127 SUFFIX_MARKER_TYPE length);
136 const std::vector<Interval> & intervalList,
137 SUFFIX_MARKER_TYPE sentenceSize,
147 const std::vector<MatchedPatternFragment> & fragmentList,
148 SUFFIX_MARKER_TYPE patternSize,
156 static void _insertCharToSaucharArray(sauchar_t * array,
157 INDEX_CHARACTER_TYPE character,
int pos);
162 template <
typename T>
164 for (
int i = 0; i < vector.size(); i++) {
165 std::cout << static_cast<int>(vector.at(i)) <<
" ";
167 std::cout << std::endl;
static SUFFIX_MARKER_TYPE getLengthFromMarker(SUFFIX_MARKER_TYPE marker)
Definition: utils.cpp:96
static sauchar_t * indexVectorToSaucharArray(const std::vector< INDEX_CHARACTER_TYPE > &input)
Definition: utils.cpp:32
static SUFFIX_MARKER_TYPE readMarker(std::ifstream &file)
Definition: utils.cpp:26
virtual ~Utils()
Definition: utils.cpp:7
static void printVector(const std::vector< T > &vector)
Definition: utils.hpp:163
Utils()
Definition: utils.cpp:4
static SUFFIX_MARKER_TYPE getIdFromMarker(SUFFIX_MARKER_TYPE marker)
Definition: utils.cpp:83
static INDEX_CHARACTER_TYPE readIndexCharacter(std::ifstream &file)
Definition: utils.cpp:20
static SUFFIX_MARKER_TYPE getOffsetFromMarker(SUFFIX_MARKER_TYPE marker)
Definition: utils.cpp:88
static SUFFIX_MARKER_TYPE maxSentenceSize
Definition: utils.hpp:153
static double getLogarithmicOverlay(const std::vector< Interval > &intervalList, SUFFIX_MARKER_TYPE sentenceSize, double k)
Definition: utils.cpp:117
static SUFFIX_MARKER_TYPE createMarker(SUFFIX_MARKER_TYPE id, SUFFIX_MARKER_TYPE offset, SUFFIX_MARKER_TYPE length)
Definition: utils.cpp:104
static void writeMarker(std::ofstream &file, SUFFIX_MARKER_TYPE marker)
Definition: utils.cpp:15
static void appendCharToSaucharVector(boost::shared_ptr< std::vector< sauchar_t > > vector, INDEX_CHARACTER_TYPE character)
Definition: utils.cpp:66
static std::vector< sauchar_t > indexVectorToSaucharVector(const std::vector< INDEX_CHARACTER_TYPE > &input)
Definition: utils.cpp:46
static void writeIndexCharacter(std::ofstream &file, INDEX_CHARACTER_TYPE character)
Definition: utils.cpp:10