Changeset 4d1104a in git


Ignore:
Timestamp:
Dec 13, 2010, 10:43:25 AM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
37dc41c7f4b75286366de8700dfb2d28d71976d0
Parents:
086654227485403024df3a1e3d43b341615c040d
Message:
enhancement for f*g suggested by Santiago

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

Legend:

Unmodified
Added
Removed
  • kernel/linearAlgebra.cc

    r0866542 r4d1104a  
    13211321     A*x = b with constant matrix A (as decomposed above). By theory, the
    13221322     system is guaranteed to have a unique solution. */
     1323  poly fg = ppMult_qq(f, g);   /* for storing the product of f and g */
    13231324  for (int xExp = 1; xExp <= d; xExp++)
    13241325  {
     
    13261327    matrix xVec = mpNew(n + m, 1);     /* x */
    13271328   
    1328     p = ppMult_qq(f, g);
     1329    p = pCopy(fg);
    13291330    p = pAdd(pCopy(h), pNeg(p));       /* p = h - f*g */
    13301331    /* we collect all terms in p with x-exponent = xExp and use their
     
    13481349      luSolveViaLUDecomp(pMat, lMat, uMat, bVec, xVec, notUsedMat);
    13491350      idDelete((ideal*)&notUsedMat);
    1350       /* augment f and g by newly computed terms */
     1351      /* update f and g by newly computed terms, and update f*g */
     1352      poly fNew = NULL; poly gNew = NULL;
    13511353      for (int row = 1; row <= m; row++)
    13521354      {
     
    13571359          pSetExp(p, yIndex, row - 1);        /* p = c * x^xExp * y^i   */
    13581360          pSetm(p);
    1359           g = pAdd(g, p);
     1361          gNew = pAdd(gNew, p);
    13601362        }
    13611363      }
     
    13681370          pSetExp(p, yIndex, row - m - 1);    /* p = c * x^xExp * y^i   */
    13691371          pSetm(p);
    1370           f = pAdd(f, p);
     1372          fNew = pAdd(fNew, p);
    13711373        }
    13721374      }
     1375      fg = pAdd(fg, ppMult_qq(f, gNew));
     1376      fg = pAdd(fg, ppMult_qq(g, fNew));
     1377      fg = pAdd(fg, ppMult_qq(fNew, gNew));
     1378      f = pAdd(f, fNew);
     1379      g = pAdd(g, gNew);
    13731380    }
    13741381    /* clean-up loop-dependent vectors */
     
    13761383  }
    13771384 
    1378   /* clean-up matrices A, P, L and U */
     1385  /* clean-up matrices A, P, L and U, and polynomial fg */
    13791386  idDelete((ideal*)&aMat); idDelete((ideal*)&pMat);
    13801387  idDelete((ideal*)&lMat); idDelete((ideal*)&uMat);
    1381 }
    1382 
     1388  pDelete(&fg);
     1389}
     1390
Note: See TracChangeset for help on using the changeset viewer.