Macaulay2 Engine
Loading...
Searching...
No Matches

◆ contractedLocus()

auto SuffixTree::contractedLocus ( SuffixTreeNode * y,
const Word & s,
bool incrementLeafCount = false ) const->ContractedLocusType

Definition at line 324 of file SuffixTree.cpp.

327{
328 // warning: This function is not *really* const, since adding to the pattern
329 // leaf count (if incrementalLeafCount = true) could change the behavior of
330 // some functions.
331 y->addToPatternLeafCount(incrementLeafCount);
332 auto tmpNode = y;
333 auto tmpLabel = s;
334 auto match = findMatch(tmpNode,tmpLabel);
335 while (std::get<0>(match) != nullptr && std::get<1>(match) == Word(std::get<0>(match)->arcLabel()))
336 {
337 tmpNode = std::get<0>(match);
338 tmpLabel = suffix(tmpLabel,std::get<1>(match).size());
339 tmpNode->addToPatternLeafCount(incrementLeafCount);
340 match = findMatch(tmpNode,tmpLabel);
341 }
342 return std::make_tuple(tmpNode,std::get<0>(match),std::get<1>(match));
343}
Word suffix(const Word vec, int indexOfSuffix)
auto findMatch(SuffixTreeNode *y, const Word &s) const -> ExtendedLocusType
void addToPatternLeafCount(bool doIncrement)
void size_t s
Definition m2-mem.cpp:271

References findMatch(), s, and suffix().

Referenced by insertStepD(), subwordsStepD(), and superwords().