source: git/kernel/p_Mult_mm__T.cc @ 788529d

spielwiese
Last change on this file since 788529d was 35aab3, checked in by Hans Schönemann <hannes@…>, 21 years ago
This commit was generated by cvs2svn to compensate for changes in r6879, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@6880 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.2 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    p_Mult_mm__Template.cc
6 *  Purpose: template for p_Mult_n
7 *  Author:  obachman (Olaf Bachmann)
8 *  Created: 8/00
9 *  Version: $Id: p_Mult_mm__T.cc,v 1.1.1.1 2003-10-06 12:16:00 Singular Exp $
10 *******************************************************************/
11
12/***************************************************************
13 *
14 *   Returns:  p*m
15 *   Const:    m
16 *   Destroys: p
17 *
18 ***************************************************************/
19LINKAGE poly p_Mult_mm(poly p, const poly m, const ring ri)
20{
21  p_Test(p, ri);
22  p_LmTest(m, ri);
23  if (p == NULL) return NULL;
24  pAssume(m != NULL);
25  poly q = p;
26  number ln = pGetCoeff(m);
27  number pn;
28  DECLARE_LENGTH(const unsigned long length = ri->ExpL_Size);
29  const unsigned long* m_e = m->exp;
30  pAssume(!n_IsZero(ln,ri));
31
32  while (p != NULL)
33  {
34    pn = pGetCoeff(p);
35    pSetCoeff0(p, n_Mult(ln, pn, ri));
36    n_Delete(&pn, ri);
37    p_MemAdd(p->exp, m_e, length);
38    p_MemAddAdjust(p, ri);
39    p = pNext(p);
40  }
41  p_Test(q, ri);
42  return q;
43}
44
45
Note: See TracBrowser for help on using the repository browser.