spielwiese
Last change
on this file since 009d80 was
009d80,
checked in by Oliver Wienand <wienand@…>, 17 years ago
|
new compile switch: HAVE_RINGS
at total there are now: HAVE_RINGS, HAVE_RING2TOM, HAVE_RINGMODN
kspoly.cc, kstd1.cc, kstd2.cc, kutil.cc, kspoly.cc, polys.cc, ring.*:
adaption of new switches and rField_is_Ring method
numbers.*:
introduced new operation:
nDivBy(a, b) = Is a divisible by b?
pDebig.cc, pInline1.h:
use of new nDivBy method
p_Mult_q:
new routine for rings
p_*, pp_*:
template switch HAVE_ZERODIVISOR
polys1.cc:
poly exponentation, switches
rmodulo*:
nDivBy implementation, DBTest
structs.h:
nDivBy, ringtype, ringflaga, ringflagb
git-svn-id: file:///usr/local/Singular/svn/trunk@10029 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[35aab3] | 1 | /**************************************** |
---|
| 2 | * Computer Algebra System SINGULAR * |
---|
| 3 | ****************************************/ |
---|
| 4 | /*************************************************************** |
---|
| 5 | * File: pp_Mult_mm__Template.cc |
---|
| 6 | * Purpose: template for p_Mult_n |
---|
| 7 | * Author: obachman (Olaf Bachmann) |
---|
| 8 | * Created: 8/00 |
---|
[009d80] | 9 | * Version: $Id: pp_Mult_mm__T.cc,v 1.5 2007-05-10 08:12:43 wienand Exp $ |
---|
[35aab3] | 10 | *******************************************************************/ |
---|
| 11 | |
---|
| 12 | /*************************************************************** |
---|
| 13 | * |
---|
| 14 | * Returns: p*m |
---|
| 15 | * Const: p, m |
---|
| 16 | * |
---|
| 17 | ***************************************************************/ |
---|
| 18 | LINKAGE poly pp_Mult_mm(poly p, const poly m, const ring ri, poly &last) |
---|
| 19 | { |
---|
| 20 | p_Test(p, ri); |
---|
| 21 | p_LmTest(m, ri); |
---|
| 22 | if (p == NULL) |
---|
| 23 | { |
---|
[009d80] | 24 | last = NULL; |
---|
[35aab3] | 25 | return NULL; |
---|
| 26 | } |
---|
| 27 | spolyrec rp; |
---|
| 28 | poly q = &rp, r; |
---|
| 29 | number ln = pGetCoeff(m); |
---|
| 30 | omBin bin = ri->PolyBin; |
---|
| 31 | DECLARE_LENGTH(const unsigned long length = ri->ExpL_Size); |
---|
| 32 | const unsigned long* m_e = m->exp; |
---|
| 33 | pAssume(!n_IsZero(ln,ri)); |
---|
| 34 | pAssume1(p_GetComp(m, ri) == 0 || p_MaxComp(p, ri) == 0); |
---|
[585bbcb] | 35 | number tmp; |
---|
[35aab3] | 36 | |
---|
| 37 | do |
---|
| 38 | { |
---|
[585bbcb] | 39 | tmp = n_Mult(ln, pGetCoeff(p), ri); |
---|
[009d80] | 40 | #ifdef HAVE_ZERODIVISORS |
---|
[994445] | 41 | if (! n_IsZero(tmp, ri)) |
---|
[511d4f] | 42 | { |
---|
[585bbcb] | 43 | #endif |
---|
| 44 | p_AllocBin( pNext(q), bin, ri); |
---|
| 45 | q = pNext(q); |
---|
| 46 | pSetCoeff0(q, tmp); |
---|
| 47 | p_MemSum(q->exp, p->exp, m_e, length); |
---|
| 48 | p_MemAddAdjust(q, ri); |
---|
[009d80] | 49 | #ifdef HAVE_ZERODIVISORS |
---|
[585bbcb] | 50 | } |
---|
| 51 | #endif |
---|
[35aab3] | 52 | p = pNext(p); |
---|
| 53 | } |
---|
| 54 | while (p != NULL); |
---|
| 55 | last = q; |
---|
| 56 | pNext(q) = NULL; |
---|
| 57 | |
---|
| 58 | p_Test(pNext(&rp), ri); |
---|
| 59 | return pNext(&rp); |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | |
---|
Note: See
TracBrowser
for help on using the repository browser.