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

◆ multinomial() [2/2]

ring_elem WeylAlgebra::multinomial ( const_exponents exptop,
const_exponents exp ) const

Definition at line 576 of file weylalg.cpp.

577{
578 ring_elem result = K_->from_long(1);
579 for (int i = 0; i < nvars_; i++)
580 if (exptop[i] > 0)
581 {
582 for (int j = exptop[i]; j > exp[i]; j--)
583 {
584 ring_elem c = K_->from_long(j);
585 ring_elem d = K_->from_long(exptop[i] - j + 1);
586 K_->mult_to(result, c);
587 ring_elem e = K_->divide(result, d); // exact
588 K_->remove(c);
589 K_->remove(d);
590 K_->remove(result);
591 result = e;
592 }
593 }
594 return result;
595}
const Ring * K_
Definition polyring.hpp:123
VALGRIND_MAKE_MEM_DEFINED & result(result)
const mpreal exp(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
Definition mpreal.h:2298

References PolynomialRing::K_, PolynomialRing::nvars_, and result().