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

◆ diff_coefficients()

ring_elem WeylAlgebra::diff_coefficients ( const ring_elem c,
const int * derivatives,
const_exponents exp ) const
protected

Definition at line 307 of file weylalg.cpp.

310{
311 ring_elem result = K_->copy(c);
312 for (int i = 0; i < _nderivatives; i++)
313 {
314 if (derivatives[i] == 0) continue;
315 if (exp[i] <= diffcoeffstop)
316 {
317 ring_elem g =
318 K_->from_long(diffcoeffstable[exp[i]][derivatives[i]]);
319 ring_elem h = K_->mult(result, g);
320 K_->remove(g);
321 K_->remove(result);
322 result = h;
323 if (K_->is_zero(result)) return result;
324 }
325 else
326 for (int j = derivatives[i] - 1; j >= 0; j--)
327 {
328 ring_elem g = K_->from_long(exp[i] - j);
329 ring_elem h = K_->mult(result, g);
330 K_->remove(g);
331 K_->remove(result);
332 result = h;
333 if (K_->is_zero(result)) return result;
334 }
335 }
336 return result;
337}
const Ring * K_
Definition polyring.hpp:123
static int diffcoeffstop
Definition weylalg.hpp:70
int _nderivatives
Definition weylalg.hpp:62
static int ** diffcoeffstable
Definition weylalg.hpp:72
VALGRIND_MAKE_MEM_DEFINED & result(result)

References _nderivatives, diffcoeffstable, diffcoeffstop, PolynomialRing::K_, and result().

Referenced by gbvector_weyl_diff(), and weyl_diff().