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

◆ rawRingElementCompare()

int rawRingElementCompare ( const RingElement * a,
const RingElement * b )

Definition at line 376 of file ringelement.cpp.

377{
378 try
379 {
380 const Ring *R = a->get_ring();
381 if (R != b->get_ring()) return 0;
382 // if (a->is_zero())
383 // {
384 // if (b->is_zero()) return 0;
385 // return 1;
386 // }
387 // if (b->is_zero()) return -1;
388 return R->compare_elems(a->get_value(), b->get_value());
389 } catch (const exc::engine_error& e)
390 {
391 ERROR(e.what());
392 return -2;
393 }
394}
virtual int compare_elems(const ring_elem f, const ring_elem g) const =0
ring_elem get_value() const
Definition relem.hpp:79
const Ring * get_ring() const
Definition relem.hpp:81
xxx xxx xxx
Definition ring.hpp:102
const int ERROR
Definition m2-mem.cpp:55

References Ring::compare_elems(), ERROR, RingElement::get_ring(), and RingElement::get_value().