Changeset a5b215 in git


Ignore:
Timestamp:
Jan 19, 2002, 11:15:06 AM (22 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
bdafd27e3f8a34411bd9de93a6d81c235a0458ea
Parents:
80e295d6bdce8c8e1d59946a487bcf589264bd87
Message:
*hannes: Eval into fast_eval.cc


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

Legend:

Unmodified
Added
Removed
  • Singular/fast_maps.cc

    r80e295 ra5b215  
    77 *  Author:  obachman (Olaf Bachmann)
    88 *  Created: 02/01
    9  *  Version: $Id: fast_maps.cc,v 1.3 2002-01-19 09:54:51 Singular Exp $
     9 *  Version: $Id: fast_maps.cc,v 1.4 2002-01-19 10:15:06 Singular Exp $
    1010 *******************************************************************/
    1111#include "mod2.h"
     
    468468#endif
    469469
    470 /*****************************************************************
    471 * evaluate all monomial in the mapoly list,
    472 * put the results also into the corresponding sBuckets
    473 ******************************************************************/
    474 
    475 void mapolyEval(mapoly root)
    476 {
    477   // invert the list rooted at root:
    478   if ((root!=NULL) && (root->next!=NULL))
    479   {
    480     mapoly q=root->next;
    481     mapoly qn;
    482     root->next=NULL;
    483     do
    484     {
    485       qn=q->next;
    486       q->next=root;
    487       root=q;
    488     }
    489     while (qn !=NULL);
    490   }
    491 
    492   mapoly p=root;
    493   while (p!=NULL)
    494   {
    495      // look at each mapoly: compute its value in ->dest
    496      if (p->dest==NULL)
    497      {
    498        if (p->factors==0) p->dest=pOne();
    499        else if (p->factors==2)
    500        {
    501          poly f1=p->f1->dest;
    502          p->f1->ref--;
    503          poly f2=p->f2->dest;
    504          p->f2->ref--;
    505          if (p->f1->ref>0) f1=pCopy(f1);
    506          else
    507          {
    508            // clear p->f1
    509            p->f1->dest=NULL;
    510          }
    511          if (p->f2->ref>0) f2=pCopy(f2);
    512          else
    513          {
    514            // clear p->f2
    515            p->f2->dest=NULL;
    516          }
    517          p->dest=pMult(f1,f2);
    518       // substitute the monomial: go through macoeff
    519          int len=pLength(p->dest);
    520          macoeff c=p->coeff;
    521          macoeff cc;
    522          while (c!=NULL)
    523          {
    524            poly t=ppMult_nn(p->dest,c->n);
    525            sBucket_Add_p(c->bucket, t, len);
    526            cc=c;
    527            c=c->next;
    528            // clean up
    529            nDelete(&(cc->n));
    530            omFreeBin(cc,macoeffBin);
    531          }
    532          p->coeff=NULL;
    533        } /* p->factors==2 */
    534      } /* p->dest==NULL */
    535      p=p->next;
    536    }
    537 }
     470
Note: See TracChangeset for help on using the changeset viewer.