anubis search suspended

Former-commit-id: 1e73eb108ea6961bb8306aed3c0bbaf9127f3c69
This commit is contained in:
rjawor 2014-06-24 18:33:02 +02:00
parent 8f953883bf
commit 2a3c7eddfe
3 changed files with 22 additions and 29 deletions

View File

@ -28,33 +28,28 @@ boost::ptr_vector<AnubisSearchResult> AnubisSearcher::anubisSearch(
boost::shared_ptr<std::vector<sauchar_t> > patternVector = boost::shared_ptr<std::vector<sauchar_t> > patternVector =
Utils::indexVectorToSaucharVector(pattern); Utils::indexVectorToSaucharVector(pattern);
if (patternVector->size() != pattern->size() * sizeof(INDEX_CHARACTER_TYPE)) { if (patternVector->size() !=
pattern->size() * sizeof(INDEX_CHARACTER_TYPE)) {
throw ConcordiaException("Increasing pattern resolution went wrong."); throw ConcordiaException("Increasing pattern resolution went wrong.");
} }
TmMatchesMap tmMatchesMap; TmMatchesMap tmMatchesMap;
for (int offset = 0; offset < pattern->size(); offset++) { for (int offset = 0; offset < pattern->size(); offset++) {
int highResOffset = offset * sizeof(INDEX_CHARACTER_TYPE); int highResOffset = offset * sizeof(INDEX_CHARACTER_TYPE);
boost::shared_ptr<std::vector<sauchar_t> > currentPattern = boost::shared_ptr<std::vector<sauchar_t> > currentPattern =
boost::shared_ptr<std::vector<sauchar_t> >(new std::vector<sauchar_t>( boost::shared_ptr<std::vector<sauchar_t> >
(new std::vector<sauchar_t>(
patternVector->begin()+highResOffset, patternVector->end())); patternVector->begin()+highResOffset, patternVector->end()));
SUFFIX_MARKER_TYPE longestPrefixesLength; SUFFIX_MARKER_TYPE longestPrefixesLength;
boost::ptr_vector<SubstringOccurence> longestPrefixes = lcpSearch(T, markers, SA, boost::ptr_vector<SubstringOccurence> longestPrefixes =
currentPattern, longestPrefixesLength); lcpSearch(T, markers, SA, currentPattern, longestPrefixesLength);
BOOST_FOREACH(SubstringOccurence & occurence, longestPrefixes) { BOOST_FOREACH(SubstringOccurence & occurence, longestPrefixes) {
TmMatchesMapIterator mapIterator = tmMatchesMap.find(occurence.getId()); TmMatchesMapIterator mapIterator = tmMatchesMap.find(
occurence.getId());
if (mapIterator != tmMatchesMap.end()) { if (mapIterator != tmMatchesMap.end()) {
} else {
} }
} }
} }
return result; return result;

View File

@ -44,9 +44,8 @@ sauchar_t * Utils::indexVectorToSaucharArray(
boost::shared_ptr<std::vector<sauchar_t> > Utils::indexVectorToSaucharVector( boost::shared_ptr<std::vector<sauchar_t> > Utils::indexVectorToSaucharVector(
boost::shared_ptr<vector<INDEX_CHARACTER_TYPE> > input) { boost::shared_ptr<vector<INDEX_CHARACTER_TYPE> > input) {
boost::shared_ptr<std::vector<sauchar_t> > result =
boost::shared_ptr<std::vector<sauchar_t> > result = boost::shared_ptr<std::vector<sauchar_t> >( boost::shared_ptr<std::vector<sauchar_t> >(new std::vector<sauchar_t>);
new std::vector<sauchar_t>);
for (vector<INDEX_CHARACTER_TYPE>::iterator it = input->begin(); for (vector<INDEX_CHARACTER_TYPE>::iterator it = input->begin();
it != input->end(); ++it) { it != input->end(); ++it) {
@ -72,5 +71,3 @@ void Utils::_insertCharToSaucharArray(sauchar_t * array,
} }
} }

View File

@ -34,7 +34,8 @@ public:
static sauchar_t * indexVectorToSaucharArray( static sauchar_t * indexVectorToSaucharArray(
boost::shared_ptr<vector<INDEX_CHARACTER_TYPE> > input); boost::shared_ptr<vector<INDEX_CHARACTER_TYPE> > input);
static boost::shared_ptr<std::vector<sauchar_t> > indexVectorToSaucharVector( static boost::shared_ptr<std::vector<sauchar_t> >
indexVectorToSaucharVector(
boost::shared_ptr<vector<INDEX_CHARACTER_TYPE> > input); boost::shared_ptr<vector<INDEX_CHARACTER_TYPE> > input);
static void appendCharToSaucharVector( static void appendCharToSaucharVector(