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

◆ vec_homogenize() [2/2]

vec Ring::vec_homogenize ( const FreeModule * F,
const vec f,
int v,
int deg,
const std::vector< int > & wts ) const

Definition at line 884 of file ring-vecs.cpp.

890{
891 vecterm head;
892 vecterm *result = &head;
893 assert(wts[v] != 0);
894 // If an error occurs, then return 0, and set ERROR
895
896 for (vec w = f; w != nullptr; w = w->next)
897 {
898 int e = F->primary_degree(w->comp);
899 ring_elem a = homogenize(w->coeff, v, d - e, wts);
900 if (!is_zero(a))
901 {
902 result->next = make_vec(w->comp, a);
903 result = result->next;
904 }
905 }
906 result->next = nullptr;
907 return head.next;
908}
int primary_degree(int i) const
Definition freemod.cpp:440
vec make_vec(int r, ring_elem a) const
Definition ring-vecs.cpp:60
virtual ring_elem homogenize(const ring_elem f, int v, int deg, const std::vector< int > &wts) const
Definition ring.cpp:389
virtual bool is_zero(const ring_elem f) const =0
VALGRIND_MAKE_MEM_DEFINED & result(result)

References homogenize(), is_zero(), make_vec(), vec::next, and result().

Referenced by vec_homogenize().