source: git/Singular/p_Mult_mm__Template.cc @ 64eef3

fieker-DuValspielwiese
Last change on this file since 64eef3 was ec7aac, checked in by Olaf Bachmann <obachman@…>, 24 years ago
* replaced prProcs by fast poly procs * fixed various memory leaks * added dError stuff git-svn-id: file:///usr/local/Singular/svn/trunk@4565 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.1 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__Template.cc,v 1.2 2000-09-04 13:39:01 obachman Exp $
10 *******************************************************************/
11
12/***************************************************************
13 *
14 *   Returns:  p*m
15 *   Const:    m
16 *   Destroys: p 
17 *
18 ***************************************************************/
19poly p_Mult_mm(poly p, const poly m, const ring ri)
20{
21  pTest(p);
22  if (p == NULL) return NULL;
23  poly q = p;
24  number ln = pGetCoeff(m);
25  DECLARE_LENGTH(const unsigned long length = ri->ExpLSize);
26  const unsigned long* m_e = m->exp.l;
27  assume(!p_nIsZero(ln,r));
28
29  while (p != NULL)
30  {
31    pSetCoeff0(p, p_nMult(ln, pGetCoeff(p), ri));
32    p_MemIncr(p->exp.l, m_e, length);
33    p = pNext(p);
34  }
35  pTest(q);
36  return q;
37}
38
39
Note: See TracBrowser for help on using the repository browser.