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

◆ subwords()

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

Definition at line 376 of file WordTable.cpp.

378{
379 // this command returns a pair (i,j) where word i in the table appears
380 // in position j of word.
381 std::vector<int> start_indices;
382 for (auto i = 0; i < mMonomials.size(); ++i)
383 {
384 if (mIndices[i] == -1) continue;
385 start_indices.clear();
386 subwordPositions(mMonomials[i], word, start_indices);
387 for (auto j : start_indices)
388 output.push_back(std::make_pair(i,j));
389 }
390}
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.