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

◆ contains()

int GB_comp::contains ( const Matrix * m)
virtual

Implements GBComputation.

Definition at line 1142 of file gb-homog2.cpp.

1146{
1147 if (m->get_ring() != originalR)
1148 {
1149 ERROR("expected matrix over the same ring");
1150 return -2;
1151 }
1152 // Reduce each column of m one by one.
1154 for (int i = 0; i < m->n_cols(); i++)
1155 {
1156 ring_elem denom;
1157 gbvector *f = originalR->translate_gbvector_from_vec(_F, (*m)[i], denom);
1158 _K->remove(denom);
1159 gbvector *fsyz = nullptr;
1160 gb_reduce(f, fsyz);
1161 _GR->gbvector_remove(fsyz);
1162 if (f != nullptr)
1163 {
1164 _GR->gbvector_remove(f);
1165 return i;
1166 }
1167 }
1168 return -1;
1169}
void gb_reduce(gbvector *&f, gbvector *&fsyz)
const Ring * _K
Definition gb-homog2.hpp:71
void start_computation()
const FreeModule * _F
Definition gb-homog2.hpp:73
GBRing * _GR
Definition gb-homog2.hpp:68
const PolynomialRing * originalR
Definition gb-homog2.hpp:67
const Ring * get_ring() const
Definition matrix.hpp:134
int n_cols() const
Definition matrix.hpp:147
const int ERROR
Definition m2-mem.cpp:55

References _F, _GR, _K, ERROR, gb_reduce(), Matrix::get_ring(), Matrix, Matrix::n_cols(), originalR, and start_computation().