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

◆ testAddition()

void testAddition ( )

Definition at line 96 of file franzi-brp-test.cpp.

97{
98 monomials foo;
99 foo.push_back(3);
100 foo.push_back(2);
101 foo.push_back(1);
103 foo2.push_back(5);
104 foo2.push_back(4);
105 foo2.push_back(3);
106 BRP bar = BRP(foo);
107 // cout << bar << endl;
108 BRP bar2 = BRP(foo2);
109 // cout << bar2 << endl;
110
111 BRP bar3 = bar + bar2;
112 // cout << bar3 << endl;
113
114 monomials foo3;
115 foo3.push_back(5);
116 foo3.push_back(4);
117 foo3.push_back(2);
118 foo3.push_back(1);
119
120 BRP bar4 = BRP(foo3);
121
122 if (bar3 != bar4)
123 {
124 cout << "Testing addition: " << (bar3 == bar4 ? "is good" : "is bad")
125 << endl;
126 }
127 BRP a = BRP(16) + BRP(15) + BRP(5) + BRP(2);
128 BRP b = BRP(13) + BRP(12) + BRP(6) + BRP(4) + BRP(2) + BRP(1);
129 BRP c = a + b;
130 BRP correct =
131 BRP(16) + BRP(15) + BRP(13) + BRP(12) + BRP(6) + BRP(5) + BRP(4) + BRP(1);
132
133 if (c != correct)
134 {
135 cout << "Addition failed" << endl;
136 }
137}
Boolean (F_2-coefficient) polynomial stored as an ordered list of square-free monomials.
static struct enter_factory foo2
Definition factory.cpp:310
std::list< brMonomial > monomials

References foo2.

Referenced by main().