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

◆ degree_weights() [2/2]

template<typename T>
T Monoid::degree_weights ( const_monomial m,
const std::vector< T > & wts ) const

Definition at line 683 of file monoid.cpp.

684{
685 if (mVariableCount == 0) return 0;
686
688 to_expvector(m, EXP1);
689 int sz = (wts.size() < mVariableCount ? wts.size() : mVariableCount);
690 T wt = 0;
691 for (int i=0; i<sz; i++)
692 wt += EXP1[i] * wts[i];
693 return wt;
694}
exponents::Exponents exponents_t
void to_expvector(const_monomial m, exponents_t result_exp) const
Definition monoid.cpp:747
size_t exp_size
Definition monoid.hpp:120
const int mVariableCount
number of variables
Definition monoid.hpp:99
#define ALLOCATE_EXPONENTS(byte_len)
Definition monoid.hpp:62
#define T
Definition table.c:13

References ALLOCATE_EXPONENTS, exp_size, mVariableCount, T, and to_expvector().

Referenced by primary_degree().