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

@ -24,39 +24,34 @@ boost::ptr_vector<AnubisSearchResult> AnubisSearcher::anubisSearch(
boost::shared_ptr<std::vector<INDEX_CHARACTER_TYPE> > pattern) boost::shared_ptr<std::vector<INDEX_CHARACTER_TYPE> > pattern)
throw(ConcordiaException) { throw(ConcordiaException) {
boost::ptr_vector<AnubisSearchResult> result; boost::ptr_vector<AnubisSearchResult> result;
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)) {
throw ConcordiaException("Increasing pattern resolution went wrong.");
}
if (patternVector->size() !=
pattern->size() * sizeof(INDEX_CHARACTER_TYPE)) {
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> >
patternVector->begin()+highResOffset,patternVector->end())); (new std::vector<sauchar_t>(
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(
if(mapIterator != tmMatchesMap.end()) { occurence.getId());
if (mapIterator != tmMatchesMap.end()) {
} else { }
}
} }
}
}
return result; return result;
} }

View File

@ -44,10 +44,9 @@ 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) {
appendCharToSaucharVector(result, *it); appendCharToSaucharVector(result, *it);
@ -71,6 +70,4 @@ void Utils::_insertCharToSaucharArray(sauchar_t * array,
array[i] = characterArray[i-pos]; array[i] = characterArray[i-pos];
} }
} }

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(