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

◆ subwords()

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

Definition at line 118 of file WordTable.cpp.

120{
121 // this command returns a pair (i,j) where word i in the table appears
122 // in position j of word.
123 std::vector<int> start_indices;
124 for (auto i = 0; i < mMonomials.size(); ++i)
125 {
126 start_indices.clear();
127 subwordPositions(mMonomials[i], word, start_indices);
128 for (auto j : start_indices)
129 output.push_back(std::make_pair(i,j));
130 }
131}
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(), TEST(), TEST(), and TEST().