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

◆ superwords()

void WordWithDataTable::superwords ( WordWithData word,
std::vector< std::pair< int, int > > & output ) const

Definition at line 438 of file WordTable.cpp.

440{
441 // this command returns a list of pairs (i,j) where word appears
442 // appears in monomial i in position j
443 std::vector<int> start_indices;
444 for (auto i = 0; i < mMonomials.size(); ++i)
445 {
446 if (mIndices[i] == -1) continue;
447 start_indices.clear();
448 subwordPositions(word, mMonomials[i], start_indices);
449 for (auto j : start_indices)
450 output.push_back(std::make_pair(i,j));
451 }
452}
std::vector< int > word
static void subwordPositions(WordWithData word1, WordWithData word2, std::vector< int > &result_start_indices)
std::vector< int > mIndices
std::vector< WordWithData > mMonomials

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