Changeset 365c34 in git for kernel/gfan.cc
- Timestamp:
- Apr 21, 2009, 5:23:54 PM (15 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- b85587587523c7ec8f89a09d494710648e48569b
- Parents:
- 5f2327b022d4d81122b451a13e154cf5ae974ff3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/gfan.cc
r5f2327 r365c34 2 2 Compute the Groebner fan of an ideal 3 3 $Author: monerjan $ 4 $Date: 2009-04-2 0 15:35:04 $5 $Header: /exports/cvsroot-2/cvsroot/kernel/gfan.cc,v 1.3 6 2009-04-20 15:35:04 monerjan Exp $6 $Id: gfan.cc,v 1.3 6 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 $ 7 7 */ 8 8 … … 745 745 }//bool isParallel 746 746 747 void interiorPoint(dd_MatrixPtr M) //no const &M here since we want to remove redundant rows747 void interiorPoint(dd_MatrixPtr &M) //no const &M here since we want to remove redundant rows 748 748 { 749 749 dd_LPPtr lp,lpInt; … … 751 751 dd_LPSolverType solver=dd_DualSimplex; 752 752 dd_LPSolutionPtr lpSol=NULL; 753 dd_rowset ddlinset,ddredrows; 753 dd_rowset ddlinset,ddredrows; //needed for dd_FindRelativeInterior 754 754 dd_rowindex ddnewpos; 755 755 dd_NumberType numb; … … 757 757 //M->objective-dd_LPMin; //Not sure whether this is needed 758 758 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 763 761 //dd_MatrixCanonicalize(&M, &ddlinset, &ddredrows, &ddnewpos, &err); 764 762 //if (err!=dd_NoError){cout << "Error during dd_MatrixCanonicalize" << endl;} 765 cout << "Tick 2" << endl;763 //cout << "Tick 2" << endl; 766 764 //dd_WriteMatrix(stdout,M); 767 765 768 766 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;} 770 768 if (lp==NULL){cout << "LP is NULL" << endl;} 771 769 dd_WriteLP(stdout,lp); 772 cout << "Tick 3" << endl;770 //cout << "Tick 3" << endl; 773 771 774 772 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;} 776 774 dd_WriteLP(stdout,lpInt); 777 cout << "Tick 4" << endl;775 //cout << "Tick 4" << endl; 778 776 779 777 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; 784 787 785 788 //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; 788 791 789 792 cout << "Interior point: "; 790 793 for (int ii=1; ii<(lpSol->d)-1;ii++) 791 794 { 792 dd_WriteNumber(stdout,lpSol->sol[ii]); 795 dd_WriteNumber(stdout,lpSol->sol[ii]); 793 796 } 794 dd_FreeLPData(lp);795 797 dd_FreeLPSolution(lpSol); 796 798 dd_FreeLPData(lpInt); 797 dd_Free Matrix(M);799 dd_FreeLPData(lp); 798 800 set_free(ddlinset); 799 801 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 800 806 }//void interiorPoint(dd_MatrixPtr const &M) 801 807 };//class gcone
Note: See TracChangeset
for help on using the changeset viewer.