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

◆ gbvector_lead_term()

gbvector * GBRing::gbvector_lead_term ( int n,
const FreeModule * F,
const gbvector * f )

Definition at line 440 of file gbring.cpp.

447{
448 (void) F;
449#ifdef DEVELOPMENT
450#warning "Schreyer order question"
451#endif
452 if (v == nullptr) return nullptr;
453 if (nparts < 0)
454 {
455 return gbvector_copy_term(v);
456 }
457 else
458 {
459 int nslots = M->n_slots(nparts);
460 gbvector head;
461 gbvector *result = &head;
462 for (const gbvector *t = v; t != nullptr; t = t->next)
463 {
464 if (M->compare(nslots, t->monom, v->monom) != 0) break;
465 result->next = gbvector_copy_term(t);
466 result = result->next;
467 }
468 result->next = nullptr;
469 return head.next;
470 }
471}
const Monoid * M
Definition gbring.hpp:137
gbvector * gbvector_copy_term(const gbvector *t)
Definition gbring.cpp:366
VALGRIND_MAKE_MEM_DEFINED & result(result)
gbvector * next
Definition gbring.hpp:80

References gbvector_copy_term(), M, gbvector::monom, gbvector::next, and result().