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

◆ weight()

template<class E, bool L>
template<typename T>
Exponent ExponentList< E, L >::weight ( ConstExponents m,
const std::vector< T > & wts )
inlinestatic

Definition at line 168 of file ExponentList.hpp.

169 {
170 Exponent sum = 0;
171 auto num_wts = wts.size();
172 for (Iterator i = m; i.valid(); ++i)
173 sum += i.exponent() * (i.var() < num_wts ? wts[i.var()] : 1);
174 return sum;
175 }
ExponentListIterator< E, L > Iterator
static void var(Exponent v, Exponent e, Vector &result)