Changeset 459b80 in git for kernel/gfan.cc


Ignore:
Timestamp:
Apr 16, 2009, 11:59:16 AM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
f1c6ce0a8c355f7f3ca8995a8c816c7e76268d4e
Parents:
4eaf38d1094168c6b74755e47bb69d069f97f031
Message:
Started work on markings


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r4eaf38d r459b80  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-04-15 14:36:10 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.33 2009-04-15 14:36:10 monerjan Exp $
    6 $Id: gfan.cc,v 1.33 2009-04-15 14:36:10 monerjan Exp $
     4$Date: 2009-04-16 09:59:16 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.34 2009-04-16 09:59:16 monerjan Exp $
     6$Id: gfan.cc,v 1.34 2009-04-16 09:59:16 monerjan Exp $
    77*/
    88
     
    403403                                        if (isParallel(check,fNormal)) //pass *check when
    404404                                        {
    405                                                 cout << "Parallel vector found, adding to initialFormElement" << endl;                         
     405                                                cout << "Parallel vector found, adding to initialFormElement" << endl;                 
    406406                                                initialFormElement[ii] = pAdd(pCopy(initialFormElement[ii]),(poly)pHead(aktpoly));
    407407                                        }                                               
    408408                                }//while
     409#ifdef gfan_DEBUG
    409410                                cout << "Initial Form=";                               
    410411                                pWrite(initialFormElement[ii]);
    411412                                cout << "---" << endl;
     413#endif
    412414                                /*Now initialFormElement must be added to (ideal)initialForm */
    413415                                initialForm->m[ii]=initialFormElement[ii];
     
    430432                        ring dstRing=rCopy0(srcRing);
    431433                        dstRing->order[0]=ringorder_a;
    432                         //tmpring->order[1]=ringorder_dp;
    433                         //tmpring->order[2]=ringorder_C;
    434434                        dstRing->wvhdl[0] =( int *)omAlloc((fNormal->length())*sizeof(int)); //found in Singular/ipshell.cc
    435435                       
     
    443443                       
    444444                        rWrite(currRing); cout << endl;
    445                         ideal ina;
    446                         //ina=fast_map(initialForm,srcRing,(ideal)theMap,dstRing);                     
    447                         ina=idrCopyR(initialForm,srcRing);
     445                        ideal ina;                     
     446                        ina=idrCopyR(initialForm,srcRing);                     
     447#ifdef gfan_DEBUG
    448448                        cout << "ina=";
    449449                        idShow(ina); cout << endl;
     450#endif
    450451                        ideal H;
    451452                        H=kStd(ina,NULL,isHomog,NULL);  //we know it is homogeneous
    452453                        idSkipZeroes(H);
     454#ifdef gfan_DEBUG
    453455                        cout << "H="; idShow(H); cout << endl;
     456#endif
    454457                        /*Substep 2.2
    455                         do the lifting
     458                        do the lifting and mark according to H
    456459                        */
    457460                        rChangeCurrRing(srcRing);
    458461                        ideal srcRing_H;
    459                         ideal srcRing_HH;
    460                         //map theMap = (map)idMaxIdeal(1);
    461                         //srcRing_H=fast_map(H,dstRing,(ideal)theMap,srcRing);
     462                        ideal srcRing_HH;                       
    462463                        srcRing_H=idrCopyR(H,dstRing);
    463                         idShow(srcRing_H);
     464                        idShow(srcRing_H);                     
    464465                        srcRing_HH=ffG(srcRing_H,this->gcBasis);                       
    465466                        idShow(srcRing_HH);
    466                         /*Substep 2.3
     467                        /*Substep 2.2.1
     468                        Mark according to G_-\alpha
     469                        Here we have a minimal basis srcRing_HH. In order to turn this basis into a reduced basis
     470                        we have to compute an interior point of C(srcRing_HH). For this we need to know the cone
     471                        represented by srcRing_HH MARKED ACCORDING TO G_{-\alpha}
     472                        Thus we check whether the leading monomials of srcRing_HH and srcRing_H coincide. If not we
     473                        compute the difference accordingly
     474                        */
     475                        dd_set_global_constants;
     476                        bool markingsAreCorrect=FALSE;
     477                        dd_MatrixPtr intPointMatrix;
     478                        int iPMatrixRows=0;
     479                        dd_rowrange aktrow=0;                   
     480                        for (int ii=0;ii<IDELEMS(srcRing_HH);ii++)
     481                        {
     482                                poly aktpoly=(poly)srcRing_HH->m[ii];
     483                                iPMatrixRows = iPMatrixRows+pLength(aktpoly)-1;
     484                        }
     485                        intPointMatrix = dd_CreateMatrix(iPMatrixRows,this->numVars+1);
     486                       
     487                        for (int ii=0;ii<IDELEMS(srcRing_HH);ii++)
     488                        {
     489                                poly aktpoly=srcRing_HH->m[ii];
     490                                /*Comparison of leading monomials is done via exponent vectors*/
     491                                for (int jj=0;jj<IDELEMS(H);jj++)
     492                                {
     493                                        int *src_ExpV = (int *)omAlloc((this->numVars+1)*sizeof(int));
     494                                        int *dst_ExpV = (int *)omAlloc((this->numVars+1)*sizeof(int));
     495                                        pGetExpV(aktpoly,src_ExpV);
     496                                        pGetExpV(pCopy(H->m[ii]),dst_ExpV);
     497                                        cout << *src_ExpV << endl;
     498                                        cout << *dst_ExpV << endl;
     499                                        if (src_ExpV == dst_ExpV)
     500                                        {
     501                                                markingsAreCorrect=TRUE; //everything is fine
     502                                                cout << "correct markings" << endl;
     503                                        }//if (pHead(aktpoly)==pHead(H->m[jj])
     504                                        delete src_ExpV;
     505                                        delete dst_ExpV;
     506                                }//for (int jj=0;jj<IDELEMS(H);jj++)
     507                               
     508                                int *v=(int *)omAlloc((this->numVars+1)*sizeof(int));
     509                                int *leadExpV=(int *)omAlloc((this->numVars+1)*sizeof(int));
     510                                if (markingsAreCorrect==TRUE)
     511                                {
     512                                        pGetExpV(aktpoly,leadExpV);
     513                                }
     514                                else
     515                                {
     516                                        pGetExpV(pCopy(pHead(H->m[ii])),leadExpV); //We use H->m[ii] as leading monomial
     517                                }
     518                                /*compute differences of the expvects*/
     519                                while (pNext(aktpoly)!=NULL)
     520                                {
     521                                        aktpoly=pNext(aktpoly);
     522                                        pGetExpV(aktpoly,v);                                           
     523                                        for (int jj=0;jj<this->numVars;jj++)
     524                                        {                               
     525                                                /*Store into ddMatrix*/                 
     526                                                /*FIXME Wrong values*/
     527                                                dd_set_si(intPointMatrix->matrix[aktrow][jj+1],v[jj+1]-leadExpV[jj+1]);
     528                                        }
     529                                        aktrow +=1;
     530                                }
     531                                delete v;
     532                                delete leadExpV;
     533                        }//for (int ii=0;ii<IDELEMS(srcRing_HH);ii++)
     534                        dd_WriteMatrix(stdout,intPointMatrix);
     535                        dd_FreeMatrix(intPointMatrix);
     536                       
     537                        /*Step 3
    467538                        turn the minimal basis into a reduced one
    468539                        */
Note: See TracChangeset for help on using the changeset viewer.