static bool isFacet(ZMatrix const &g, int index) { bool ret; dd_MatrixPtr M=NULL,M2=NULL,M3=NULL; dd_colrange d; dd_ErrorType err=dd_NoError; dd_rowset redrows,linrows,ignoredrows, basisrows; dd_colset ignoredcols, basiscols; dd_DataFileType inputfile; FILE *reading=NULL; cddinitGmp(); M=ZMatrix2MatrixGmp(g, &err); if (err!=dd_NoError) goto _L99; d=M->colsize; static dd_Arow temp; dd_InitializeArow(g.getWidth()+1,&temp); ret= !dd_Redundant(M,index+1,temp,&err); dd_FreeMatrix(M); dd_FreeArow(g.getWidth()+1,temp); if (err!=dd_NoError) goto _L99; return ret; _L99: assert(0); return false; }
/* Heuristic for checking if inequality of full dimensional cone is a facet. If the routine returns true then the inequality is a facet. If it returns false it is unknown. */ static bool fastIsFacetCriterion(ZMatrix const &normals, int i) { int n=normals.getWidth(); for(int j=0;j<n;j++) if(normals[i][j].sign()!=0) { int sign=normals[i][j].sign(); bool isTheOnly=true; for(int k=0;k<normals.getHeight();k++) if(k!=i) { if(normals[i][j].sign()==sign) { isTheOnly=false; break; } } if(isTheOnly)return true; } return false; }