Changeset f9241bf in git


Ignore:
Timestamp:
Nov 20, 2006, 10:20:21 AM (17 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
59b9615870d42298bc425c97176a54ee9c4e3b9d
Parents:
1731e390e73a68ff2ded83525e456e5bb72106ca
Message:
*hannes: optimize for sparse matrices


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

Legend:

Unmodified
Added
Removed
  • kernel/matpol.cc

    r1731e3 rf9241bf  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: matpol.cc,v 1.10 2006-11-18 12:58:00 Singular Exp $ */
     4/* $Id: matpol.cc,v 1.11 2006-11-20 09:20:21 Singular Exp $ */
    55
    66/*
     
    9292  {
    9393    t = a->m[i];
    94     pNormalize(t);
    95     b->m[i] = pCopy(t);
     94    if (t!=NULL)
     95    {
     96      pNormalize(t);
     97      b->m[i] = pCopy(t);
     98    }
    9699  }
    97100  b->rank=a->rank;
     
    147150  int k, n = a->nrows, m = a->ncols;
    148151
    149   pNormalize(p);
    150   for (k=m*n-1; k>0; k--)
    151   {
    152     if (a->m[k]!=NULL)
    153       a->m[k] = pMult(a->m[k], pCopy(p));
    154   }
    155   a->m[0] = pMult(a->m[0], p);
     152  if (p!=NULL)
     153  {
     154    pNormalize(p);
     155    for (k=m*n-1; k>0; k--)
     156    {
     157      if (a->m[k]!=NULL)
     158        a->m[k] = pMult(a->m[k], pCopy(p));
     159    }
     160    a->m[0] = pMult(a->m[0], p);
     161  }
     162  else
     163  {
     164    for (k=m*n-1; k>0; k--)
     165        pDelete(&a->m[k]);
     166  }
    156167  return a;
    157168}
Note: See TracChangeset for help on using the changeset viewer.