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

◆ TEST() [2/3]

TEST ( ARingGFFlint ,
create  )

Definition at line 92 of file ARingGFTest.cpp.

93{
94 M2::ARingGFFlint R(5, 3);
95
96 EXPECT_EQ(ringName(R), "GF(5,3,Flint)");
97 EXPECT_EQ(R.cardinality(), 125);
98 EXPECT_EQ(R.characteristic(), 5);
99
100 M2_arrayint gen_modpoly = R.getModPolynomialCoeffs();
101 std::cout << "minimal polynomial = ";
102 dintarray(gen_modpoly);
103 std::cout << std::endl;
104
105 M2_arrayint gen_coeffs = R.getGeneratorCoeffs();
106 std::cout << "generator polynomial = ";
107 dintarray(gen_coeffs);
108 std::cout << std::endl;
109
110 // Check what values integers go to
112 R.init(a);
113 // for (int i=-5; i<R.characteristic(); i++)
114 for (int i = -130; i < 130; i++)
115 {
116 R.set_from_long(a, i);
117 M2_arrayint coeffs = R.fieldElementToM2Array(a);
118 EXPECT_EQ(coeffs->len, 3);
119 int imodp = i % 5;
120 if (imodp < 0) imodp += 5;
121 EXPECT_EQ(coeffs->array[0], imodp);
122 for (int j = 1; j < 3; j++) EXPECT_EQ(coeffs->array[j], 0);
123 // std::cout << i << " = ";
124 // dintarray(coeffs);
125 // std::cout << std::endl;
126 }
127 R.clear(a);
128
129 testSomeMore(R);
130}
void testSomeMore(const T &R)
Definition ARingTest.hpp:72
std::string ringName(const T &R)
fq_zech_struct ElementType
aring-style adapter for FLINT's Zech-logarithm representation of small finite fields GF(p^n).
void dintarray(M2_arrayint a)
Definition debug.cpp:19

References M2::ARingGFFlint::characteristic(), M2::ARingGFFlint::clear(), dintarray(), M2::ARingGFFlint::init(), ringName(), M2::ARingGFFlint::set_from_long(), and testSomeMore().