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

◆ superwords()

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

Definition at line 176 of file WordTable.cpp.

178{
179 // this command returns a list of pairs (i,j) where word appears
180 // appears in monomial i in position j
181 std::vector<int> start_indices;
182 for (auto i = 0; i < mMonomials.size(); ++i)
183 {
184 start_indices.clear();
185 subwordPositions(word, mMonomials[i], start_indices);
186 for (auto j : start_indices)
187 output.push_back(std::make_pair(i,j));
188 }
189}
std::vector< int > word
static void subwordPositions(Word word1, Word word2, std::vector< int > &result_start_indices)
Definition WordTable.cpp:38
std::vector< Word > mMonomials

References mMonomials, subwordPositions(), and word.

Referenced by TEST().