56{
59
60 RingZZp* R = new RingZZp(101);
61 MatZZp M(*R, 5, 5);
62
63 EXPECT_TRUE(&M.ring() == R);
64
65 RingZZp::ElementType a, b;
66 R->init(a);
67 R->init(b);
68
69 R->set_from_long(a, 13);
70 R->set(M.entry(0, 2), a);
71
72 R->set(b, M.entry(0, 2));
73 EXPECT_TRUE(R->is_equal(a, b));
74
75
76
78 R->set(b, M.entry(0, 0));
79 EXPECT_TRUE(R->is_equal(a, b));
80
83
86
87 R->set(M.entry(4, 4), a);
89
92
93 MatZZp N(*R, 2, 2);
94 R->set(N.entry(0, 0), a);
96 std::cout << std::endl;
98 std::cout << std::endl;
103 std::cout << std::endl;
105
106 R->clear(a);
107 R->clear(b);
108}
aring-style adapter for Z/p using a discrete-log (Zech) representation: every non-zero residue is its...
SubMatrix< MatType > submatrix(MatType &m)
void displayMat(buffer &o, const Mat &A)
bool isZero(const DMat< RT > &A)