Changeset 365c34 in git for kernel/gfan.cc


Ignore:
Timestamp:
Apr 21, 2009, 5:23:54 PM (15 years ago)
Author:
Martin Monerjan
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
b85587587523c7ec8f89a09d494710648e48569b
Parents:
5f2327b022d4d81122b451a13e154cf5ae974ff3
Message:
Two methods for interior points. dd_LPSolve yields a point that is not from the relative int of the facet though. While dd_FindRelativeInterior does not seem to honor the standard simplex constraint. Resolved sig11 of yesterday


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

Legend:

Unmodified
Added
Removed
  • kernel/gfan.cc

    r5f2327 r365c34  
    22Compute the Groebner fan of an ideal
    33$Author: monerjan $
    4 $Date: 2009-04-20 15:35:04 $
    5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.36 2009-04-20 15:35:04 monerjan Exp $
    6 $Id: gfan.cc,v 1.36 2009-04-20 15:35:04 monerjan Exp $
     4$Date: 2009-04-21 15:23:54 $
     5$Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.37 2009-04-21 15:23:54 monerjan Exp $
     6$Id: gfan.cc,v 1.37 2009-04-21 15:23:54 monerjan Exp $
    77*/
    88
     
    745745                }//bool isParallel
    746746               
    747                 void interiorPoint(dd_MatrixPtr M) //no const &M here since we want to remove redundant rows
     747                void interiorPoint(dd_MatrixPtr &M) //no const &M here since we want to remove redundant rows
    748748                {
    749749                        dd_LPPtr lp,lpInt;
     
    751751                        dd_LPSolverType solver=dd_DualSimplex;
    752752                        dd_LPSolutionPtr lpSol=NULL;
    753                         dd_rowset ddlinset,ddredrows;
     753                        dd_rowset ddlinset,ddredrows;   //needed for dd_FindRelativeInterior
    754754                        dd_rowindex ddnewpos;
    755755                        dd_NumberType numb;     
     
    757757                        //M->objective-dd_LPMin;  //Not sure whether this is needed
    758758                        dd_set_si(M->rowvec[0],1);dd_set_si(M->rowvec[1],1);dd_set_si(M->rowvec[2],1);
    759                         cout << "TICK 1" << endl;
    760                         //numb=dd_Rational;
    761                        
    762                         //M->numbtype=dd_Real;
     759                        //cout << "TICK 1" << endl;
     760                                               
    763761                        //dd_MatrixCanonicalize(&M, &ddlinset, &ddredrows, &ddnewpos, &err);
    764762                        //if (err!=dd_NoError){cout << "Error during dd_MatrixCanonicalize" << endl;}
    765                         cout << "Tick 2" << endl;
     763                        //cout << "Tick 2" << endl;
    766764                        //dd_WriteMatrix(stdout,M);
    767765                       
    768766                        lp=dd_Matrix2LP(M, &err);
    769                         //if (err!=dd_NoError){cout << "Error during dd_Matrix2LP" << endl;}                   
     767                        if (err!=dd_NoError){cout << "Error during dd_Matrix2LP in gcone::interiorPoint" << endl;}                     
    770768                        if (lp==NULL){cout << "LP is NULL" << endl;}
    771769                        dd_WriteLP(stdout,lp);
    772                         cout << "Tick 3" << endl;
     770                        //cout << "Tick 3" << endl;
    773771                                               
    774772                        lpInt=dd_MakeLPforInteriorFinding(lp);
    775                         //if (err!=dd_NoError){cout << "Error during dd_MakeLPForInteriorFinding" << endl;}
     773                        if (err!=dd_NoError){cout << "Error during dd_MakeLPForInteriorFinding in gcone::interiorPoint" << endl;}
    776774                        dd_WriteLP(stdout,lpInt);
    777                         cout << "Tick 4" << endl;
     775                        //cout << "Tick 4" << endl;
    778776                       
    779777                        dd_FindRelativeInterior(M,&ddlinset,&ddredrows,&lpSol,&err);
    780                        
    781                         //dd_LPSolve(lpInt,solver,&err);        //This will not result in a point from the relative interior
    782                         //if (err!=dd_NoError){cout << "Error during dd_LPSolve" << endl;}
    783                         cout << "Tick 5" << endl;
     778                        if (err!=dd_NoError)
     779                        {
     780                                cout << "Error during dd_FindRelativeInterior in gcone::interiorPoint" << endl;
     781                                dd_WriteErrorMessages(stdout, err);
     782                        }
     783                       
     784                        dd_LPSolve(lpInt,solver,&err);  //This will not result in a point from the relative interior
     785                        if (err!=dd_NoError){cout << "Error during dd_LPSolve" << endl;}
     786                        //cout << "Tick 5" << endl;
    784787                                                                       
    785788                        //lpSol=dd_CopyLPSolution(lpInt);
    786                         //if (err!=dd_NoError){cout << "Error during dd_CopyLPSolution" << endl;}                       
    787                         cout << "Tick 6" << endl;
     789                        if (err!=dd_NoError){cout << "Error during dd_CopyLPSolution" << endl;}                 
     790                        //cout << "Tick 6" << endl;
    788791                       
    789792                        cout << "Interior point: ";
    790793                        for (int ii=1; ii<(lpSol->d)-1;ii++)
    791794                        {
    792                                 dd_WriteNumber(stdout,lpSol->sol[ii]);
     795                                dd_WriteNumber(stdout,lpSol->sol[ii]);                         
    793796                        }
    794                         dd_FreeLPData(lp);
    795797                        dd_FreeLPSolution(lpSol);
    796798                        dd_FreeLPData(lpInt);
    797                         dd_FreeMatrix(M);
     799                        dd_FreeLPData(lp);
    798800                        set_free(ddlinset);
    799801                        set_free(ddredrows);
     802                        /*At this point we have an interior point of type mpq_t
     803                        Need to convert to an intvec
     804                        */
     805                       
    800806                }//void interiorPoint(dd_MatrixPtr const &M)
    801807};//class gcone
Note: See TracChangeset for help on using the changeset viewer.