Changeset 07b6ac in git


Ignore:
Timestamp:
Feb 6, 2008, 1:51:41 PM (16 years ago)
Author:
Oliver Wienand <wienand@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
9b107f9206df58706364a2dae65b07124f9aa017
Parents:
8f2bd1fc11ce18b5be7a734f75309011e212a4d3
Message:
rmodulon.cc:
Change in init/setexp

p_Mult_mm__T.cc:
memory loss


git-svn-id: file:///usr/local/Singular/svn/trunk@10564 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/p_Mult_mm__T.cc

    r8f2bd1f r07b6ac  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 8/00
    9  *  Version: $Id: p_Mult_mm__T.cc,v 1.6 2007-05-10 08:12:42 wienand Exp $
     9 *  Version: $Id: p_Mult_mm__T.cc,v 1.7 2008-02-06 12:51:41 wienand Exp $
    1010 *******************************************************************/
    1111
     
    1919LINKAGE poly p_Mult_mm(poly p, const poly m, const ring ri)
    2020{
    21   poly before = p;
    2221  p_Test(p, ri);
    2322  p_LmTest(m, ri);
     
    3130  pAssume(!n_IsZero(ln,ri));
    3231
     32#ifdef HAVE_ZERODIVISORS
     33  poly before = p;
     34#endif
    3335  while (p != NULL)
    3436  {
     
    3840    if (n_IsZero(tmp, ri))
    3941    {
     42      n_Delete(&tmp, ri);
    4043      if (before == p)
    4144      {
    42         p = pNext(p);
     45        p = p_LmDeleteAndNext(p, ri);
    4346        before = p;
    4447        q = p;
     
    4649      else
    4750      {
    48         pNext(before) = pNext(p);
    49         p_LmFree(p, ri);
    50         p = pNext(before);
     51        p = p_LmDeleteAndNext(p, ri);
     52        pNext(before) = p;
    5153      }
    5254    }
  • kernel/rmodulon.cc

    r8f2bd1f r07b6ac  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: rmodulon.cc,v 1.17 2008-02-06 09:12:47 wienand Exp $ */
     4/* $Id: rmodulon.cc,v 1.18 2008-02-06 12:51:41 wienand Exp $ */
    55/*
    66* ABSTRACT: numbers modulo n
     
    346346  nrnBase = r->ringflaga;
    347347  nrnExponent = r->ringflagb;
    348   if (nrnModul != NULL)
    349   {
    350     nrnDelete((number*) &nrnModul, NULL);
    351     nrnDelete((number*) &nrnMinusOne, NULL);
    352   }
    353   nrnModul = (int_number) omAllocBin(gmp_nrn_bin); // evtl. spaeter mit bin
    354   mpz_init(nrnModul);
     348  if (nrnModul == NULL)
     349  {
     350    nrnModul = (int_number) omAllocBin(gmp_nrn_bin); // evtl. spaeter mit bin
     351    mpz_init(nrnModul);
     352    nrnMinusOne = (int_number) omAllocBin(gmp_nrn_bin); // evtl. spaeter mit bin
     353    mpz_init(nrnMinusOne);
     354  }
    355355  mpz_set_ull(nrnModul, nrnBase);
    356356  mpz_pow_ui(nrnModul, nrnModul, nrnExponent);
    357 
    358   nrnMinusOne = (int_number) omAllocBin(gmp_nrn_bin); // evtl. spaeter mit bin
    359   mpz_init(nrnMinusOne);
    360357  mpz_sub_ui(nrnMinusOne, nrnModul, 1);
    361358}
     
    366363  if (mpz_cmp_ui(nrnModul,2) <= 0)
    367364  {
    368     WarnS("nInitChar failed");
     365    WarnS("nInitExp failed");
    369366  }
    370367}
Note: See TracChangeset for help on using the changeset viewer.