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

◆ add_generators()

void binomialGB_comp::add_generators ( const Matrix * m)

Definition at line 1056 of file gb-toric.cpp.

1057{
1058 int i;
1059 binomial f;
1060 binomial_gb_elem *p;
1061 if (m->get_ring()->is_ZZ())
1062 {
1063 for (i = 0; i < m->n_cols(); i++)
1064 {
1065 f = R->make_binomial();
1066 R->intvector_to_binomial((*m)[i], f);
1067 p = new binomial_gb_elem(f);
1068 Gens.push_back(p);
1069 Pairs->insert(p);
1070 }
1071 }
1072 else
1073 {
1074 for (i = 0; i < m->n_cols(); i++)
1075 {
1076 f = R->make_binomial();
1077 if (R->vector_to_binomial((*m)[i], f))
1078 {
1079 p = new binomial_gb_elem(f);
1080 Gens.push_back(p);
1081 Pairs->insert(p);
1082 }
1083 else
1084 {
1085 ERROR("expected binomials");
1086 return;
1087 }
1088 }
1089 }
1090}
const Ring * get_ring() const
Definition matrix.hpp:134
int n_cols() const
Definition matrix.hpp:147
virtual bool is_ZZ() const
Definition ring.hpp:171
binomial_ring * R
Definition gb-toric.hpp:313
binomial_s_pair_set * Pairs
Definition gb-toric.hpp:314
int p
const int ERROR
Definition m2-mem.cpp:55

References ERROR, Matrix::get_ring(), Ring::is_ZZ(), Matrix, Matrix::n_cols(), p, Pairs, and R.