Changeset af2ba9 in git


Ignore:
Timestamp:
Feb 21, 2007, 9:35:09 AM (16 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
70277379762db41e3a5a883007bbfa96f58a8be9
Parents:
82244545f2799f63a8fa69c4b3834e3c23f6121c
Message:
*bricken: npIsZero eliminated


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

Legend:

Unmodified
Added
Removed
  • kernel/tgb.cc

    r822445 raf2ba9  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb.cc,v 1.142 2007-02-21 07:05:45 bricken Exp $ */
     7/* $Id: tgb.cc,v 1.143 2007-02-21 08:35:09 bricken Exp $ */
    88/*
    99* ABSTRACT: slimgb and F4 implementation
     
    18651865int modP_lastIndexRow(number* row,int ncols){
    18661866  int lastIndex;
     1867  number zero=npInit(0);
    18671868  for(lastIndex=ncols-1;lastIndex>=0;lastIndex--){
    1868     if (!(npIsZero(row[lastIndex]))){
     1869    if (!(row[lastIndex]==zero)){
    18691870      return lastIndex;
    18701871    }
     
    19111912    //assume rows "under r" have bigger or equal start index
    19121913    number* row_array=rows[r];
    1913 
     1914    number zero=npInit(0);
    19141915    int start=startIndices[r];
    19151916    number coef=row_array[start];
     
    19301931        if (coef2==minus_one){
    19311932          for(i=start;i<=lastIndex;i++){
    1932             other_row_array[i]=npSub(other_row_array[i], row_array[i]);
     1933            if (row_array[i]!=zero)
     1934              other_row_array[i]=npSubM(other_row_array[i], row_array[i]);
    19331935          }
    19341936      }else {
    19351937          //assume(FALSE);
    19361938          for(i=start;i<=lastIndex;i++){
     1939            if (row_array[i]!=zero)
    19371940            other_row_array[i]=npAddM(npMult(coef2,row_array[i]),other_row_array[i]);
    19381941          }
     
    20402043    int start=startIndices[r];
    20412044    assume(start<ncols);
    2042    
     2045    number zero=npInit(0);
    20432046    number* row_array=rows[r];
    20442047    assume((!(npIsZero(row_array[start]))));
     
    20612064        assume(start>startIndices[other_row]);
    20622065        for(i=start;i<=lastIndex;i++){
    2063           other_row_array[i]=npAddM(npMult(coef,row_array[i]),other_row_array[i]);
     2066          if (row_array[i]!=zero)
     2067            other_row_array[i]=npAddM(npMult(coef,row_array[i]),other_row_array[i]);
    20642068        }
    20652069        updateLastReducibleIndex(other_row,r);
     
    21132117  poly h=NULL;
    21142118  int j;
     2119  number zero=npInit(0);
    21152120  for(j=tn-1;j>=0;j--){
    2116     if (!(npIsZero(row[j]))){
     2121    if (!(zero==(row[j]))){
    21172122      poly t=terms[j];
    21182123      t=p_LmInit(t,r);
     
    31563161  }
    31573162  #endif
    3158   if (TEST_OPT_PROT)
    3159     Print("Evaluate Rows \n");
     3163  //if (TEST_OPT_PROT)
     3164  //  Print("Evaluate Rows \n");
    31603165  #ifndef NORO_NON_POLY
    31613166  cache.evaluateRows();
Note: See TracChangeset for help on using the changeset viewer.