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

◆ subword()

bool WordWithDataTable::subword ( WordWithData word,
std::pair< int, int > & output ) const

Definition at line 422 of file WordTable.cpp.

424{
425 int start_index = -1;
426 for (auto i = 0; i < mMonomials.size(); ++i)
427 {
428 if (mIndices[i] == -1) continue;
429 if (subwordPosition(mMonomials[i], word, start_index))
430 {
431 output = std::make_pair(i, start_index);
432 return true;
433 }
434 }
435 return false;
436}
std::vector< int > word
std::vector< int > mIndices
static bool subwordPosition(WordWithData word1, WordWithData word2, int &result_start_index)
std::vector< WordWithData > mMonomials

References mIndices, mMonomials, subwordPosition(), and word.