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

◆ gbvector_parallel_lead_terms()

gbvector * GBRing::gbvector_parallel_lead_terms ( M2_arrayint w,
const FreeModule * F,
const gbvector * leadv,
const gbvector * v )

Definition at line 495 of file gbring.cpp.

499{
500 (void) F;
501 if (v == nullptr) return nullptr;
502
503 // loop through every term of v. Keep those t that satisfy: exp(leadv) -
504 // exp(t)
505 // is a multiple of w
506 //
507
510
511 M->to_expvector(leadv->monom, lead);
512
513 gbvector head;
514 gbvector *result = &head;
515 for (const gbvector *t = v; t != nullptr; t = t->next)
516 {
517 M->to_expvector(t->monom, e);
518 if (leadv == t || isparallel(w, lead, e))
519 {
520 result->next = gbvector_copy_term(t);
521 result = result->next;
522 }
523 }
524 result->next = nullptr;
525 return head.next;
526}
exponents::Exponents exponents_t
size_t exp_size
Definition gbring.hpp:169
const Monoid * M
Definition gbring.hpp:137
gbvector * gbvector_copy_term(const gbvector *t)
Definition gbring.cpp:366
static bool isparallel(M2_arrayint w, int *e, int *f)
Definition gbring.cpp:473
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define ALLOCATE_EXPONENTS(byte_len)
Definition monoid.hpp:62
gbvector * next
Definition gbring.hpp:80
int monom[1]
Definition gbring.hpp:83

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