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

◆ testMultiplication()

void testMultiplication ( )

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

182{
183 monomials foo;
184 foo.push_back(14);
185 foo.push_back(1);
186 BRP bar = BRP(foo);
187 // cout << bar << endl;
188
190 foo2.push_back(8);
191 BRP bar2 = BRP(foo2);
192 // cout << bar2 << endl;
193
194 BRP barMultiply = bar * bar2;
195 // cout << barMultiply << endl;
196
197 monomials foo3;
198 foo3.push_back(14);
199 foo3.push_back(9);
200
201 BRP bar3 = BRP(foo3);
202 if (barMultiply != bar3)
203 {
204 cout << "Testing multiplication: "
205 << (barMultiply == bar3 ? "is good" : "is bad") << endl;
206 }
207
208 BRP a = BRP(13) + BRP(12) + BRP(6) + BRP(4) + BRP(2) + BRP(1);
209 BRP b = BRP(13);
210 BRP c = a * b;
211 // 13 + 13 + 15 + 13 + 15 + 13
212 BRP correct = BRP();
213
214 if (c != correct)
215 {
216 cout << "Multiplication not correct. Is " << c << endl;
217 }
218
219 a = BRP(13) + BRP(12) + BRP(6) + BRP(4) + BRP(2) + BRP(1);
220 int d = 13;
221 c = a * d;
222 // 13 + 13 + 15 + 13 + 15 + 13
223 correct = BRP();
224
225 if (c != correct)
226 {
227 cout << "Multiplication not correct. Is " << c << endl;
228 }
229
230 a = BRP(16) + BRP(13) + BRP(12) + BRP(6) + BRP(4) + BRP(2) + BRP(1);
231 b = BRP(13);
232 c = a * b;
233 // 29 + 13 + 13 + 15 + 13 + 15 + 13
234 correct = BRP(29);
235 if (c != correct)
236 {
237 cout << "Multiplication not correct. Is " << c << endl;
238 }
239
240 a = BRP(16) + BRP(13) + BRP(12) + BRP(6) + BRP(4) + BRP(2) + BRP(1);
241 d = 13;
242 c = a * d;
243 // 29 + 13 + 13 + 15 + 13 + 15 + 13
244 correct = BRP(29);
245 if (c != correct)
246 {
247 cout << "Multiplication not correct. Is " << c << endl;
248 }
249
250 a = BRP(16) + BRP(13) + BRP(12) + BRP(6) + BRP(4);
251 d = 220;
252 c = a * d;
253 // 220 + 221 + 220 + 222 + 220
254 correct = BRP(222) + BRP(221) + BRP(220);
255 if (c != correct)
256 {
257 cout << "Multiplication not correct. Is " << c << endl;
258 }
259}
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().