45 std::istringstream i(
"+1234 +345 -235*a");
52 std::cout << o.
str() <<
" peek: "
53 <<
"." <<
static_cast<char>(i.peek()) <<
"." << std::endl;
61 EXPECT_TRUE(R !=
nullptr);
63 EXPECT_TRUE(
dynamic_cast<const Z_mod*
>(R) !=
nullptr);
65 EXPECT_FALSE(R->
is_ZZ());
91TEST(RingZZmod101, multDivide)
115 EXPECT_TRUE(R !=
nullptr);
117 EXPECT_TRUE(
dynamic_cast<const Z_mod*
>(R) !=
nullptr);
119 EXPECT_FALSE(R->
is_ZZ());
std::istream & fromStream(std::istream &i, const T &R, typename T::ElementType &result)
std::string ringName(const T &R)
void testRingPower(const T *R, int ntrials)
void testRingDivide(const T *R, int ntrials)
void testRingSyzygy(const T *R, int ntrials)
void testRingAxioms(const T *R, int ntrials)
void testRingAdd(const T *R, int ntrials)
void testRingSubtract(const T *R, int ntrials)
void testRingNegate(const T *R, int ntrials)
Shared gtest fixture for the legacy Ring-based Ring*Test.cpp suite.
ring_elem getElement< RingZZ >(const RingZZ &R, int index)
TEST(RingZZmod32003, fromStream)
ring_elem getElement< Z_mod >(const Z_mod &R, int index)
Legacy Z_mod — a Ring-derived Z/p with log / exp tables.
virtual bool is_ZZ() const
ring_elem minus_one() const
virtual CoefficientType coefficient_type() const
virtual ring_elem from_long(long n) const
virtual bool is_zero(const ring_elem f) const
virtual ring_elem from_int(mpz_srcptr n) const
virtual void elem_text_out(buffer &o, const ring_elem f, bool p_one=true, bool p_plus=false, bool p_parens=false) const
static Z_mod * create(int p)
virtual bool is_equal(const ring_elem f, const ring_elem g) const
Engine-side Z/p ring for small primes (p < 32767), using a discrete-log (Zech) representation.
void subtract(int &result, int a, int b)
std::ostringstream & ones(std::ostringstream &o, int len)
mpz_srcptr get_mpz() const