Changeset 825d79 in git


Ignore:
Timestamp:
Nov 22, 1999, 2:45:36 PM (24 years ago)
Author:
Wilfred Pohl <pohl@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
b9852e81cb68a9fd3c0763e109b79e779ef2dffd
Parents:
8896c8d3b3c16233ca0935ff6c0f1ff4b9adca4f
Message:
bug fixed: zeros in elimination


git-svn-id: file:///usr/local/Singular/svn/trunk@3871 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/sparsmat.cc

    r8896c8 r825d79  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: sparsmat.cc,v 1.19 1999-11-22 12:40:03 Singular Exp $ */
     4/* $Id: sparsmat.cc,v 1.20 1999-11-22 13:45:36 pohl Exp $ */
    55
    66/*
     
    574574  if (tored != nrows)
    575575    this->smToredElim();
    576   if (act < y)
     576  if (act <= y)
    577577  {
    578578    this->smFinalMult();
     
    945945    loop                  // combine the chains a and b: p*a + w*b
    946946    {
    947       if (a->pos < b->pos)
    948       {
    949         res = res->n = a;
    950         a = a->n;
    951       }
    952       else if (a->pos > b->pos)
    953       {
    954         res = res->n = smElemCopy(b);
    955         res->m = smMult(b->m, w);
    956         res->e = 1;
    957         res->f = smPolyWeight(res);
    958         b = b->n;
    959       }
    960       else
    961       {
    962         ha = smMult(a->m, p);
    963         pDelete(&a->m);
    964         hb = smMult(b->m, w);
    965         ha = pAdd(ha, hb);
    966         if (ha != NULL)
    967         {
    968           a->m = ha;
    969           a->e = 1;
    970           a->f = smPolyWeight(a);
    971           res = res->n = a;
    972           a = a->n;
    973         }
    974         else
    975         {
    976           smElemDelete(&a);
    977         }
    978         b = b->n;
    979       }
    980       if (b == NULL)
    981       {
    982         res->n = a;
    983         break;
    984       }
    985947      if (a == NULL)
    986948      {
     
    995957        break;
    996958      }
     959      if (a->pos < b->pos)
     960      {
     961        res = res->n = a;
     962        a = a->n;
     963      }
     964      else if (a->pos > b->pos)
     965      {
     966        res = res->n = smElemCopy(b);
     967        res->m = smMult(b->m, w);
     968        res->e = 1;
     969        res->f = smPolyWeight(res);
     970        b = b->n;
     971      }
     972      else
     973      {
     974        ha = smMult(a->m, p);
     975        pDelete(&a->m);
     976        hb = smMult(b->m, w);
     977        ha = pAdd(ha, hb);
     978        if (ha != NULL)
     979        {
     980          a->m = ha;
     981          a->e = 1;
     982          a->f = smPolyWeight(a);
     983          res = res->n = a;
     984          a = a->n;
     985        }
     986        else
     987        {
     988          smElemDelete(&a);
     989        }
     990        b = b->n;
     991      }
     992      if (b == NULL)
     993      {
     994        res->n = a;
     995        break;
     996      }
    997997    }
    998998    m_act[r->pos] = dumm->n;
     
    10301030    loop                  // combine the chains a and b: (hp,gp)*a(l) + hr*b(h)
    10311031    {
     1032      if (a == NULL)
     1033      {
     1034        do
     1035        {
     1036          res = res->n = smElemCopy(b);
     1037          x = SM_MULT(b->m, hr, m_res[ir]->m);
     1038          b = b->n;
     1039          if(ir) SM_DIV(x, m_res[ir]->m);
     1040          res->m = x;
     1041          res->e = e;
     1042          res->f = smPolyWeight(res);
     1043        } while (b != NULL);
     1044        break;
     1045      }
    10321046      if (a->pos < b->pos)
    10331047      {
     
    11151129        break;
    11161130      }
    1117       if (a == NULL)
    1118       {
    1119         do
    1120         {
    1121           res = res->n = smElemCopy(b);
    1122           x = SM_MULT(b->m, hr, m_res[ir]->m);
    1123           b = b->n;
    1124           if(ir) SM_DIV(x, m_res[ir]->m);
    1125           res->m = x;
    1126           res->e = e;
    1127           res->f = smPolyWeight(res);
    1128         } while (b != NULL);
    1129         break;
    1130       }
    11311131    }
    11321132    m_act[r->pos] = dumm->n;
Note: See TracChangeset for help on using the changeset viewer.