Changeset 9a596d in git


Ignore:
Timestamp:
Jun 4, 1999, 3:06:28 PM (24 years ago)
Author:
Wilfred Pohl <pohl@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
650ffc4b7f35bd1a1609ce69829132028efa017a
Parents:
c801beb15dbf5f6a7997a33c6be813e2a7b471c1
Message:
det for sparse, bug fix


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

Legend:

Unmodified
Added
Removed
  • Singular/sparsmat.cc

    rc801be r9a596d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: sparsmat.cc,v 1.6 1999-06-02 14:09:34 pohl Exp $ */
     4/* $Id: sparsmat.cc,v 1.7 1999-06-04 13:06:28 pohl Exp $ */
    55
    66/*
     
    119119  void smPivDel();
    120120  void smSign();
     121  void smInitPerm();
    121122public:
    122123  sparse_mat(ideal);
     
    395396    return res;
    396397  }
     398  this->smInitPerm();
    397399  this->smPivot();
    398400  this->smSign();
     
    400402  this->sm1Elim();
    401403  crd++;
     404  m_res[crd] = piv;
    402405  this->smColDel();
    403406  act--;
     
    410413  if (act < 2)
    411414  {
     415    this->smFinalMult();
     416    this->smPivDel();
    412417    if (act != 0) res = m_act[1]->m;
    413418    Free((void *)m_act[1], sizeof(smprec));
     
    416421  loop
    417422  {
    418     m_res[crd] = piv;
    419423    this->smNewPivot();
    420424    this->smSign();
     
    423427    this->smHElim();
    424428    crd++;
     429    m_res[crd] = piv;
    425430    this->smColDel();
    426431    act--;
     
    434439    if (act < 2)
    435440    {
     441      this->smFinalMult();
    436442      this->smPivDel();
    437443      if (act != 0) res = m_act[1]->m;
     
    13761382void sparse_mat::smFinalMult()
    13771383{
    1378   smpoly a = m_act[act];
    1379   int e = crd;
     1384  smpoly a;
    13801385  poly ha;
    13811386  int i, f;
     1387  int e = crd;
    13821388
    13831389  for (i=act; i; i--)
     
    14561462void sparse_mat::smPivDel()
    14571463{
    1458   int i=crd-1;
     1464  int i=crd;
    14591465
    14601466  while (i != 0)
     
    14701476void sparse_mat::smSign()
    14711477{
    1472   int j,i=1;
    1473   if (cpiv!=act) sign=-sign;
    1474   if ((act%2)==0) sign=-sign;
    1475   j=perm[1];
    1476   while(j<rpiv)
    1477   {
    1478     sign=-sign;
    1479     i++;
    1480     j=perm[i];
    1481   }
    1482   while(perm[i]!=0)
    1483   {
    1484     perm[i]=perm[i+1];
    1485     i++;
    1486   }
     1478  int j,i;
     1479  if (act > 2)
     1480  {
     1481    if (cpiv!=act) sign=-sign;
     1482    if ((act%2)==0) sign=-sign;
     1483    i=1;
     1484    j=perm[1];
     1485    while(j<rpiv)
     1486    {
     1487      sign=-sign;
     1488      i++;
     1489      j=perm[i];
     1490    }
     1491    while(perm[i]!=0)
     1492    {
     1493      perm[i]=perm[i+1];
     1494      i++;
     1495    }
     1496  }
     1497  else
     1498  {
     1499    if (cpiv!=1) sign=-sign;
     1500    if (rpiv!=perm[1]) sign=-sign;
     1501  }
     1502}
     1503
     1504void sparse_mat::smInitPerm()
     1505{
     1506  int i;
     1507  for (i=act;i;i--) perm[i]=i;
    14871508}
    14881509
     
    20712092  }
    20722093}
     2094
Note: See TracChangeset for help on using the changeset viewer.