Changeset 005d00a in git for kernel/gfan.cc


Ignore:
Timestamp:
Nov 16, 2009, 6:37:59 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
4fec744c03dbef2c7391aa71f10513ee2d3d96ab
Parents:
e7bc2f336cc15e7490e435edaaca6c95b8c97e58
Message:
have return type LIST_CMD


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    re7bc2f r005d00a  
    101101               
    102102/** \brief Constructor for facets of codim >= 2
     103* Note that as of now the code of the constructors is only for facets and codim2-faces. One
     104* could easily change that by renaming numCodim2Facets to numCodimNminusOneFacets or similar
    103105*/
    104106facet::facet(int const &n)
     
    756758        // The inequalities are now stored in ddineq
    757759        // Next we check for superflous rows
    758         time_t canonicalizeTic, canonicalizeTac;
    759         time(&canonicalizeTic);
     760//      time_t canonicalizeTic, canonicalizeTac;
     761//      time(&canonicalizeTic);
    760762//      ddredrows = dd_RedundantRows(ddineq, &dderr);
    761763//      if (dderr!=dd_NoError)                  // did an error occur?
     
    774776               
    775777        dd_MatrixCanonicalize(&ddineq, &ddlinset, &ddredrows, &ddnewpos, &dderr);
    776         time(&canonicalizeTac);
    777         cout << "dd_MatrixCanonicalize time: " << difftime(canonicalizeTac,canonicalizeTic) << "sec" << endl;
     778//      time(&canonicalizeTac);
     779//      cout << "dd_MatrixCanonicalize time: " << difftime(canonicalizeTac,canonicalizeTic) << "sec" << endl;
    778780        ddrows = ddineq->rowsize;       //Size of the matrix with redundancies removed
    779781        ddcols = ddineq->colsize;
     
    20362038                while(fAct!=NULL)
    20372039                {       //Since SLA should only contain flippables there should be no need to check for that
    2038                         time(&tic);
     2040                       
    20392041                        gcAct->flip(gcAct->gcBasis,fAct);
    2040                         time(&tac);
    2041                         cout << "t_flip = " << difftime(tac,tic) << endl;
     2042                       
     2043                       
    20422044                        ring rTmp=rCopy(fAct->flipRing);
    20432045                        rComplete(rTmp);                       
     
    20542056//                      idDelete((ideal *)&fAct->flipGB);
    20552057//                      rDelete(fAct->flipRing);
    2056                         time(&tic);
    2057                         gcTmp->getConeNormals(gcTmp->gcBasis, FALSE);                                   
    2058                         time(&tac);
    2059                         cout << "t_getConeNormals = " << difftime(tac,tic) << endl;
    2060                         gcTmp->getCodim2Normals(*gcTmp);                                       
     2058                       
     2059                        gcTmp->getConeNormals(gcTmp->gcBasis, FALSE);   
     2060                        gcTmp->getCodim2Normals(*gcTmp);
    20612061                        gcTmp->normalize();
    20622062#ifdef gfan_DEBUG
     
    28972897// }
    28982898
     2899void gcone::lprepareResult(lists l, gcone &gc)
     2900{
     2901        gcone *gcAct;
     2902        gcAct = &gc;
     2903        matrix mFacetNormal=mpNew(counter,gc.numVars);
     2904       
     2905        facet *fAct;
     2906        fAct = gc.facetPtr;
     2907        while( gcAct!=NULL )
     2908        {
     2909                l->m[0].data=(int*)gc.getUCN();
     2910                l->m[1].data=(intvec*)(&gcAct->f2M(gcAct,gcAct->facetPtr));
     2911                gcAct = gcAct->next;
     2912        }
     2913}
     2914/** \brief Write facets of a cone into a matrix
     2915* Takes a pointer to a facet as 2nd arg in order to determine whether
     2916* it operates in codim 1 or 2
     2917*/
     2918intvec gcone::f2M(gcone *gc, facet *f)
     2919{
     2920        facet *fAct;
     2921        int codim=1;
     2922        if(f==gc->facetPtr)
     2923                fAct = gc->facetPtr;
     2924        else
     2925        {
     2926                fAct = gc->facetPtr->codim2Ptr;
     2927                codim=2;
     2928        }
     2929        intvec mRes=new intvec(counter,gc->numVars,0);//nrows==counter, ncols==numVars
     2930        intvec *fNormal = new intvec(this->numVars);
     2931        for(int ii=0;ii<gc->numFacets*(this->numVars);ii++)
     2932        {
     2933                fNormal=fAct->getFacetNormal();
     2934                for(int jj=0;jj<this->numVars ;jj++ )
     2935                {                       
     2936                        mRes[ii]=(*fNormal)[jj];
     2937                        ii++;
     2938                }
     2939                fAct = fAct->next;
     2940        }
     2941        return mRes;
     2942}
    28992943
    29002944int gcone::counter=0;
    29012945int gfanHeuristic;
    2902 ideal gfan(ideal inputIdeal, int h)
     2946// ideal gfan(ideal inputIdeal, int h)
     2947lists gfan(ideal inputIdeal, int h)
    29032948{
    29042949        lists lResList=(lists)omAllocBin(slists_bin);
     
    29062951        lResList->m[0].rtyp=INT_CMD;
    29072952        lResList->m[0].data=(int*)255;
    2908         lResList->m[1].rtyp=MATRIX_CMD;
    2909         lResList->m[1].data=(void*)NULL;
     2953        lResList->m[1].rtyp=INTVEC_CMD;
     2954        lResList->m[1].data=(intvec*)NULL;
    29102955        lResList->m[2].rtyp=IDEAL_CMD;
    29112956        lResList->m[2].data=(ideal*)NULL;
     
    30023047                //Below is a workaround, since gcAct->gcBasis gets deleted in noRevS
    30033048                res = inputIdeal;
     3049//              intvec mRes=gcRoot->f2M(gcRoot,gcRoot->facetPtr);
     3050                gcRoot->lprepareResult(lResList,*gcRoot);
    30043051        }
    30053052        dd_free_global_constants();
     3053       
    30063054        /*As of now extra.cc expects gfan to return type ideal. Probably this will change in near future.
    30073055        The return type will then be of type LIST_CMD
     
    30143062        //res=gcAct->gcBasis;
    30153063        //res=gcRoot->gcBasis; 
    3016         return res;
     3064//      return res;
     3065        return lResList;
    30173066        //return GBlist;
    30183067}
Note: See TracChangeset for help on using the changeset viewer.