158{
160 {
161 ERROR(
"expected matrix over the same ring");
162 *result_remainder = nullptr;
163 *result_quotient = nullptr;
164 return false;
165 }
167 {
168 ERROR(
"expected matrices to have same number of rows");
169 *result_remainder = nullptr;
170 *result_quotient = nullptr;
171 return false;
172 }
173
175 MatrixConstructor mat_quotient(
Fsyz, m->
cols(),
nullptr);
176
177#ifdef DEVELOPMENT
178#warning "K should be the denominator ring?"
179#endif
180 const Ring *K =
R->get_flattened_coefficients();
181 bool all_zeroes = true;
182 for (
int i = 0; i < m->
n_cols(); i++)
183 {
184 ring_elem denom;
186 g.
f =
originalR->translate_gbvector_from_vec(
F, (*m)[i], denom);
187 g.
fsyz =
R->gbvector_zero();
188
190 if (g.
f !=
nullptr) all_zeroes =
false;
191
192 vec fv =
originalR->translate_gbvector_to_vec_denom(
F, g.
f, denom);
194 vec fsyzv =
196 mat_remainder.set_column(i, fv);
197 mat_quotient.set_column(i, fsyzv);
198
199 R->gbvector_remove(g.
f);
200 R->gbvector_remove(g.
fsyz);
201 }
202 *result_remainder = mat_remainder.to_matrix();
203 *result_quotient = mat_quotient.to_matrix();
204 return all_zeroes;
205}
const_monomial degree_shift() const
const Ring * get_ring() const
const FreeModule * rows() const
const FreeModule * cols() const
virtual void remainder(POLY &f, bool use_denom, ring_elem &denom)=0
const PolynomialRing * originalR
void negate_to(ring_elem &f) const