Changeset 4042c2 in git for kernel


Ignore:
Timestamp:
Oct 1, 2009, 8:36:23 AM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
ac6e45db1f490e638b067d932fc2c4100bc9526c
Parents:
a51188ce7774d67642def70c783997021d31d082
Message:
Cleanup in normalize, makeInt, dotProduct, ivNeg and isFlippable
Changed facet->getUCN to hopefully honor 32/64 bit


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    ra51188 r4042c2  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-09-29 06:03:16 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.90 2009-09-29 06:03:16 monerjan Exp $
    6 $Id: gfan.cc,v 1.90 2009-09-29 06:03:16 monerjan Exp $
     4$Date: 2009-10-01 06:36:23 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.91 2009-10-01 06:36:23 monerjan Exp $
     6$Id: gfan.cc,v 1.91 2009-10-01 06:36:23 monerjan Exp $
    77*/
    88
     
    6060
    6161#ifndef gfan_DEBUG
    62 //#define gfan_DEBUG
     62#define gfan_DEBUG
    6363#ifndef gfan_DEBUGLEVEL
    6464#define gfan_DEBUGLEVEL 1
     
    255255                int getUCN()
    256256                {
    257                         if(this!=NULL && this!=(facet *)0xfbfbfbfbfbfbfbfb)
     257                        if(this!=NULL && ( this!=0xfbfbfbfb || this!=(facet *)0xfbfbfbfbfbfbfbfb) )
    258258                                return this->UCN;
    259259                        else
     
    309309                        }
    310310                        cout << "=======================" << endl;
    311                 }
    312                
    313                 /*bool isFlippable(intvec &load)
    314                 {
    315                         bool res=TRUE;                 
    316                         int jj;
    317                         for (int jj = 0; jj<load.length(); jj++)
    318                         {
    319                                 intvec *ivCanonical = new intvec(load.length());
    320                                 (*ivCanonical)[jj]=1;                           
    321                                 if (ivMult(&load,ivCanonical)<0)
    322                                 {
    323                                         res=FALSE;
    324                                         break;
    325                                 }
    326                         }
    327                         return res;
    328                        
    329                         /*while (dotProduct(load,ivCanonical)>=0)
    330                         {
    331                                 if (jj!=this->numVars)
    332                                 {
    333                                         intvec *ivCanonical = new intvec(this->numVars);
    334                                         (*ivCanonical)[jj]=1;                   
    335                                         res=TRUE;
    336                                         jj += 1;
    337                                 }
    338                         }
    339                         if (jj==this->numVars)
    340                         {                       
    341                                 delete ivCanonical;
    342                                 return FALSE;
    343                         }
    344                         else
    345                         {
    346                                 delete ivCanonical;
    347                                 return TRUE;
    348                 }*/                                             
    349                 //}//bool isFlippable(facet &f)
    350                
     311                }               
    351312               
    352313                friend class gcone;     //Bad style
     
    12361197                        rComplete(dstRing);                                     
    12371198                        rChangeCurrRing(dstRing);
    1238                         rDelete(tmpRing);
     1199                        //rDelete(tmpRing);
    12391200                        delete iv_weight;
    12401201//#ifdef gfan_DEBUG
     
    12741235//#endif                       
    12751236                        rChangeCurrRing(srcRing);       //return to the ring we started the computation of flipGB in
    1276                         rDelete(dstRing);
     1237//                      rDelete(dstRing);
    12771238                }//void flip(ideal gb, facet *f)
    12781239                               
     
    13991360                        intvec *res = new intvec(iv->length());
    14001361                        res=ivCopy(iv);
    1401                         *res *= (int)-1;
    1402                         //for(int ii=0;ii<this->numVars;ii++)
    1403                         //{                     
    1404                                 //(res)[ii] = (*res[ii])*(int)(-1);
    1405                         //}
    1406                         //res->show(1,0);                       
     1362                        *res *= (int)-1;                                               
    14071363                        return res;
    14081364                }
     
    14131369                */
    14141370                int dotProduct(intvec const &iva, intvec const &ivb)                           
    1415                 {
    1416                         //intvec iva=a;
    1417                         //intvec ivb=b;
     1371                {                       
    14181372                        int res=0;
    14191373                        for (int i=0;i<this->numVars;i++)
     
    18901844                        We always choose the first facet from fListPtr as facet to be flipped
    18911845                        */                     
    1892                         while((SearchListAct!=NULL))// && counter<160)
     1846                        while((SearchListAct!=NULL))// && counter<10)
    18931847                        {//NOTE See to it that the cone is only changed after ALL facets have been flipped!                             
    18941848                                fAct = SearchListAct;
    1895                                 //while( ( (fAct->next!=NULL) && (fAct->getUCN()==fAct->next->getUCN() ) ) )
    1896                                 //do
     1849                               
    18971850                                while(fAct!=NULL)
    18981851                                {       //Since SLA should only contain flippables there should be no need to check for that
     
    19161869#endif
    19171870                                        rChangeCurrRing(gcAct->baseRing);
    1918                                         rDelete(rTmp);
     1871                                        //rDelete(rTmp);
    19191872                                        gcPtr->next=gcTmp;
    19201873                                        gcPtr=gcPtr->next;
     
    19861939                                mpz_clear(z);                           
    19871940                        }
    1988                        
    1989                         //Check whether denom is all ones, in which case we will divide out the gcd of the nominators
    1990 //                      mpz_t checksum; mpz_t rop;
    1991 //                      mpz_init(checksum);
    1992 //                      mpz_init(rop);
    1993 //                      bool divideOutGcd=FALSE;
    1994 //                      for(int ii=0;ii<this->numVars;ii++)
    1995 //                      {
    1996 //                              mpz_add(rop, checksum, denom[ii]);
    1997 //                              mpz_set(checksum, rop);
    1998 //                      }
    1999 //                      if( (int)mpz_get_ui(checksum)==this->numVars)
    2000 //                      {
    2001 //                              divideOutGcd=TRUE;
    2002 //                      }
    2003                        
     1941                                               
    20041942                        /*Compute lcm of the denominators*/
    20051943                        mpz_set(tmp,denom[0]);
     
    20662004                                fAct = fAct->next;
    20672005                        }
    2068                
    2069                         //delete n;
    2070                         /*codim2Act = this->facetPtr->codim2Ptr;        //reset to start of linked list                 
    2071                         while(codim2Act!=NULL)
    2072                         {                               
    2073                                 n=codim2Act->getFacetNormal();
    2074                                 intvec *new_n = new intvec(this->numVars);
    2075                                 for(int ii=0;ii<this->numVars;ii++)
    2076                                 {
    2077                                         (*new_n)[ii] = (*n)[ii]*ggT;
    2078                                 }
    2079                                 codim2Act->setFacetNormal(new_n);
    2080                                 codim2Act = codim2Act->next;
    2081                                 //delete n;
    2082                                 //delete new_n;
    2083                         }       */             
     2006                               
    20842007                }
    20852008                /** \brief Enqueue new facets into the searchlist
     
    22072130                                        //while(slAct!=slEndStatic->next)
    22082131                                        {
     2132//                                              if(deleteMarker!=NULL)
     2133//                                              {
     2134//                                                      delete deleteMarker;
     2135//                                                      deleteMarker=NULL;
     2136//                                              }
    22092137                                                removalOccured=FALSE;
    22102138                                                slNormal = slAct->getFacetNormal();
     
    22882216                                                                lengthOfSearchList--;
    22892217                                                                //delete slAct;
     2218                                                                //slAct=NULL;
    22902219                                                                //slAct = slAct->next; //not needed, since facets are equal
    22912220                                                                //delete deleteMarker;
     
    23222251                                                slAct = slAct->next;*/                                         
    23232252                                                //delete deleteMarker;
    2324                                                 deleteMarker=NULL;
     2253                                                //deleteMarker=NULL;
    23252254                                                //if slAct was marked as to be deleted, delete it here!
    23262255                                        }//while(slAct!=NULL)                                                                   
Note: See TracChangeset for help on using the changeset viewer.