source: git/Singular/pp_Mult_Coeff_mm_DivSelect__Template.cc @ 0224c8

spielwiese
Last change on this file since 0224c8 was 4e6cf2, checked in by Olaf Bachmann <obachman@…>, 24 years ago
* clean up git-svn-id: file:///usr/local/Singular/svn/trunk@4681 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    pp_Mult_Coeff_mm_DivSelect__Template.cc
6 *  Purpose: template for pp_Mult_Coeff_mm__DivSelect
7 *  Author:  obachman (Olaf Bachmann)
8 *  Created: 8/00
9 *  Version: $Id: pp_Mult_Coeff_mm_DivSelect__Template.cc,v 1.3 2000-10-30 13:40:26 obachman Exp $
10 *******************************************************************/
11
12/***************************************************************
13 *
14 *   Returns:  p*Coeff(m) for such monomials pm of p, for which
15 *             m is divisble by pm
16 *   Const:    p, m
17 *
18 ***************************************************************/
19poly pp_Mult_Coeff_mm_DivSelect(poly p, const poly m, const ring r)
20{
21  number n = pGetCoeff(m);
22  pAssume(!n_IsZero(n,r));
23  p_Test(p, r);
24  if (p == NULL) return NULL;
25  spolyrec rp;
26  poly q = &rp;
27  omBin bin = r->PolyBin;
28  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
29
30  do
31  {
32    if (p_LmDivisibleByNoComp(m, p, r))
33    {
34      p_AllocBin(pNext(q), bin, r);
35      q = pNext(q);
36      number nc = pGetCoeff(p);
37      pSetCoeff0(q, n_Mult(n, nc, r));
38      p_MemCopy(q->exp, p->exp, length);
39    }
40    pIter(p);
41  }
42  while (p != NULL);
43  pNext(q) = NULL;
44
45  p_Test(rp.next, r);
46  return rp.next;
47}
48
49
Note: See TracBrowser for help on using the repository browser.