Changeset 398e35 in git


Ignore:
Timestamp:
Jul 22, 2009, 11:57:23 AM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
9be65c2f015f278636f0f197b120707fa72d825f
Parents:
c17211fd987aecab4e77b072748408f46325a27b
Message:
Complete tailreduction for getGB of input
Fix for empty SLA while fAct!=NULL


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rc17211 r398e35  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-07-21 15:56:28 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.79 2009-07-21 15:56:28 monerjan Exp $
    6 $Id: gfan.cc,v 1.79 2009-07-21 15:56:28 monerjan Exp $
     4$Date: 2009-07-22 09:57:23 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.80 2009-07-22 09:57:23 monerjan Exp $
     6$Id: gfan.cc,v 1.80 2009-07-22 09:57:23 monerjan Exp $
    77*/
    88
     
    534534                int getUCN()
    535535                {
    536                         return this->UCN;
     536                        if(this!=NULL)
     537                                return this->UCN;
     538                        else
     539                                return -1;
    537540                }
    538541               
     
    11721175#endif
    11731176                        ideal dstRing_I;                       
    1174                         dstRing_I=idrCopyR(srcRing_HH,srcRing);                 
     1177                        dstRing_I=idrCopyR(srcRing_HH,srcRing);
     1178                        //dstRing_I=idrCopyR(inputIdeal,srcRing);
    11751179                        //validOpts<1>=TRUE;
    11761180#ifdef gfan_DEBUG
     
    11791183                        BITSET save=test;
    11801184                        test|=Sy_bit(OPT_REDSB);
     1185                        test|=Sy_bit(OPT_REDTAIL);
    11811186                        test|=Sy_bit(6);        //OPT_DEBUG
    11821187                        ideal tmpI;
    11831188                        tmpI = idrCopyR(this->inputIdeal,this->baseRing);                               
    11841189                        dstRing_I=kStd(tmpI,NULL,testHomog,NULL);                                       
    1185                         kInterRed(dstRing_I);
     1190                        //kInterRed(dstRing_I);
    11861191                        idSkipZeroes(dstRing_I);
    11871192                        test=save;
     
    12951300                *\return void
    12961301                */
    1297                 void getGB(ideal const &inputIdeal)
    1298                 {
     1302                void getGB(ideal const &inputIdeal)             
     1303                {
     1304                        BITSET save=test;
     1305                        test|=Sy_bit(OPT_REDSB);
     1306                        test|=Sy_bit(OPT_REDTAIL);
    12991307                        ideal gb;
    13001308                        gb=kStd(inputIdeal,NULL,testHomog,NULL);
    13011309                        idSkipZeroes(gb);
    13021310                        this->gcBasis=gb;       //write the GB into gcBasis
     1311                        test=save;
    13031312                }//void getGB
    13041313               
     
    20122021                        facet *sl2Act;
    20132022                        sl2Act = f.codim2Ptr;
     2023                        facet *deleteMarker;
     2024                        deleteMarker = NULL;
    20142025                       
    20152026                        bool doNotAdd=FALSE;
     
    20382049                                        slAct = slHead;
    20392050                                        notParallelCtr=0;
     2051                                        /*If slAct==NULL and fAct!=NULL
     2052                                        we just copy all remaining facets into SLA*/
     2053                                        if(slAct==NULL)
     2054                                        {
     2055                                                facet *fCopy;
     2056                                                fCopy = fAct;
     2057                                                while(fCopy!=NULL)
     2058                                                {
     2059                                                        if(slAct==NULL)
     2060                                                        {
     2061                                                                slAct = new facet();
     2062                                                                slHead = slAct;                                                         
     2063                                                        }
     2064                                                        else
     2065                                                        {
     2066                                                                slAct->next = new facet();
     2067                                                                slAct = slAct->next;
     2068                                                        }                                                       
     2069                                                        slAct->setFacetNormal(fAct->getFacetNormal());
     2070                                                        slAct->setUCN(fAct->getUCN());
     2071                                                        slAct->isFlippable=fAct->isFlippable;
     2072                                                        facet *f2Copy;
     2073                                                        f2Copy = fCopy->codim2Ptr;
     2074                                                        sl2Act = slAct->codim2Ptr;
     2075                                                        while(f2Copy!=NULL)
     2076                                                        {
     2077                                                                if(sl2Act==NULL)
     2078                                                                {
     2079                                                                        sl2Act = new facet(2);
     2080                                                                        slAct->codim2Ptr = sl2Act;                                     
     2081                                                                }
     2082                                                                else
     2083                                                                {
     2084                                                                        facet *marker;
     2085                                                                        marker = sl2Act;
     2086                                                                        sl2Act->next = new facet(2);
     2087                                                                        sl2Act = sl2Act->next;
     2088                                                                        sl2Act->prev = marker;
     2089                                                                }
     2090                                                                sl2Act->setFacetNormal(f2Copy->getFacetNormal());
     2091                                                                sl2Act->setUCN(f2Copy->getUCN());
     2092                                                                f2Copy = f2Copy->next;
     2093                                                        }
     2094                                                        fCopy = fCopy->next;
     2095                                                }
     2096                                                break;
     2097                                        }
     2098                                        /*End of */
    20402099                                        while(slAct!=NULL)
    20412100                                        //while(slAct!=slEndStatic->next)
     
    20832142                                                                removalOccured=TRUE;
    20842143                                                                slAct->isFlippable=FALSE;
    2085                                                                 doNotAdd=TRUE;
     2144                                                                doNotAdd=TRUE;                                                         
    20862145                                                                if(slAct==slHead)       //We want to delete the first element of SearchList
    2087                                                                 {                                                               
    2088                                                                         slHead = slAct->next;
     2146                                                                {
     2147                                                                        deleteMarker = slHead;                         
     2148                                                                        slHead = slAct->next;                                           
    20892149                                                                        if(slHead!=NULL)
    2090                                                                                 slHead->prev = NULL;
     2150                                                                                slHead->prev = NULL;                                   
    20912151                                                                        //set a bool flag to mark slAct as to be deleted
    2092                                                                 }
     2152                                                                }//NOTE find a way to delete without affecting slAct = slAct->next
    20932153                                                                else if(slAct==slEndStatic)
    2094                                                                         {
     2154                                                                        {                                                       
    20952155                                                                                if(slEndStatic->next==NULL)
    2096                                                                                 {
     2156                                                                                {                                                       
    20972157                                                                                        slEndStatic = slEndStatic->prev;
    20982158                                                                                        slEndStatic->next = NULL;
     
    21082168                                                                else
    21092169                                                                {
     2170                                                                        deleteMarker = slAct;
    21102171                                                                        slAct->prev->next = slAct->next;
    21112172                                                                        slAct->next->prev = slAct->prev;
    21122173                                                                }
     2174                                                               
    21132175                                                                //update lengthOfSearchList                                     
    21142176                                                                lengthOfSearchList--;
     
    21222184                                                }//if(!isParallel(fNormal, slNormal))
    21232185                                                slAct = slAct->next;
     2186                                                delete deleteMarker;
     2187                                                deleteMarker=NULL;
    21242188                                                //if slAct was marked as to be deleted, delete it here!
    21252189                                        }//while(slAct!=NULL)                                                                   
Note: See TracChangeset for help on using the changeset viewer.