581{
582 std::vector<int>
monom1 {1, 0, 1, 2};
583 std::vector<int>
monom2 {1, 0, 2, 2};
584 std::vector<int>
monom3 {1, 0, 1, 0};
585 std::vector<int>
word {1, 0, 1, 0, 2, 2, 1, 0, 1, 2};
586 std::vector<int> word2 {1, 0, 1, 1, 2, 2, 1, 1, 1, 2};
587
589
590 EXPECT_EQ(
monom1.size(), 4);
591 EXPECT_EQ(
monom2.size(), 4);
592 EXPECT_EQ(
monom3.size(), 4);
593 EXPECT_EQ(
word.size(), 10);
594
598
599 int ind = -1;
600 int ind2 = -1;
603
604 EXPECT_TRUE(isprefix);
605 EXPECT_TRUE(issuffix);
606 EXPECT_EQ(2, ind);
607 EXPECT_EQ(0, ind2);
608
609 ind = -1;
610 ind2 = -1;
613 EXPECT_TRUE(isprefix);
614 EXPECT_EQ(0,ind);
615 EXPECT_TRUE(issuffix);
616 EXPECT_EQ(1,ind2);
617
618
619 ind = -1;
620 ind2 = -1;
623
624 EXPECT_FALSE(isprefix);
625 EXPECT_FALSE(issuffix);
626}
std::vector< int > monom1
std::vector< int > monom2
std::vector< int > monom3
Non-owning view of a non-commutative word: [begin, end) of int variable indices.
bool isPrefix(Word word, int &output) const
bool isSuffix(Word word, int &output) const
Index of Words (non-commutative monomials) with subword, prefix/suffix, and overlap lookup used by th...