Changeset f07b38c in git


Ignore:
Timestamp:
Nov 23, 2009, 3:15:52 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
d945f30c526b2f3c4c937f5acb82e282284898d9
Parents:
cef1fb8a6b684adbc201e50f3ee51a42e97ee1f6
Message:
~gcone
No more output by default
gcTmp->gcBasis->m[ii]=(poly)NULL;
repaired creation of polys with rational coeffs


git-svn-id: file:///usr/local/Singular/svn/trunk@12314 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rcef1fb rf07b38c  
    6464
    6565#ifndef gfan_DEBUG
    66 //#define gfan_DEBUG
     66// #define gfan_DEBUG 1
    6767#ifndef gfan_DEBUGLEVEL
    6868#define gfan_DEBUGLEVEL 1
     
    377377//      if (this->rootRing!=NULL && this->rootRing!=(ip_sring *)0xfefefefefefefefe)
    378378//              rDelete(this->rootRing);
    379         //rDelete(this->baseRing);
     379//      if(this->UCN!=1)
     380//              rDelete(this->baseRing);
    380381        facet *fAct;
    381382        facet *fDel;
     
    389390                delete fDel;
    390391        }
     392        this->counter--;
     393        dd_FreeMatrix(this->ddFacets);
    391394        //dd_FreeMatrix(this->ddFacets);
    392395}                       
     
    447450               
    448451/** For debugging purposes only */
    449 void gcone::showSLA(facet &f)
     452volatile void gcone::showSLA(facet &f)
    450453{
    451454        facet *fAct;
     
    952955        fNormal = f->getFacetNormal();  //read this->fNormal;
    953956
    954         std::cout << "running gcone::flip" << std::endl;
    955         std::cout << "flipping UCN " << this->getUCN() << endl;
    956         cout << "over facet (";
    957         fNormal->show(1,0);
    958         cout << ") with UCN " << f->getUCN();
    959         std::cout << std::endl;
     957//      std::cout << "running gcone::flip" << std::endl;
     958//      std::cout << "flipping UCN " << this->getUCN() << endl;
     959//      cout << "over facet (";
     960//      fNormal->show(1,0);
     961//      cout << ") with UCN " << f->getUCN();
     962//      std::cout << std::endl;
    960963
    961964        /*1st step: Compute the initial ideal*/
     
    12161219        f->flipRing=rCopy(dstRing);     //store the ring on the other side
    12171220//#ifdef gfan_DEBUG
    1218         cout << "Flipped GB is UCN " << counter+1 << ":" << endl;
     1221//      cout << "Flipped GB is UCN " << counter+1 << ":" << endl;
    12191222//      this->idDebugPrint(dstRing_I);
    12201223//      cout << endl;
     
    17231726                        gcTmp->showFacets(1);
    17241727#endif
     1728                        /*add facets to SLA here*/
     1729                        SearchListRoot=gcTmp->enqueueNewFacets(*SearchListRoot);
     1730                       
    17251731                        if(gfanHeuristic==1)
    17261732                        {
    17271733                                gcTmp->writeConeToFile(*gcTmp);
     1734//                              idDelete((ideal*)&gcTmp->gcBasis);
     1735                                for(int ii=0;ii<IDELEMS(gcTmp->gcBasis);ii++)
     1736                                {
     1737                                        gcTmp->gcBasis->m[ii]=(poly)NULL;
     1738                                }
    17281739                        }
    1729                         /*add facets to SLA here*/
    1730                         SearchListRoot=gcTmp->enqueueNewFacets(*SearchListRoot);
    1731 #ifdef gfan_DEBUG
     1740                       
     1741#if gfan_DEBUG
    17321742                        if(SearchListRoot!=NULL)
    17331743                                gcTmp->showSLA(*SearchListRoot);
     
    17661776                                {
    17671777                                        deleteMarker = gcHead;
    1768                                         gcHead = gcNext->next;
     1778//                                      gcHead = gcNext->next;
    17691779                                        //gcNext->next->prev = NULL;
    17701780                                }
     
    17721782                                {
    17731783                                        deleteMarker = gcNext;
    1774                                         gcNext->prev->next = gcNext->next;
    1775                                         gcNext->next->prev = gcNext->prev;
     1784//                                      gcNext->prev->next = gcNext->next;
     1785//                                      gcNext->next->prev = gcNext->prev;
    17761786                                }
    17771787//                              gcNext = gcNext->next;
     
    17941804                                        gcAct = gcNext;
    17951805                                        //implant the GB into gcAct
    1796                                         readConeFromFile(gcNext->getUCN(), gcAct);
     1806                                        readConeFromFile(gcAct->getUCN(), gcAct);
    17971807                                        rAct=rCopy(gcAct->baseRing);
    17981808                                        rComplete(rAct);
     
    24532463                                while(!line.empty())
    24542464                                {
     2465//                                      resPoly=pInit();
     2466//                                      strPoly=pInit();
    24552467                                        hasNegCoeff = FALSE;
     2468                                        hasCoeffInQ = FALSE;
    24562469                                        found = line.find_first_of("+-");       //get the first monomial
    24572470                                        string tmp;
     
    24732486                                                hasCoeffInQ = TRUE;
    24742487                                                strCoeffNom=strMonom.substr(0,found);                                           
    2475                                                 strCoeffDenom=strMonom.substr(found+1,strMonom.find_first_not_of("1234567890"));
     2488                                                strCoeffDenom=strMonom.substr(found+1,strMonom.find_first_not_of("1234567890",found+1));
    24762489                                                strMonom.erase(0,found);
    24772490                                                strMonom.erase(0,strMonom.find_first_not_of("1234567890/"));                   
     
    25412554                                }//while(!line.empty())         
    25422555                       
    2543                                 gcBasis->m[jj]=pCopy(resPoly);
     2556                                gc->gcBasis->m[jj]=pCopy(resPoly);
    25442557                                resPoly=NULL;   //reset
    25452558                        }
     
    25862599                l->m[0].data=(void*)gcAct->getUCN();
    25872600                l->m[1].rtyp=IDEAL_CMD;
     2601                /*The following is necessary for leaves in the tree of cones
     2602                * Since we don't use them in the computation and gcBasis is
     2603                * set to (poly)NULL in noRevS we need to get this back here.
     2604                */
     2605                if(gcAct->gcBasis->m[0]==(poly)NULL)
     2606                        gcAct->readConeFromFile(gcAct->getUCN(),gcAct);
    25882607                l->m[1].data=(void*)idrCopyR_NoSort(gcAct->gcBasis,gcAct->getBaseRing());
    2589                
     2608
    25902609                l->m[2].rtyp=INTVEC_CMD;
    25912610                intvec iv=(gcAct->f2M(gcAct,gcAct->facetPtr));
     
    27172736                res = inputIdeal;
    27182737                lResList=lprepareResult(gcRoot,gcRoot->getCounter());
    2719 //              res=lResList;
     2738                /*Cleanup*/
     2739                gcone *gcDel;   
     2740                gcDel = gcRoot;
     2741                gcAct = gcRoot;
     2742                do
     2743                {
     2744                        gcDel = gcAct;
     2745                        gcAct = gcAct->next;
     2746                        delete gcDel;
     2747                }while(gcAct!=NULL);
    27202748        }
    27212749        dd_free_global_constants();
     
    27302758        }
    27312759       
     2760        /*Return result*/
    27322761        return lResList;
    27332762}
  • kernel/gfan.h

    rcef1fb rf07b38c  
    165165                int getPredUCN();               
    166166                void showFacets(short codim=1);
    167                 void showSLA(facet &f);
     167                volatile void showSLA(facet &f);
    168168                void idDebugPrint(ideal const &I);
    169169                void invPrint(ideal const &I);
Note: See TracChangeset for help on using the changeset viewer.