TEST(ARingQQGMP, arithmetic) { M2::ARingQQGMP R; testCoercions(R); testNegate(R, ntrials); testAdd(R, ntrials); testSubtract(R, ntrials); testMultiply(R, ntrials); testDivide(R, ntrials); testReciprocal(R, ntrials); // testPower(R, ntrials); // this test can't work, as it expects a finite field testAxioms(R, ntrials); }
TEST(ARingZZpFlint, arithmetic33500479) { M2::ARingZZpFlint R(33500479); testCoerceToLongInteger(R); testCoercions(R); testNegate(R, ntrials); testAdd(R, ntrials); testSubtract(R, ntrials); testMultiply(R, ntrials); testDivide(R, ntrials); testReciprocal(R, ntrials); testPower(R, ntrials); testAxioms(R, ntrials); }
// TODO: commented out because it takes too long: // Actually: now this characteristic seems too big?! TEST(ARingZZpFFPACK, arithmetic67108859) { M2::ARingZZpFFPACK R(67108859); testCoerceToLongInteger(R); testCoercions(R); testNegate(R, ntrials); testAdd(R, ntrials); testSubtract(R, ntrials); testMultiply(R, ntrials); testDivide(R, ntrials); testReciprocal(R, ntrials); testPower(R, ntrials); testAxioms(R, ntrials); }
TEST(ARingZZ, arithmetic) { M2::ARingZZ R; testCoercions(R); testNegate(R, ntrials); testAdd(R, ntrials); testSubtract(R, ntrials); testMultiply(R, ntrials); testDivide(R, ntrials); // testReciprocal(R, ntrials); // this test is not applicable, as this is not // a field // testPower(R, ntrials); // this test can't work, as it expects a finite // field testAxioms(R, ntrials); }
void testFiniteField(const T& R, int ntrials) { testCoercions(R); testNegate(R, ntrials); testAdd(R, ntrials); //fails in char 2, ffpack (negating 1 gives -1)... testSubtract(R, ntrials); //fails in char 2, ffpack testMultiply(R, ntrials); testDivide(R, ntrials); //fails in char 2, ffpack testReciprocal(R, ntrials); testPower(R, ntrials);// fails? testAxioms(R, ntrials); //TODO: test promote, lift, syzygy(?), (ringmaps) // test random number generation? // get generator }
// Even though flint handles primes up to 2^64-1, M2 assumes that the // characteristic is < 2^63. If needed, we could change the type of // the characteristic to unsigned long, but that would have further // complications. TEST(ARingZZpFlint, arithmetic18446744073709551557) { // largest prime < 2^64 if (sizeof(unsigned long) <= 4) std::cout << "seems to be a 32bit machine: skipping the test" << std::endl; else { M2::ARingZZpFlint R(18446744073709551557UL); // testCoerceToLongInteger(R); // this fails for charac > 2^63 testCoercions(R); testNegate(R, ntrials); testAdd(R, ntrials); testSubtract(R, ntrials); testMultiply(R, ntrials); testDivide(R, ntrials); testReciprocal(R, ntrials); // testPower(R, ntrials); // this test fails: as it expects the // characteristic to fit into an int. testAxioms(R, ntrials); } }