Changeset 2b7bb5d in git


Ignore:
Timestamp:
Apr 1, 2009, 4:07:20 PM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '3720ae8bfcff4a4649ee98a15552089151d2d59b')
Children:
7bd7795642f49e279d1fb82377b04df64f84a771
Parents:
798f72186f85eaf9224aef1590336c69ccc6a3f9
Message:
Continued work on gcone::flip - HIGHLY EXPERIMENTAL CODE!
Added public variable gcone::numVars to store #of variables
Began work on bool gcone::isParallel


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r798f721 r2b7bb5d  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-03-31 09:59:14 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.25 2009-03-31 09:59:14 monerjan Exp $
    6 $Id: gfan.cc,v 1.25 2009-03-31 09:59:14 monerjan Exp $
     4$Date: 2009-04-01 14:07:20 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.26 2009-04-01 14:07:20 monerjan Exp $
     6$Id: gfan.cc,v 1.26 2009-04-01 14:07:20 monerjan Exp $
    77*/
    88
     
    103103{
    104104        private:
    105                 int numFacets;          //#of facets of the cone
     105                int numFacets;          //#of facets of the cone               
    106106
    107107        public:
     
    116116                }
    117117                ~gcone();               //destructor
     118               
    118119                /** Pointer to the first facet */
    119                 facet *facetPtr;        //Will hold the adress of the first facet
     120                facet *facetPtr;        //Will hold the adress of the first facet; set by gcone::getConeNormals
    120121                poly gcMarkedTerm;      //marked terms of the cone's Groebner basis
    121                 ideal gcBasis;          //GB of the cone
     122                int numVars;            //#of variables in the ring
     123               
     124                /** Contains the Groebner basis of the cone. Is set by gcone::getGB(ideal I)*/
     125                ideal gcBasis;          //GB of the cone, set by gcone::getGB();
    122126                gcone *next;            //Pointer to *previous* cone in search tree
     127               
    123128                /** \brief Compute the normals of the cone
    124129                *
     
    127132                * Other methods for redundancy checkings might be implemented later. See Anders' diss p.44.
    128133                * Note that in order to use cddlib a 0-th column has to be added to the matrix since cddlib expects
    129                 * each row to represent an inequality of type const+x1+...+xn <= 0
     134                * each row to represent an inequality of type const+x1+...+xn <= 0. While computing the normals we come across
     135                * the set \f$ \partial\mathcal{G} \f$ which we might store for later use. C.f p71 of journal
    130136                * As a result of this procedure the pointer facetPtr points to the first facet of the cone.
    131137                */
     
    287293                }//method getConeNormals(ideal I)       
    288294               
     295                bool isParallel(int v[], intvec iv)
     296                {
     297                }
     298               
    289299                /** \brief Compute the Groebner Basis on the other side of a shared facet
    290300                *
     
    293303                * suffices. A term \f$ x^\gamma \f$ of \f$ g \f$ is in \f$  in_\omega(g) \f$ iff \f$ \gamma - leadexp(g)\f$
    294304                * is parallel to \f$ leadexp(g) \f$
    295                 * Checking for parallelity is done by computing the rank of the matrix consisting of the vectors in question.
    296                 * Another possibility would be to compute an interior point of the facet and taking all terms having the same
    297                 * weight with respect to this interior point.
     305                * Checking for parallelity is done by brute force dividing of components.
     306                * Other possibilitiesincludes  computing the rank of the matrix consisting of the vectors in question and
     307                * computing an interior point of the facet and taking all terms having the same weight with respect
     308                * to this interior point.
    298309                *\param ideal, facet
     310                * Input: a marked,reduced Groebner basis and a facet
    299311                */
    300                 void flip(ideal I, facet *f)            //Compute "the other side"
    301                 {
     312                void flip(ideal gb, facet *f)           //Compute "the other side"
     313                {                       
     314                        intvec fNormal; //facet normal, check for parallelity
     315                        /* EXTREMELY EXPERIMENTAL CODE AHEAD*/
    302316                        /*1st step: Compute the initial ideal*/
    303                         map mapping;
    304                         idhdl h;
    305                         ideal image;
    306                         mapping=IDMAP(h);
    307                         image=idInit(1,1);
    308                         image=maGetPreimage(currRing,mapping,image);                   
    309                 }
     317                        poly initialForm[IDELEMS(gb)];  //array of #polys in GB to store initial form
     318                        poly aktpoly;
     319                        int check[this->numVars];       //array to store the difference of LE and v
     320                        for (int ii=0;ii<IDELEMS(gb);ii++)
     321                        {
     322                                aktpoly = (poly)gb->m[ii];
     323                                int *v=(int *)omAlloc((this->numVars+1)*sizeof(int));
     324                                int *leadExpV=(int *)omAlloc((this->numVars+1)*sizeof(int));                           
     325                                pGetExpV(aktpoly,leadExpV);     //find the leading exponent in leadExpV[1],...,leadExpV[n], use pNext(p)
     326                                initialForm[ii]=pHead(aktpoly);
     327                                while(pNext(aktpoly)!=NULL)     /*loop trough terms and check for parallelity*/
     328                                {
     329                                        aktpoly=pNext(aktpoly); //next term
     330                                        pGetExpV(aktpoly,v);
     331                                        for (int i=0;i<pVariables;i++)
     332                                        {
     333                                                check[i] = v[i]-leadExpV[i];
     334                                        }
     335                                        if (isParallel(*check,fNormal)) //pass *check when
     336                                        {
     337                                                //initialForm[ii] += pHead(aktpoly);    //This should add the respective term to
     338                                        }                               
     339                                }
     340                               
     341                        }
     342                }//void flip(ideal gb, facet *f)
    310343                               
    311344                /** \brief Compute a Groebner Basis
    312345                *
    313                 * Computes the Groebner basis and stores the result in this->gcBasis
     346                * Computes the Groebner basis and stores the result in gcone::gcBasis
    314347                *\param ideal
    315348                *\return void
     
    381414        gcone *gcAct;
    382415        gcAct = gcRoot;
     416        gcAct->numVars=pVariables;
    383417        gcAct->getGB(inputIdeal);
    384418        gcAct->getConeNormals(gcAct->gcBasis);  //hopefully compute the normals
Note: See TracChangeset for help on using the changeset viewer.