1102{
1104 {
1105 ERROR(
"expected matrix over the same ring");
1106 *result_remainder = nullptr;
1107 *result_quotient = nullptr;
1108 return false;
1109 }
1111 {
1112 ERROR(
"expected matrices to have same number of rows");
1113 *result_remainder = nullptr;
1114 *result_quotient = nullptr;
1115 return false;
1116 }
1119 MatrixConstructor mat_quotient(
_Fsyz, 0);
1120 bool all_zeroes = true;
1121 for (
int i = 0; i < m->
n_cols(); i++)
1122 {
1123 ring_elem denom;
1124 gbvector *f =
originalR->translate_gbvector_from_vec(
_F, (*m)[i], denom);
1125 gbvector *fsyz =
_GR->gbvector_zero();
1126
1128 if (f != nullptr) all_zeroes = false;
1129
1130 vec fv =
originalR->translate_gbvector_to_vec_denom(
_F, f, denom);
1131 _K->negate_to(denom);
1132 vec fsyzv =
1134 mat_remainder.set_column(i, fv);
1135 mat_quotient.append(fsyzv);
1136 }
1137 *result_remainder = mat_remainder.to_matrix();
1138 *result_quotient = mat_quotient.to_matrix();
1139 return all_zeroes;
1140}
void gb_reduce(gbvector *&f, gbvector *&fsyz)
const PolynomialRing * originalR
const_monomial degree_shift() const
const Ring * get_ring() const
const FreeModule * rows() const
const FreeModule * cols() const