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

◆ TEST() [15/19]

TEST ( WordTable ,
insert  )

Definition at line 502 of file NCGroebnerTest.cpp.

503{
504 WordTable W;
505
506 EXPECT_EQ(monom1.size(), 3);
507 EXPECT_EQ(monom2.size(), 2);
508
509 W.insert(Word(monom1));
510 W.insert(Word(monom2));
511 W.insert(Word(monom3));
512
513 std::vector<std::pair<int,int>> matches;
514 W.subwords(Word(word), matches);
515
516 EXPECT_EQ(matches.size(), 3);
517 EXPECT_EQ(matches[0], std::make_pair(0, 0));
518 EXPECT_EQ(matches[1], std::make_pair(1, 3));
519 EXPECT_EQ(matches[2], std::make_pair(2, 5));
520}
std::vector< int > monom1
std::vector< int > monom2
std::vector< int > word
std::vector< int > monom3
Non-owning view of a non-commutative word: [begin, end) of int variable indices.
Definition Word.hpp:56
void subwords(Word word, std::vector< std::pair< int, int > > &output) const
size_t insert(Word w)
Definition WordTable.cpp:17
Index of Words (non-commutative monomials) with subword, prefix/suffix, and overlap lookup used by th...
Definition WordTable.hpp:89

References WordTable::insert(), monom1, monom2, monom3, WordTable::subwords(), and word.