Changeset 2e06300 in git


Ignore:
Timestamp:
Jan 4, 2010, 5:27:48 PM (14 years ago)
Author:
Martin Monerjan
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
Children:
1fca0364b35f46a90cbfe6c56518e4c6d8425aeb
Parents:
b082fc7cb97483beeb73b16829cc2cac851c24f1
Message:
Various attempts on preprocessing
gcone::preprocessInequalities is the one to proceed with
interiorPoint2 as a crude attempt on computing the said
Possibility to remove strictly positive rows in getConeNormals - no
speedup worth mentioning
Several minor tweaks - note that getCodim2Normals actually seems to
compute the extremal rays. However that does not do any harm since
comparison works that way as well. Might only come cheaper to get cddlib
to return the actual normals. But who knows with cddlib...
Timestamps with gettimeofday for crude profiling
dd_FindRelativeInterior -> dd_LPSolve
Ring construction in readConeFromFile


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    rb082fc r2e06300  
    1616#include "polys.h"
    1717#include "ideals.h"
    18 // #include "kmatrix.h"
     18#include "kmatrix.h"
     19#include "GMPrat.h"
    1920//#include "fast_maps.h"        //Mapping of ideals
    2021// #include "maps.h"
     
    778779        }
    779780        free(redRowsArray);
     781        /*And now for the strictly positive rows
     782        * Doesn't gain significant speedup
     783        */
     784        /*int *posRowsArray=NULL;
     785        num_alloc=0;
     786        num_elts=0;
     787        for(int ii=0;ii<ddineq->rowsize;ii++)
     788        {
     789                intvec *ivPos = new intvec(this->numVars);
     790                for(int jj=0;jj<this->numVars;jj++)
     791                        (*ivPos)[jj]=(int)mpq_get_d(ddineq->matrix[ii][jj+1]);
     792                bool isStrictlyPos=FALSE;
     793                int posCtr=0;           
     794                for(int jj=0;jj<this->numVars;jj++)
     795                {
     796                        intvec *ivCanonical = new intvec(this->numVars);
     797                        jj==0 ? (*ivCanonical)[ivPos->length()-1]=1 : (*ivCanonical)[jj-1]=1;
     798                        if(dotProduct(*ivCanonical,*ivPos)!=0)
     799                        {
     800                                if ((*ivPos)[jj]>=0)
     801                                {                               
     802                                        posCtr++;                               
     803                                }
     804                        }                       
     805                        delete ivCanonical;
     806                }
     807                if(posCtr==ivPos->length())
     808                        isStrictlyPos=TRUE;
     809                if(isStrictlyPos==TRUE)
     810                {
     811                        if(num_alloc==0)
     812                                num_alloc += 1;
     813                        else
     814                                num_alloc += 1;
     815                        void *tmp = realloc(posRowsArray,(num_alloc*sizeof(int)));
     816                        if(!tmp)
     817                        {
     818                                WerrorS("Woah dude! Couldn't realloc memory\n");
     819                                exit(-1);
     820                        }
     821                        posRowsArray = (int*)tmp;
     822                        posRowsArray[num_elts]=ii;
     823                        num_elts++;     
     824                }
     825                delete ivPos;
     826        }
     827        offset=0;
     828        for(int ii=0;ii<num_elts;ii++)
     829        {
     830                dd_MatrixRowRemove(&ddineq,posRowsArray[ii]+1-offset);
     831                offset++;
     832        }
     833        free(posRowsArray);*/
    780834#endif
    781835
     
    942996                gettimeofday(&t_ddMC_start,0);
    943997#endif                         
    944                 dd_MatrixCanonicalize(&ddakt, &impl_linset, &redset, &newpos, &err);
     998                /*dd_MatrixCanonicalize(&ddakt, &impl_linset, &redset, &newpos, &err);*/
    945999//              set_copy(LL,ddakt->linset);
    9461000                dd_PolyhedraPtr ddpolyh;
     
    9521006                gettimeofday(&t_ddMC_end,0);
    9531007                t_ddMC += (t_ddMC_end.tv_sec - t_ddMC_start.tv_sec + 1e-6*(t_ddMC_end.tv_usec - t_ddMC_start.tv_usec));
    954 #endif                         
     1008#endif 
    9551009                /* We loop through each row of P normalize it by making all
    9561010                * entries integer ones and add the resulting vector to the
    9571011                * int matrix facet::codim2Facets */
    958                 for (int jj=1;jj<=P->rowsize;jj++)
     1012                for (int jj=1;jj<=/*ddakt*/P->rowsize;jj++)
    9591013                {                                       
    9601014                        fAct->numCodim2Facets++;
     
    9751029#endif
    9761030                        makeInt(P,jj,*n);
     1031                        /*for(int kk=0;kk<this->numVars;kk++)
     1032                        {
     1033                                int foo;
     1034                                foo = (int)mpq_get_d(ddakt->matrix[ii][kk+1]);
     1035                                (*n)[kk]=foo;
     1036                        }*/
    9771037#ifdef gfanp
    9781038                        gettimeofday(&t_mI_end,0);
     
    9841044                /*We check whether the facet spanned by the codim-2 facets
    9851045                * intersects with the positive orthant. Otherwise we define this
    986                 * facet to be non-flippable
     1046                * facet to be non-flippable. Works since we set the appropriate
     1047                * linearity for ddakt above.
    9871048                */
    9881049                intvec *iv_intPoint = new intvec(this->numVars);
     
    10011062#endif         
    10021063                interiorPoint(intPointMatrix,*iv_intPoint);
     1064//              dd_rowset impl_linste,lbasis;
     1065//              dd_LPSolutionPtr lps=NULL;
     1066//              dd_ErrorType err;
     1067//              dd_FindRelativeInterior(intPointMatrix, &impl_linset, &lbasis, &lps, &err);
    10031068#ifdef gfanp
    10041069                gettimeofday(&t_iP_end, 0);
     
    10201085                delete iv_intPoint;
    10211086                dd_FreeMatrix(P);
    1022                 set_free(impl_linset);
    1023                 set_free(redset);               
    1024                 free(newpos);
     1087//              set_free(impl_linset);
     1088//              set_free(redset);               
     1089//              free(newpos);
    10251090//              set_free(LL);
    10261091        }//for 
     
    11411206         * compute the difference accordingly
    11421207        */
     1208#ifdef gfanp
     1209        timeval t_markings_start, t_markings_end;
     1210        gettimeofday(&t_markings_start, 0);
     1211#endif         
    11431212        bool markingsAreCorrect=FALSE;
    11441213        dd_MatrixPtr intPointMatrix;
     
    12311300                omFree(leadExpV);
    12321301        }//for (int ii=0;ii<IDELEMS(srcRing_HH);ii++)
     1302#ifdef gfanp
     1303        gettimeofday(&t_markings_end, 0);
     1304        t_markings += (t_markings_end.tv_sec - t_markings_start.tv_sec + 1e-6*(t_markings_end.tv_usec - t_markings_start.tv_usec));
     1305#endif
    12331306        /*Now it is safe to idDelete(H)*/
    12341307        idDelete(&H);
    1235         /*Now we add the constraint for the standard simplex*/ 
     1308        /*Now we add the constraint for the standard simplex*/
     1309// #ifdef gfanp
     1310//      timeval t_dd_start, t_dd_end;
     1311//      gettimeofday(&t_dd_start, 0);
     1312// #endif
    12361313        dd_set_si(intPointMatrix->matrix[aktrow][0],-1);
    12371314        for (int jj=1;jj<=this->numVars;jj++)
     
    12411318        //Let's make sure we compute interior points from the positive orthant
    12421319        dd_MatrixPtr posRestr=dd_CreateMatrix(this->numVars,this->numVars+1);
     1320       
    12431321        int jj=1;
    12441322        for (int ii=0;ii<this->numVars;ii++)
     
    12491327        dd_MatrixAppendTo(&intPointMatrix,posRestr);
    12501328        dd_FreeMatrix(posRestr);
     1329        /*Insert preprocessing here. If it is before the dd_CreateMatrix things go pear shaped
     1330        * Otherwise things will go pear shaped if called after the standard simplex constraints are added
     1331        */
     1332        preprocessInequalities(intPointMatrix);
    12511333        intvec *iv_weight = new intvec(this->numVars);
     1334#ifdef gfanp
     1335        timeval t_dd_start, t_dd_end;
     1336        gettimeofday(&t_dd_start, 0);
     1337#endif
     1338        dd_ErrorType err;
     1339        dd_rowset implLin, redrows;
     1340        dd_rowindex newpos;
     1341       
     1342        dd_MatrixCanonicalize(&intPointMatrix,&implLin,&redrows,&newpos,&err);
     1343//      dd_MatrixCanonicalizeLinearity(&intPointMatrix,&implLin, &newpos,&err);
     1344        //dd_MatrixRedundancyRemove is our time sink!
     1345//      dd_MatrixRedundancyRemove(&intPointMatrix,&redrows,&newpos,&err);
    12521346        interiorPoint(intPointMatrix, *iv_weight);      //iv_weight now contains the interior point
    12531347        dd_FreeMatrix(intPointMatrix);
    1254                        
     1348        /*Crude attempt for interior point */
     1349        /*dd_PolyhedraPtr ddpolyh;
     1350        dd_ErrorType err;
     1351        dd_rowset impl_linset,redset;
     1352        dd_rowindex newpos;
     1353        dd_MatrixCanonicalize(&intPointMatrix, &impl_linset, &redset, &newpos, &err);
     1354        ddpolyh=dd_DDMatrix2Poly(intPointMatrix, &err);
     1355        dd_MatrixPtr P;
     1356        P=dd_CopyGenerators(ddpolyh);
     1357        dd_FreePolyhedra(ddpolyh);
     1358        for(int ii=0;ii<P->rowsize;ii++)
     1359        {
     1360                intvec *iv_row=new intvec(this->numVars);
     1361                makeInt(P,ii+1,*iv_row);
     1362                iv_weight =ivAdd(iv_weight, iv_row);
     1363                delete iv_row;
     1364        }
     1365        dd_FreeMatrix(P);
     1366        dd_FreeMatrix(intPointMatrix);*/
     1367#ifdef gfanp
     1368        gettimeofday(&t_dd_end, 0);
     1369        t_dd += (t_dd_end.tv_sec - t_dd_start.tv_sec + 1e-6*(t_dd_end.tv_usec - t_dd_start.tv_usec));
     1370#endif                 
    12551371        /*Step 3
    12561372        turn the minimal basis into a reduced one
     
    14131529        return res;
    14141530}
    1415                
     1531       
     1532/** \brief Preprocessing of inequlities
     1533* Do some preprocessing on the matrix of inequalities
     1534* 1) Replace several constraints on the pos. orthants by just one for each orthant
     1535* 2) Remove duplicates of inequalities
     1536* 3) Remove inequalities that arise as sums of other inequalities
     1537*/
     1538void gcone::preprocessInequalities(dd_MatrixPtr &ddineq)
     1539{
     1540//Remove strictly positive rows
     1541//      int *posRowsArray=NULL;
     1542//      int num_alloc=0;
     1543//      int num_elts=0;
     1544//      for(int ii=0;ii<ddineq->rowsize;ii++)
     1545//      {
     1546//              intvec *ivPos = new intvec(pVariables);
     1547//              for(int jj=0;jj<pVariables;jj++)
     1548//                      (*ivPos)[jj]=(int)mpq_get_d(ddineq->matrix[ii][jj+1]);
     1549//              bool isStrictlyPos=FALSE;
     1550//              int posCtr=0;           
     1551//              for(int jj=0;jj<pVariables;jj++)
     1552//              {
     1553//                      intvec *ivCanonical = new intvec(pVariables);
     1554//                      jj==0 ? (*ivCanonical)[ivPos->length()-1]=1 : (*ivCanonical)[jj-1]=1;
     1555//                      if(dotProduct(*ivCanonical,*ivPos)!=0)
     1556//                      {
     1557//                              if ((*ivPos)[jj]>=0)
     1558//                              {                               
     1559//                                      posCtr++;                               
     1560//                              }
     1561//                      }                       
     1562//                      delete ivCanonical;
     1563//              }
     1564//              if(posCtr==ivPos->length())
     1565//                      isStrictlyPos=TRUE;
     1566//              if(isStrictlyPos==TRUE)
     1567//              {
     1568//                      if(num_alloc==0)
     1569//                              num_alloc += 1;
     1570//                      else
     1571//                              num_alloc += 1;
     1572//                      void *tmp = realloc(posRowsArray,(num_alloc*sizeof(int)));
     1573//                      if(!tmp)
     1574//                      {
     1575//                              WerrorS("Woah dude! Couldn't realloc memory\n");
     1576//                              exit(-1);
     1577//                      }
     1578//                      posRowsArray = (int*)tmp;
     1579//                      posRowsArray[num_elts]=ii;
     1580//                      num_elts++;     
     1581//              }
     1582//              delete ivPos;
     1583//      }
     1584        int offset=0;
     1585//      for(int ii=0;ii<num_elts;ii++)
     1586//      {
     1587//              dd_MatrixRowRemove(&ddineq,posRowsArray[ii]+1-offset);
     1588//              offset++;
     1589//      }
     1590//      free(posRowsArray);
     1591        //Remove zeroes
     1592        int rowsize=ddineq->rowsize;
     1593        for(int ii=0;ii<ddineq->rowsize;ii++)
     1594        {
     1595                intvec *iv = new intvec(this->numVars);
     1596                int posCtr=0;
     1597                for(int jj=0;jj<this->numVars;jj++)
     1598                {
     1599                        (*iv)[jj]=(int)mpq_get_d(ddineq->matrix[ii][jj+1]);
     1600                        if((*iv)[ii]>0)
     1601                                posCtr++;
     1602                }
     1603                if( (iv->compare(0)==0)) //|| (posCtr==iv->length()) )
     1604                {
     1605                        dd_MatrixRowRemove(&ddineq,ii+1);
     1606                        ii--;           
     1607//                      rowsize=ddineq->rowsize;
     1608                }
     1609                delete iv;
     1610        }
     1611        //Remove duplicates of rows
     1612//      posRowsArray=NULL;
     1613//      num_alloc=0;
     1614//      num_elts=0;
     1615//      offset=0;
     1616//      int num_newRows = ddineq->rowsize;
     1617//      for(int ii=0;ii<ddineq->rowsize-1;ii++)
     1618//      for(int ii=0;ii<num_newRows-1;ii++)
     1619//      {
     1620//              intvec *iv = new intvec(this->numVars);//1st vector to check against
     1621//              for(int jj=0;jj<this->numVars;jj++)
     1622//                      (*iv)[jj]=(int)mpq_get_d(ddineq->matrix[ii][jj+1]);
     1623//              for(int jj=ii+1;jj</*ddineq->rowsize*/num_newRows;jj++)
     1624//              {
     1625//                      intvec *ivCheck = new intvec(this->numVars);//Checked against iv
     1626//                      for(int kk=0;kk<this->numVars;kk++)
     1627//                              (*ivCheck)[kk]=(int)mpq_get_d(ddineq->matrix[jj][kk+1]);
     1628//                      if (iv->compare(ivCheck)==0)
     1629//                      {
     1630// //                           cout << "=" << endl;
     1631// //                           num_alloc++;
     1632// //                           void *tmp=realloc(posRowsArray,(num_alloc*sizeof(int)));
     1633// //                           if(!tmp)
     1634// //                           {
     1635// //                                   WerrorS("Woah dude! Couldn't realloc memory\n");
     1636// //                                   exit(-1);
     1637// //                           }
     1638// //                           posRowsArray = (int*)tmp;
     1639// //                           posRowsArray[num_elts]=jj;
     1640// //                           num_elts++;
     1641//                              dd_MatrixRowRemove(&ddineq,jj+1);
     1642//                              num_newRows = ddineq->rowsize;
     1643//                      }
     1644//                      delete ivCheck;
     1645//              }
     1646//              delete iv;
     1647//      }
     1648//      for(int ii=0;ii<num_elts;ii++)
     1649//      {
     1650//              dd_MatrixRowRemove(&ddineq,posRowsArray[ii]+1-offset);
     1651//              offset++;
     1652//      }
     1653//      free(posRowsArray);
     1654        //Apply Thm 2.1 of JOTA Vol 53 No 1 April 1987*/       
     1655}//preprocessInequalities
     1656       
    14161657/** \brief Compute a Groebner Basis
    14171658 *
     
    14841725 * Any rational point is automatically converted into an integer.
    14851726 */
    1486 inline void gcone::interiorPoint(const dd_MatrixPtr &M, intvec &iv) //no const &M here since we want to remove redundant rows
     1727inline void gcone::interiorPoint( dd_MatrixPtr &M, intvec &iv) //no const &M here since we want to remove redundant rows
    14871728{
    14881729        dd_LPPtr lp,lpInt;
     
    14911732        dd_LPSolutionPtr lpSol=NULL;
    14921733        dd_rowset ddlinset,ddredrows;   //needed for dd_FindRelativeInterior
    1493 //      dd_rowindex ddnewpos;
     1734        dd_rowindex ddnewpos;
    14941735        dd_NumberType numb;     
    1495                         //M->representation=dd_Inequality;
    1496                         //M->objective-dd_LPMin;  //Not sure whether this is needed
    1497                        
    1498                         //NOTE: Make this n-dimensional!
    1499                         //dd_set_si(M->rowvec[0],1);dd_set_si(M->rowvec[1],1);dd_set_si(M->rowvec[2],1);
     1736        //M->representation=dd_Inequality;
     1737                       
     1738        //NOTE: Make this n-dimensional!
     1739        //dd_set_si(M->rowvec[0],1);dd_set_si(M->rowvec[1],1);dd_set_si(M->rowvec[2],1);
    15001740                                                                       
    1501                         /*NOTE: Leave the following line commented out!
    1502         * Otherwise it will cause interior points that are not strictly positive on some examples
    1503         *
    1504                         */
    1505                         //dd_MatrixCanonicalize(&M, &ddlinset, &ddredrows, &ddnewpos, &err);
    1506                         //if (err!=dd_NoError){cout << "Error during dd_MatrixCanonicalize" << endl;}
    1507                         //cout << "Tick 2" << endl;
    1508                         //dd_WriteMatrix(stdout,M);
    1509                        
     1741        /*NOTE: Leave the following line commented out!
     1742        * Otherwise it will slow down computations a great deal
     1743        * */
     1744//      dd_MatrixCanonicalizeLinearity(&M, &ddlinset, &ddnewpos, &err);
     1745        //if (err!=dd_NoError){cout << "Error during dd_MatrixCanonicalize" << endl;}
     1746        dd_MatrixPtr posRestr=dd_CreateMatrix(this->numVars,this->numVars+1);
     1747        int jj=1;
     1748        for (int ii=0;ii<this->numVars;ii++)
     1749        {
     1750                dd_set_si(posRestr->matrix[ii][jj],1);
     1751                jj++;                                                   
     1752        }
     1753        dd_MatrixAppendTo(&M,posRestr);
     1754        dd_FreeMatrix(posRestr);
     1755//      dd_MatrixCanonicalizeLinearity(&M, &ddlinset, &ddnewpos, &err);
    15101756        lp=dd_Matrix2LP(M, &err);
    15111757        if (err!=dd_NoError){WerrorS("Error during dd_Matrix2LP in gcone::interiorPoint");}
     
    15211767#endif                 
    15221768
    1523         dd_FindRelativeInterior(M,&ddlinset,&ddredrows,&lpSol,&err);
     1769//      dd_FindRelativeInterior(M,&ddlinset,&ddredrows,&lpSol,&err);
    15241770        if (err!=dd_NoError)
    15251771        {
     
    15281774        }
    15291775                       
    1530                         //dd_LPSolve(lpInt,solver,&err);        //This will not result in a point from the relative interior
    1531         if (err!=dd_NoError){WerrorS("Error during dd_LPSolve");}
     1776        dd_LPSolve(lpInt,solver,&err);  //This will not result in a point from the relative interior
     1777//      if (err!=dd_NoError){WerrorS("Error during dd_LPSolve");}
    15321778                                                                       
    1533                         //lpSol=dd_CopyLPSolution(lpInt);
    1534         if (err!=dd_NoError){WerrorS("Error during dd_CopyLPSolution");}
     1779        lpSol=dd_CopyLPSolution(lpInt);
     1780//      if (err!=dd_NoError){WerrorS("Error during dd_CopyLPSolution");}
    15351781#ifdef gfan_DEBUG
    15361782        cout << "Interior point: ";
     
    15781824        dd_FreeLPData(lpInt);
    15791825        dd_FreeLPData(lp);
    1580         set_free(ddlinset);
    1581         set_free(ddredrows);   
     1826//      set_free(ddlinset);
     1827//      set_free(ddredrows);   
    15821828                       
    15831829}//void interiorPoint(dd_MatrixPtr const &M)
    1584                
     1830
     1831inline void gcone::interiorPoint2(const dd_MatrixPtr &M, intvec &iv)
     1832{
     1833        KMatrix<Rational> mMat(M->rowsize+1,M->colsize);
     1834        for(int ii=0;ii<M->rowsize;ii++)
     1835        {
     1836                for(int jj=0;jj<M->colsize-1;jj++)
     1837                {
     1838                        if(mpq_sgn(M->matrix[ii][jj+1])<-1)
     1839                        {
     1840                                mMat.set(ii,jj,-(Rational)mpq_get_d(M->matrix[ii][jj+1]));
     1841                        }
     1842                        else
     1843                                mMat.set(ii,jj,(Rational)mpq_get_d(M->matrix[ii][jj+1]));
     1844                               
     1845//                      mMat.set(ii,jj,&(M->matrix[ii][jj+1]) );
     1846                        cout << mpq_get_d(M->matrix[ii][jj+1]) << " ";
     1847//                      int val=(int)mMat.get(ii,jj);
     1848//                      cout << ii << "," << jj << endl;;
     1849//                      mpq_out_str (NULL, 10, (__mpq_struct)mMat.get(ii,jj));
     1850                }
     1851                cout << endl;
     1852                mMat.set(ii,M->colsize-1,1);
     1853        }
     1854        dd_WriteMatrix(stdout,M);
     1855//      for(int ii=0;ii<M->rowsize;ii++)
     1856//      {
     1857//              cout << mMat.get(ii,ii+M->colsize) << " ";
     1858//              if((ii+M->colsize)%M->colsize==0)
     1859//                      cout << endl;
     1860//      }
     1861       
     1862        Rational* mSol;
     1863        int rank;
     1864        int c;
     1865//      dd_WriteMatrix(stdout,M);
     1866        rank=mMat.solve(&mSol,&c);
     1867//      for(int ii=0;ii<c;ii++)
     1868//              iv[ii]=mSol[ii];
     1869//              cout << mSol[ii].get_den() << "/" << mSol[ii].get_num() << endl;
     1870        int gcd=1;
     1871        for(int ii=0;ii<c-1;ii++)
     1872                gcd += intgcd(mSol[ii].get_den_si(),mSol[ii+1].get_den_si());
     1873        cout << gcd << endl;
     1874        for(int ii=0;ii<iv.length();ii++)
     1875                iv[ii]=(int)((mSol[ii].get_num_si()*gcd)/mSol[ii].get_den_si());
     1876
     1877}
     1878       
     1879       
    15851880/** \brief Copy a ring and add a weighted ordering in first place
    15861881 *
     
    18362131                                idDelete((ideal*)&gcTmp->gcBasis);//Whonder why?
    18372132                                //If you use the following make sure it is uncommented in readConeFromFile
    1838                                 //rDelete(gcTmp->baseRing);
     2133//                              rDelete(gcTmp->baseRing);
    18392134                        }                       
    18402135#ifdef gfan_DEBUG
     
    18742169                                else if(gfanHeuristic==1)
    18752170                                {
     2171                                        gcone *gcDel;
     2172                                        gcDel = gcAct;                                 
     2173                                        gcAct = gcNext;
     2174//                                      rDelete(gcDel->baseRing);
    18762175                                        //Read st00f from file
    1877                                         gcAct = gcNext;
    18782176                                        //implant the GB into gcAct
    18792177                                        readConeFromFile(gcAct->getUCN(), gcAct);
     
    24112709               
    24122710                if(line=="RING")
    2413                 {/*
    2414                         getline(gcInputFile,line);
    2415                         found = line.find("a(");
    2416                         line.erase(0,found+2);
    2417                         string strweight;
    2418                         strweight=line.substr(0,line.find_first_of(")"));
    2419                         intvec *iv=new intvec(this->numVars);
    2420                         for(int ii=0;ii<this->numVars;ii++)
    2421                         {
    2422                                 string weight;
    2423                                 weight=line.substr(0,line.find_first_of(",)"));                         
    2424                                 (*iv)[ii]=atoi(weight.c_str());
    2425                                 line.erase(0,line.find_first_of(",)")+1);
    2426                         }
    2427                         ring newRing;
    2428                         if(currRing->order[0]!=ringorder_a)
    2429                         {
    2430                                 newRing=rCopyAndAddWeight(currRing,iv);
    2431                         }
    2432                         else
    2433                         {                       
    2434                                 newRing=rCopy0(currRing);
    2435                                 int length=this->numVars;
    2436                                 int *A=(int *)omAlloc0(length*sizeof(int));
    2437                                 for(int jj=0;jj<length;jj++)
    2438                                 {
    2439                                         A[jj]=-(*iv)[jj];
    2440                                 }
    2441                                 omFree(newRing->wvhdl[0]);
    2442                                 newRing->wvhdl[0]=(int*)A;
    2443                                 newRing->block1[0]=length;
    2444                         }
    2445                         delete iv;
    2446                         rComplete(newRing);
    2447                         gc->baseRing=rCopy(newRing);
    2448                         if(currRing!=gc->baseRing)
    2449                                 rChangeCurrRing(gc->baseRing);*/
     2711                {
     2712//                      getline(gcInputFile,line);
     2713//                      found = line.find("a(");
     2714//                      line.erase(0,found+2);
     2715//                      string strweight;
     2716//                      strweight=line.substr(0,line.find_first_of(")"));
     2717//                      intvec *iv=new intvec(this->numVars);
     2718//                      for(int ii=0;ii<this->numVars;ii++)
     2719//                      {
     2720//                              string weight;
     2721//                              weight=line.substr(0,line.find_first_of(",)"));                         
     2722//                              (*iv)[ii]=atoi(weight.c_str());
     2723//                              line.erase(0,line.find_first_of(",)")+1);
     2724//                      }
     2725//                      ring newRing;
     2726//                      if(currRing->order[0]!=ringorder_a)
     2727//                      {
     2728//                              newRing=rCopyAndAddWeight(currRing,iv);
     2729//                      }
     2730//                      else
     2731//                      {                       
     2732//                              newRing=rCopy0(currRing);
     2733//                              int length=this->numVars;
     2734//                              int *A=(int *)omAlloc0(length*sizeof(int));
     2735//                              for(int jj=0;jj<length;jj++)
     2736//                              {
     2737//                                      A[jj]=-(*iv)[jj];
     2738//                              }
     2739//                              omFree(newRing->wvhdl[0]);
     2740//                              newRing->wvhdl[0]=(int*)A;
     2741//                              newRing->block1[0]=length;
     2742//                      }
     2743//                      delete iv;
     2744//                      rComplete(newRing);
     2745//                      gc->baseRing=rCopy(newRing);
     2746//                      if(currRing!=gc->baseRing)
     2747//                              rChangeCurrRing(gc->baseRing);
    24502748                }
    24512749               
     
    26832981float gcone::time_getCodim2Normals;
    26842982float gcone::time_flip;
     2983float gcone::t_markings;
     2984float gcone::t_dd;
    26852985float gcone::time_enqueue;
    26862986float gcone::time_computeInv;
     
    27713071        cout << "  t_iP:" << gcone::t_iP << endl;
    27723072        cout << "t_Flip:" << gcone::time_flip << endl;
     3073        cout << "  t_markings:" << gcone::t_markings << endl;
     3074        cout << "  t_dd:" << gcone::t_dd << endl;
    27733075        cout << "t_computeInv:" << gcone::time_computeInv << endl;
    27743076        cout << "t_enqueue:" << gcone::time_enqueue << endl;
  • kernel/gfan.h

    rb082fc r2e06300  
    141141                static float time_getCodim2Normals;
    142142                static float time_flip;
     143                static float t_ffG;
     144                static float t_markings;
     145                static float t_dd;
     146                static float t_kStd;
    143147                static float time_enqueue;             
    144148                static float time_computeInv;
     
    204208                inline ideal ffG(const ideal &H, const ideal &G);
    205209                inline void getGB(ideal const &inputIdeal);             
    206                 inline void interiorPoint(const dd_MatrixPtr &M, intvec &iv);
     210                inline void interiorPoint( dd_MatrixPtr &M, intvec &iv);
     211                inline void interiorPoint2(const dd_MatrixPtr &M, intvec &iv);
     212                inline void preprocessInequalities(dd_MatrixPtr &M);
    207213                ring rCopyAndAddWeight(const ring &r, const intvec *ivw);
    208214                ring rCopyAndChangeWeight(const ring &r, intvec *ivw);         
Note: See TracChangeset for help on using the changeset viewer.