예제 #1
0
파일: GF.cpp 프로젝트: ChristineJost/M2
int GF::compare_elems(const ring_elem f, const ring_elem g) const
{
  int cmp = f.get_int() - g.get_int();
  if (cmp < 0) return -1;
  if (cmp == 0) return 0;
  return 1;
}
예제 #2
0
파일: GF.cpp 프로젝트: ChristineJost/M2
void GF::elem_text_out(buffer &o,
                       const ring_elem a,
                       bool p_one,
                       bool p_plus,
                       bool p_parens) const
{
  if (a.get_int() == _ZERO)
    {
      o << "0";
      return;
    }
  ring_elem h = _originalR->power(_primitive_element->get_value(), a.int_val);
  _originalR->elem_text_out(o, h, p_one, p_plus, p_parens);
  _originalR->remove(h);
}
예제 #3
0
파일: GF.cpp 프로젝트: ChristineJost/M2
void GF::internal_negate_to(ring_elem &f) const
{
  if (f.get_int() != _ZERO)
    f = modulus_add(f.get_int(), _MINUS_ONE, Q1_);
}
예제 #4
0
파일: GF.cpp 프로젝트: ChristineJost/M2
bool GF::is_equal(const ring_elem f, const ring_elem g) const
{
  return f.get_int() == g.get_int();
}
예제 #5
0
파일: GF.cpp 프로젝트: ChristineJost/M2
bool GF::is_zero(const ring_elem f) const
{
  return (f.get_int() == _ZERO);
}
예제 #6
0
파일: GF.cpp 프로젝트: ChristineJost/M2
bool GF::is_unit(const ring_elem f) const
{
  return (f.get_int() != _ZERO);
}