[74a91c9] | 1 | /* |
---|
| 2 | * gfanlib_polyhedralfan.cpp |
---|
| 3 | * |
---|
| 4 | * Created on: Nov 16, 2010 |
---|
| 5 | * Author: anders |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include <sstream> |
---|
| 9 | #include "gfanlib_polyhedralfan.h" |
---|
| 10 | #include "gfanlib_polymakefile.h" |
---|
| 11 | |
---|
| 12 | using namespace std; |
---|
| 13 | namespace gfan{ |
---|
| 14 | |
---|
| 15 | PolyhedralFan::PolyhedralFan(int ambientDimension): |
---|
| 16 | n(ambientDimension), |
---|
| 17 | symmetries(n) |
---|
| 18 | { |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | PolyhedralFan::PolyhedralFan(SymmetryGroup const &sym): |
---|
| 22 | n(sym.sizeOfBaseSet()), |
---|
| 23 | symmetries(sym) |
---|
| 24 | { |
---|
| 25 | |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | PolyhedralFan PolyhedralFan::fullSpace(int n) |
---|
| 29 | { |
---|
| 30 | PolyhedralFan ret(n); |
---|
| 31 | |
---|
| 32 | ZCone temp(n); |
---|
| 33 | temp.canonicalize(); |
---|
| 34 | ret.cones.insert(temp); |
---|
| 35 | |
---|
| 36 | return ret; |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | PolyhedralFan PolyhedralFan::facetsOfCone(ZCone const &c) |
---|
| 41 | { |
---|
| 42 | ZCone C(c); |
---|
| 43 | C.canonicalize(); |
---|
| 44 | PolyhedralFan ret(C.ambientDimension()); |
---|
| 45 | |
---|
| 46 | ZMatrix halfSpaces=C.getFacets(); |
---|
| 47 | |
---|
| 48 | for(int i=0;i<halfSpaces.getHeight();i++) |
---|
| 49 | { |
---|
| 50 | ZMatrix a(0,C.ambientDimension()); |
---|
| 51 | ZMatrix b(0,C.ambientDimension()); |
---|
| 52 | b.appendRow(halfSpaces[i]); |
---|
| 53 | ZCone N=intersection(ZCone(a,b),c); |
---|
| 54 | N.canonicalize(); |
---|
| 55 | ret.cones.insert(N); |
---|
| 56 | } |
---|
| 57 | return ret; |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | int PolyhedralFan::getAmbientDimension()const |
---|
| 62 | { |
---|
| 63 | return n; |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | bool PolyhedralFan::isEmpty()const |
---|
| 67 | { |
---|
| 68 | return cones.empty(); |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | int PolyhedralFan::getMaxDimension()const |
---|
| 72 | { |
---|
| 73 | assert(!cones.empty()); |
---|
| 74 | |
---|
| 75 | return cones.begin()->dimension(); |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | int PolyhedralFan::getMinDimension()const |
---|
| 79 | { |
---|
| 80 | assert(!cones.empty()); |
---|
| 81 | |
---|
| 82 | return cones.rbegin()->dimension(); |
---|
| 83 | } |
---|
| 84 | |
---|
| 85 | /* |
---|
| 86 | PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension, bool allowASingleConeOfCutOffDimension) |
---|
| 87 | { |
---|
| 88 | // fprintf(Stderr,"PolyhedralFan refinement: #A=%i #B=%i\n",a.cones.size(),b.cones.size()); |
---|
| 89 | int conesSkipped=0; |
---|
| 90 | int numberOfComputedCones=0; |
---|
| 91 | bool linealityConeFound=!allowASingleConeOfCutOffDimension; |
---|
| 92 | assert(a.getAmbientDimension()==b.getAmbientDimension()); |
---|
| 93 | |
---|
| 94 | PolyhedralFan ret(a.getAmbientDimension()); |
---|
| 95 | |
---|
| 96 | for(PolyhedralConeList::const_iterator A=a.cones.begin();A!=a.cones.end();A++) |
---|
| 97 | for(PolyhedralConeList::const_iterator B=b.cones.begin();B!=b.cones.end();B++) |
---|
| 98 | { |
---|
| 99 | PolyhedralCone c=intersection(*A,*B); |
---|
| 100 | int cdim=c.dimension(); |
---|
| 101 | // assert(cdim>=linealitySpaceDimension); |
---|
| 102 | bool thisIsLinealityCone=(cutOffDimension>=cdim); |
---|
| 103 | if((!thisIsLinealityCone)||(!linealityConeFound)) |
---|
| 104 | { |
---|
| 105 | numberOfComputedCones++; |
---|
| 106 | c.canonicalize(); |
---|
| 107 | ret.cones.insert(c); |
---|
| 108 | linealityConeFound=linealityConeFound || thisIsLinealityCone; |
---|
| 109 | } |
---|
| 110 | else |
---|
| 111 | { |
---|
| 112 | conesSkipped++; |
---|
| 113 | } |
---|
| 114 | } |
---|
| 115 | // fprintf(Stderr,"Number of skipped cones: %i, lineality cone found: %i\n",conesSkipped,linealityConeFound); |
---|
| 116 | // fprintf(Stderr,"Number of computed cones: %i, number of unique cones: %i\n",numberOfComputedCones,ret.cones.size()); |
---|
| 117 | |
---|
| 118 | return ret; |
---|
| 119 | } |
---|
| 120 | */ |
---|
| 121 | |
---|
| 122 | /* |
---|
| 123 | PolyhedralFan product(const PolyhedralFan &a, const PolyhedralFan &b) |
---|
| 124 | { |
---|
| 125 | PolyhedralFan ret(a.getAmbientDimension()+b.getAmbientDimension()); |
---|
| 126 | |
---|
| 127 | for(PolyhedralConeList::const_iterator A=a.cones.begin();A!=a.cones.end();A++) |
---|
| 128 | for(PolyhedralConeList::const_iterator B=b.cones.begin();B!=b.cones.end();B++) |
---|
| 129 | ret.insert(product(*A,*B)); |
---|
| 130 | |
---|
| 131 | return ret; |
---|
| 132 | } |
---|
| 133 | */ |
---|
| 134 | |
---|
| 135 | /*IntegerVectorList PolyhedralFan::getRays(int dim) |
---|
| 136 | { |
---|
| 137 | IntegerVectorList ret; |
---|
| 138 | for(PolyhedralConeList::iterator i=cones.begin();i!=cones.end();i++) |
---|
| 139 | { |
---|
| 140 | if(i->dimension()==dim) |
---|
| 141 | ret.push_back(i->getRelativeInteriorPoint()); |
---|
| 142 | } |
---|
| 143 | return ret; |
---|
| 144 | } |
---|
| 145 | */ |
---|
| 146 | |
---|
| 147 | /*IntegerVectorList PolyhedralFan::getRelativeInteriorPoints() |
---|
| 148 | { |
---|
| 149 | IntegerVectorList ret; |
---|
| 150 | for(PolyhedralConeList::iterator i=cones.begin();i!=cones.end();i++) |
---|
| 151 | { |
---|
| 152 | ret.push_back(i->getRelativeInteriorPoint()); |
---|
| 153 | } |
---|
| 154 | return ret; |
---|
| 155 | } |
---|
| 156 | */ |
---|
| 157 | |
---|
| 158 | /*PolyhedralCone const& PolyhedralFan::highestDimensionalCone()const |
---|
| 159 | { |
---|
| 160 | return *cones.rbegin(); |
---|
| 161 | } |
---|
| 162 | */ |
---|
| 163 | void PolyhedralFan::insert(ZCone const &c) |
---|
| 164 | { |
---|
[43317d] | 165 | ZCone temp=c; |
---|
| 166 | temp.canonicalize(); |
---|
| 167 | cones.insert(temp); |
---|
[74a91c9] | 168 | } |
---|
| 169 | |
---|
| 170 | void PolyhedralFan::remove(ZCone const &c) |
---|
| 171 | { |
---|
| 172 | cones.erase(c); |
---|
| 173 | } |
---|
| 174 | |
---|
| 175 | /* |
---|
| 176 | void PolyhedralFan::removeAllExcept(int a) |
---|
| 177 | { |
---|
| 178 | PolyhedralConeList::iterator i=cones.begin(); |
---|
| 179 | while(a>0) |
---|
| 180 | { |
---|
| 181 | if(i==cones.end())return; |
---|
| 182 | i++; |
---|
| 183 | a--; |
---|
| 184 | } |
---|
| 185 | cones.erase(i,cones.end()); |
---|
| 186 | } |
---|
| 187 | */ |
---|
| 188 | |
---|
| 189 | void PolyhedralFan::removeAllLowerDimensional() |
---|
| 190 | { |
---|
| 191 | if(!cones.empty()) |
---|
| 192 | { |
---|
| 193 | int d=getMaxDimension(); |
---|
| 194 | PolyhedralConeList::iterator i=cones.begin(); |
---|
| 195 | while(i!=cones.end() && i->dimension()==d)i++; |
---|
| 196 | cones.erase(i,cones.end()); |
---|
| 197 | } |
---|
| 198 | } |
---|
| 199 | |
---|
| 200 | |
---|
| 201 | PolyhedralFan PolyhedralFan::facetComplex()const |
---|
| 202 | { |
---|
| 203 | // fprintf(Stderr,"Computing facet complex...\n"); |
---|
| 204 | PolyhedralFan ret(n); |
---|
| 205 | |
---|
| 206 | for(PolyhedralConeList::iterator i=cones.begin();i!=cones.end();i++) |
---|
| 207 | { |
---|
| 208 | PolyhedralFan a=facetsOfCone(*i); |
---|
| 209 | for(PolyhedralConeList::const_iterator j=a.cones.begin();j!=a.cones.end();j++) |
---|
| 210 | ret.insert(*j); |
---|
| 211 | } |
---|
| 212 | // fprintf(Stderr,"Done computing facet complex.\n"); |
---|
| 213 | return ret; |
---|
| 214 | } |
---|
| 215 | |
---|
| 216 | |
---|
| 217 | /* |
---|
| 218 | PolyhedralFan PolyhedralFan::fullComplex()const |
---|
| 219 | { |
---|
| 220 | PolyhedralFan ret=*this; |
---|
| 221 | |
---|
| 222 | while(1) |
---|
| 223 | { |
---|
| 224 | log2 debug<<"looping"; |
---|
| 225 | bool doLoop=false; |
---|
| 226 | PolyhedralFan facets=ret.facetComplex(); |
---|
| 227 | log2 debug<<"number of facets"<<facets.size()<<"\n"; |
---|
| 228 | for(PolyhedralConeList::const_iterator i=facets.cones.begin();i!=facets.cones.end();i++) |
---|
| 229 | if(!ret.contains(*i)) |
---|
| 230 | { |
---|
| 231 | ret.insert(*i); |
---|
| 232 | doLoop=true; |
---|
| 233 | } |
---|
| 234 | if(!doLoop)break; |
---|
| 235 | } |
---|
| 236 | return ret; |
---|
| 237 | } |
---|
| 238 | */ |
---|
| 239 | |
---|
| 240 | |
---|
| 241 | #if 0 |
---|
| 242 | PolyhedralFan PolyhedralFan::facetComplexSymmetry(SymmetryGroup const &sym, bool keepRays, bool dropLinealitySpace)const |
---|
| 243 | { |
---|
| 244 | log1 fprintf(Stderr,"Computing facet complex...\n"); |
---|
| 245 | PolyhedralFan ret(n); |
---|
| 246 | |
---|
| 247 | vector<IntegerVector> relIntTable; |
---|
| 248 | vector<int> dimensionTable; |
---|
| 249 | |
---|
| 250 | if(keepRays) |
---|
| 251 | for(PolyhedralConeList::iterator i=cones.begin();i!=cones.end();i++) |
---|
| 252 | if(i->dimension()==i->dimensionOfLinealitySpace()+1) |
---|
| 253 | { |
---|
| 254 | relIntTable.push_back(i->getRelativeInteriorPoint()); |
---|
| 255 | dimensionTable.push_back(i->dimension()); |
---|
| 256 | ret.insert(*i); |
---|
| 257 | } |
---|
| 258 | |
---|
| 259 | for(PolyhedralConeList::iterator i=cones.begin();i!=cones.end();i++) |
---|
| 260 | { |
---|
| 261 | int iDim=i->dimension(); |
---|
| 262 | if(dropLinealitySpace && (i->dimension()==i->dimensionOfLinealitySpace()+1))continue; |
---|
| 263 | |
---|
| 264 | // i->findFacets(); |
---|
| 265 | IntegerVectorList normals=i->getHalfSpaces(); |
---|
| 266 | for(IntegerVectorList::const_iterator j=normals.begin();j!=normals.end();j++) |
---|
| 267 | { |
---|
| 268 | bool alreadyInRet=false; |
---|
| 269 | for(int l=0;l<relIntTable.size();l++) |
---|
| 270 | { |
---|
| 271 | if(dimensionTable[l]==iDim-1) |
---|
| 272 | for(SymmetryGroup::ElementContainer::const_iterator k=sym.elements.begin();k!=sym.elements.end();k++) |
---|
| 273 | { |
---|
| 274 | IntegerVector u=SymmetryGroup::compose(*k,relIntTable[l]); |
---|
| 275 | if((dotLong(*j,u)==0) && (i->contains(u))) |
---|
| 276 | { |
---|
| 277 | alreadyInRet=true; |
---|
| 278 | goto exitLoop; |
---|
| 279 | } |
---|
| 280 | } |
---|
| 281 | } |
---|
| 282 | exitLoop: |
---|
| 283 | if(!alreadyInRet) |
---|
| 284 | { |
---|
| 285 | IntegerVectorList equations=i->getEquations(); |
---|
| 286 | IntegerVectorList inequalities=i->getHalfSpaces(); |
---|
| 287 | equations.push_back(*j); |
---|
| 288 | PolyhedralCone c(inequalities,equations,n); |
---|
| 289 | c.canonicalize(); |
---|
| 290 | ret.insert(c); |
---|
| 291 | relIntTable.push_back(c.getRelativeInteriorPoint()); |
---|
| 292 | dimensionTable.push_back(c.dimension()); |
---|
| 293 | } |
---|
| 294 | } |
---|
| 295 | } |
---|
| 296 | log1 fprintf(Stderr,"Done computing facet complex.\n"); |
---|
| 297 | return ret; |
---|
| 298 | } |
---|
| 299 | #endif |
---|
| 300 | |
---|
| 301 | |
---|
| 302 | |
---|
| 303 | ZMatrix PolyhedralFan::getRaysInPrintingOrder(bool upToSymmetry)const |
---|
| 304 | { |
---|
| 305 | /* |
---|
| 306 | * The ordering changed in this version. Previously the orbit representatives stored in "rays" were |
---|
| 307 | * just the first extreme ray from the orbit that appeared. Now it is gotten using "orbitRepresentative" |
---|
| 308 | * which causes the ordering in which the different orbits appear to change. |
---|
| 309 | */ |
---|
| 310 | if(cones.empty())return ZMatrix(0,n); |
---|
| 311 | ZMatrix generatorsOfLinealitySpace=cones.begin()->generatorsOfLinealitySpace();//all cones have the same lineality space |
---|
| 312 | |
---|
[e543dd] | 313 | |
---|
[74a91c9] | 314 | std::set<ZVector> rays;//(this->getAmbientDimension()); |
---|
| 315 | // log1 fprintf(Stderr,"Computing rays of %i cones\n",cones.size()); |
---|
| 316 | for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) |
---|
| 317 | { |
---|
| 318 | ZMatrix temp=i->extremeRays(&generatorsOfLinealitySpace); |
---|
[e543dd] | 319 | // std::cerr<<temp; |
---|
[74a91c9] | 320 | for(int j=0;j<temp.getHeight();j++) |
---|
| 321 | rays.insert(symmetries.orbitRepresentative(temp[j])); |
---|
| 322 | } |
---|
| 323 | ZMatrix ret(0,getAmbientDimension()); |
---|
| 324 | if(upToSymmetry) |
---|
| 325 | for(set<ZVector>::const_iterator i=rays.begin();i!=rays.end();i++)ret.appendRow(*i); |
---|
| 326 | else |
---|
| 327 | for(set<ZVector>::const_iterator i=rays.begin();i!=rays.end();i++) |
---|
| 328 | { |
---|
| 329 | set<ZVector> thisOrbitsRays; |
---|
| 330 | for(SymmetryGroup::ElementContainer::const_iterator k=symmetries.elements.begin();k!=symmetries.elements.end();k++) |
---|
| 331 | { |
---|
| 332 | ZVector temp=k->apply(*i); |
---|
| 333 | thisOrbitsRays.insert(temp); |
---|
| 334 | } |
---|
| 335 | |
---|
| 336 | for(set<ZVector>::const_iterator i=thisOrbitsRays.begin();i!=thisOrbitsRays.end();i++)ret.appendRow(*i); |
---|
| 337 | } |
---|
| 338 | return ret; |
---|
| 339 | } |
---|
| 340 | |
---|
| 341 | |
---|
| 342 | |
---|
| 343 | /*MARKS CONES AS NONMAXIMAL IN THE SYMMETRIC COMPLEX IN WHICH THEY WILL BE INSERTED -not to be confused with the facet testing in the code |
---|
| 344 | */ |
---|
| 345 | static list<SymmetricComplex::Cone> computeFacets(SymmetricComplex::Cone const &theCone, ZMatrix const &rays, ZMatrix const &facetCandidates, SymmetricComplex const &theComplex/*, int linealityDim*/) |
---|
| 346 | { |
---|
| 347 | set<SymmetricComplex::Cone> ret; |
---|
| 348 | |
---|
| 349 | for(int i=0;i<facetCandidates.getHeight();i++) |
---|
| 350 | { |
---|
| 351 | set<int> indices; |
---|
| 352 | |
---|
| 353 | bool notAll=false; |
---|
| 354 | for(int j=0;j<theCone.indices.size();j++) |
---|
| 355 | if(dot(rays[theCone.indices[j]],facetCandidates[i]).sign()==0) |
---|
| 356 | indices.insert(theCone.indices[j]); |
---|
| 357 | else |
---|
| 358 | notAll=true; |
---|
| 359 | |
---|
| 360 | SymmetricComplex::Cone temp(indices,theCone.dimension-1,Integer(),false,theComplex); |
---|
| 361 | /* temp.multiplicity=0; |
---|
| 362 | temp.dimension=theCone.dimension-1; |
---|
| 363 | temp.setIgnoreSymmetry(true); |
---|
| 364 | */ |
---|
| 365 | if(notAll)ret.insert(temp); |
---|
| 366 | |
---|
| 367 | } |
---|
| 368 | // fprintf(Stderr,"HEJ!!!!\n"); |
---|
| 369 | |
---|
| 370 | list<SymmetricComplex::Cone> ret2; |
---|
| 371 | for(set<SymmetricComplex::Cone>::const_iterator i=ret.begin();i!=ret.end();i++) |
---|
| 372 | { |
---|
| 373 | bool isMaximal=true; |
---|
| 374 | |
---|
| 375 | /* if(i->indices.size()+linealityDim<i->dimension)//#3 |
---|
| 376 | isMaximal=false; |
---|
| 377 | else*/ |
---|
| 378 | for(set<SymmetricComplex::Cone>::const_iterator j=ret.begin();j!=ret.end();j++) |
---|
| 379 | if(i!=j && i->isSubsetOf(*j)) |
---|
| 380 | { |
---|
| 381 | isMaximal=false; |
---|
| 382 | break; |
---|
| 383 | } |
---|
| 384 | if(isMaximal) |
---|
| 385 | { |
---|
| 386 | SymmetricComplex::Cone temp(i->indexSet(),i->dimension,i->multiplicity,true,theComplex); |
---|
| 387 | temp.setKnownToBeNonMaximal(); // THIS IS WHERE WE SET THE CONES NON-MAXIMAL FLAG |
---|
| 388 | // temp.setIgnoreSymmetry(false); |
---|
| 389 | ret2.push_back(temp); |
---|
| 390 | } |
---|
| 391 | } |
---|
| 392 | return ret2; |
---|
| 393 | } |
---|
| 394 | |
---|
| 395 | void addFacesToSymmetricComplex(SymmetricComplex &c, ZCone const &cone, ZMatrix const &facetCandidates, ZMatrix const &generatorsOfLinealitySpace) |
---|
| 396 | { |
---|
| 397 | ZMatrix const &rays=c.getVertices(); |
---|
| 398 | std::set<int> indices; |
---|
| 399 | |
---|
| 400 | // for(int j=0;j<rays.getHeight();j++)if(cone.contains(rays[j]))indices.insert(j); |
---|
| 401 | |
---|
| 402 | ZMatrix l=cone.extremeRays(&generatorsOfLinealitySpace); |
---|
| 403 | for(int i=0;i<l.getHeight();i++)indices.insert(c.indexOfVertex(l[i])); |
---|
| 404 | |
---|
| 405 | addFacesToSymmetricComplex(c,indices,facetCandidates,cone.dimension(),cone.getMultiplicity()); |
---|
| 406 | } |
---|
| 407 | |
---|
| 408 | void addFacesToSymmetricComplex(SymmetricComplex &c, std::set<int> const &indices, ZMatrix const &facetCandidates, int dimension, Integer multiplicity) |
---|
| 409 | { |
---|
| 410 | ZMatrix const &rays=c.getVertices(); |
---|
| 411 | list<SymmetricComplex::Cone> clist; |
---|
| 412 | { |
---|
| 413 | SymmetricComplex::Cone temp(indices,dimension,multiplicity,true,c); |
---|
| 414 | // temp.dimension=cone.dimension(); |
---|
| 415 | // temp.multiplicity=cone.getMultiplicity(); |
---|
| 416 | clist.push_back(temp); |
---|
| 417 | } |
---|
| 418 | |
---|
| 419 | // int linealityDim=cone.dimensionOfLinealitySpace(); |
---|
| 420 | |
---|
| 421 | while(!clist.empty()) |
---|
| 422 | { |
---|
| 423 | SymmetricComplex::Cone &theCone=clist.front(); |
---|
| 424 | |
---|
| 425 | if(!c.contains(theCone)) |
---|
| 426 | { |
---|
| 427 | c.insert(theCone); |
---|
| 428 | list<SymmetricComplex::Cone> facets=computeFacets(theCone,rays,facetCandidates,c/*,linealityDim*/); |
---|
| 429 | clist.splice(clist.end(),facets); |
---|
| 430 | } |
---|
| 431 | clist.pop_front(); |
---|
| 432 | } |
---|
| 433 | |
---|
| 434 | } |
---|
| 435 | |
---|
| 436 | #if 0 |
---|
| 437 | /** |
---|
| 438 | Produce strings that express the vectors in terms of rays of the fan modulo the lineality space. Symmetry is ignored?? |
---|
| 439 | */ |
---|
| 440 | vector<string> PolyhedralFan::renamingStrings(IntegerVectorList const &theVectors, IntegerVectorList const &originalRays, IntegerVectorList const &linealitySpace, SymmetryGroup *sym)const |
---|
| 441 | { |
---|
| 442 | vector<string> ret; |
---|
| 443 | for(IntegerVectorList::const_iterator i=theVectors.begin();i!=theVectors.end();i++) |
---|
| 444 | { |
---|
| 445 | for(PolyhedralConeList::const_iterator j=cones.begin();j!=cones.end();j++) |
---|
| 446 | { |
---|
| 447 | if(j->contains(*i)) |
---|
| 448 | { |
---|
| 449 | vector<int> relevantIndices; |
---|
| 450 | IntegerVectorList relevantRays=linealitySpace; |
---|
| 451 | int K=0; |
---|
| 452 | for(IntegerVectorList::const_iterator k=originalRays.begin();k!=originalRays.end();k++,K++) |
---|
| 453 | if(j->contains(*k)) |
---|
| 454 | { |
---|
| 455 | relevantIndices.push_back(K); |
---|
| 456 | relevantRays.push_back(*k); |
---|
| 457 | } |
---|
| 458 | |
---|
| 459 | FieldMatrix LFA(Q,relevantRays.size(),n); |
---|
| 460 | int J=0; |
---|
| 461 | for(IntegerVectorList::const_iterator j=relevantRays.begin();j!=relevantRays.end();j++,J++) |
---|
| 462 | LFA[J]=integerVectorToFieldVector(*j,Q); |
---|
| 463 | FieldVector LFB=concatenation(integerVectorToFieldVector(*i,Q),FieldVector(Q,relevantRays.size())); |
---|
| 464 | LFA=LFA.transposed(); |
---|
| 465 | FieldVector LFX=LFA.solver().canonicalize(LFB); |
---|
| 466 | stringstream s; |
---|
| 467 | if(LFX.subvector(0,n).isZero()) |
---|
| 468 | { |
---|
| 469 | s<<"Was:"; |
---|
| 470 | FieldVector S=LFX.subvector(n+linealitySpace.size(),LFX.size()); |
---|
| 471 | for(int k=0;k<S.size();k++) |
---|
| 472 | if(!S[k].isZero()) |
---|
| 473 | s<<"+"<<S[k].toString()<<"*["<<relevantIndices[k]<<"] "; |
---|
| 474 | } |
---|
| 475 | ret.push_back(s.str()); |
---|
| 476 | break; |
---|
| 477 | } |
---|
| 478 | } |
---|
| 479 | } |
---|
| 480 | return ret; |
---|
| 481 | } |
---|
| 482 | #endif |
---|
| 483 | |
---|
| 484 | SymmetricComplex PolyhedralFan::toSymmetricComplex()const |
---|
| 485 | { |
---|
| 486 | |
---|
| 487 | ZMatrix rays=getRaysInPrintingOrder(); |
---|
| 488 | |
---|
| 489 | ZMatrix generatorsOfLinealitySpace=cones.empty()?ZMatrix::identity(getAmbientDimension()):cones.begin()->generatorsOfLinealitySpace(); |
---|
| 490 | SymmetricComplex symCom(rays,generatorsOfLinealitySpace,symmetries); |
---|
| 491 | |
---|
| 492 | for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) |
---|
| 493 | { |
---|
| 494 | addFacesToSymmetricComplex(symCom,*i,i->getFacets(),generatorsOfLinealitySpace); |
---|
| 495 | } |
---|
| 496 | |
---|
| 497 | // log1 cerr<<"Remapping"; |
---|
| 498 | symCom.remap(); |
---|
| 499 | // log1 cerr<<"Done remapping"; |
---|
[e543dd] | 500 | |
---|
[74a91c9] | 501 | return symCom; |
---|
| 502 | } |
---|
| 503 | |
---|
| 504 | std::string PolyhedralFan::toString(int flags)const |
---|
| 505 | //void PolyhedralFan::printWithIndices(class Printer *p, bool printMultiplicities, SymmetryGroup *sym, bool group, bool ignoreCones, bool xml, bool tPlaneSort, vector<string> const *comments)const |
---|
| 506 | { |
---|
| 507 | stringstream ret; |
---|
| 508 | |
---|
| 509 | for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) |
---|
| 510 | { |
---|
| 511 | ret<<"Cone\n"<<endl; |
---|
| 512 | ret<<*i; |
---|
| 513 | } return ret.str(); |
---|
| 514 | #if 0 |
---|
| 515 | PolymakeFile polymakeFile; |
---|
| 516 | polymakeFile.create("NONAME","PolyhedralFan","PolyhedralFan",flags&FPF_xml); |
---|
| 517 | |
---|
| 518 | // if(!sym)sym=&symm; |
---|
| 519 | |
---|
| 520 | if(cones.empty()) |
---|
| 521 | { |
---|
| 522 | // p->printString("Polyhedral fan is empty. Printing not supported.\n"); |
---|
| 523 | ret<<"Polyhedral fan is empty. Printing not supported.\n"; |
---|
| 524 | return ret.str(); |
---|
| 525 | } |
---|
| 526 | |
---|
| 527 | int h=cones.begin()->dimensionOfLinealitySpace(); |
---|
| 528 | |
---|
| 529 | // log1 fprintf(Stderr,"Computing rays.\n"); |
---|
| 530 | ZMatrix rays=getRaysInPrintingOrder(); |
---|
| 531 | |
---|
| 532 | SymmetricComplex symCom(rays,cones.begin()->generatorsOfLinealitySpace(),symmetries); |
---|
| 533 | |
---|
| 534 | polymakeFile.writeCardinalProperty("AMBIENT_DIM",n); |
---|
| 535 | polymakeFile.writeCardinalProperty("DIM",getMaxDimension()); |
---|
| 536 | polymakeFile.writeCardinalProperty("LINEALITY_DIM",h); |
---|
| 537 | polymakeFile.writeMatrixProperty("RAYS",rays,true,comments); |
---|
| 538 | polymakeFile.writeCardinalProperty("N_RAYS",rays.size()); |
---|
| 539 | IntegerVectorList linealitySpaceGenerators=highestDimensionalCone().linealitySpace().dualCone().getEquations(); |
---|
| 540 | polymakeFile.writeMatrixProperty("LINEALITY_SPACE",rowsToIntegerMatrix(linealitySpaceGenerators,n)); |
---|
| 541 | polymakeFile.writeMatrixProperty("ORTH_LINEALITY_SPACE",rowsToIntegerMatrix(highestDimensionalCone().linealitySpace().getEquations(),n)); |
---|
| 542 | |
---|
| 543 | if(flags & FPF_primitiveRays) |
---|
| 544 | { |
---|
| 545 | ZMatrix primitiveRays; |
---|
| 546 | for(IntegerVectorList::const_iterator i=rays.begin();i!=rays.end();i++) |
---|
| 547 | for(PolyhedralConeList::const_iterator j=cones.begin();j!=cones.end();j++) |
---|
| 548 | if(j->contains(*i)&&(j->dimensionOfLinealitySpace()+1==j->dimension())) |
---|
| 549 | primitiveRays.push_back(j->semiGroupGeneratorOfRay()); |
---|
| 550 | |
---|
| 551 | polymakeFile.writeMatrixProperty("PRIMITIVE_RAYS",rowsToIntegerMatrix(primitiveRays,n)); |
---|
| 552 | } |
---|
| 553 | |
---|
| 554 | |
---|
| 555 | ZMatrix generatorsOfLinealitySpace=cones.begin()->generatorsOfLinealitySpace(); |
---|
| 556 | |
---|
| 557 | log1 fprintf(Stderr,"Building symmetric complex.\n"); |
---|
| 558 | for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) |
---|
| 559 | { |
---|
| 560 | { |
---|
| 561 | static int t; |
---|
| 562 | // log1 fprintf(Stderr,"Adding faces of cone %i\n",t++); |
---|
| 563 | } |
---|
| 564 | // log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); |
---|
| 565 | |
---|
| 566 | addFacesToSymmetricComplex(symCom,*i,i->getHalfSpaces(),generatorsOfLinealitySpace); |
---|
| 567 | } |
---|
| 568 | |
---|
| 569 | // log1 cerr<<"Remapping"; |
---|
| 570 | symCom.remap(); |
---|
| 571 | // log1 cerr<<"Done remapping"; |
---|
| 572 | |
---|
| 573 | |
---|
| 574 | PolyhedralFan f=*this; |
---|
| 575 | |
---|
| 576 | // log1 fprintf(Stderr,"Computing f-vector.\n"); |
---|
| 577 | ZVector fvector=symCom.fvector(); |
---|
| 578 | polymakeFile.writeCardinalVectorProperty("F_VECTOR",fvector); |
---|
| 579 | // log1 fprintf(Stderr,"Done computing f-vector.\n"); |
---|
| 580 | |
---|
| 581 | if(flags&FPF_boundedInfo) |
---|
| 582 | { |
---|
| 583 | // log1 fprintf(Stderr,"Computing bounded f-vector.\n"); |
---|
| 584 | ZVector fvectorBounded=symCom.fvector(true); |
---|
| 585 | polymakeFile.writeCardinalVectorProperty("F_VECTOR_BOUNDED",fvectorBounded); |
---|
| 586 | // log1 fprintf(Stderr,"Done computing bounded f-vector.\n"); |
---|
| 587 | } |
---|
| 588 | { |
---|
| 589 | Integer euler; |
---|
| 590 | int mul=-1; |
---|
| 591 | for(int i=0;i<fvector.size();i++,mul*=-1)euler+=Integer(mul)*fvector[i]; |
---|
| 592 | polymakeFile.writeCardinalProperty("MY_EULER",euler); |
---|
| 593 | } |
---|
| 594 | |
---|
| 595 | // log1 fprintf(Stderr,"Checking if complex is simplicial and pure.\n"); |
---|
| 596 | polymakeFile.writeCardinalProperty("SIMPLICIAL",symCom.isSimplicial()); |
---|
| 597 | polymakeFile.writeCardinalProperty("PURE",symCom.isPure()); |
---|
| 598 | // log1 fprintf(Stderr,"Done checking.\n"); |
---|
| 599 | |
---|
| 600 | |
---|
| 601 | if(flags&FPF_conesCompressed) |
---|
| 602 | { |
---|
| 603 | // log1 fprintf(Stderr,"Producing list of cones up to symmetry.\n"); |
---|
| 604 | polymakeFile.writeStringProperty("CONES_ORBITS",symCom.toString(symCom.getMinDim(),symCom.getMaxDim(),false,flags&FPF_group,0,true,flags&FPF_tPlaneSort)); |
---|
| 605 | // log1 fprintf(Stderr,"Done producing list of cones up to symmetry.\n"); |
---|
| 606 | // log1 fprintf(Stderr,"Producing list of maximal cones up to symmetry.\n"); |
---|
| 607 | stringstream multiplicities; |
---|
| 608 | polymakeFile.writeStringProperty("MAXIMAL_CONES_ORBITS",symCom.toString(symCom.getMinDim(),symCom.getMaxDim(),true,flags&FPF_group, &multiplicities,true,flags&FPF_tPlaneSort)); |
---|
| 609 | if(flags&FPF_multiplicities)polymakeFile.writeStringProperty("MULTIPLICITIES_ORBITS",multiplicities.str()); |
---|
| 610 | // log1 fprintf(Stderr,"Done producing list of maximal cones up to symmetry.\n"); |
---|
| 611 | } |
---|
| 612 | |
---|
| 613 | if(flags&FPF_conesExpanded) |
---|
| 614 | { |
---|
| 615 | if(flags&FPF_cones) |
---|
| 616 | { |
---|
| 617 | // log1 fprintf(Stderr,"Producing list of cones.\n"); |
---|
| 618 | polymakeFile.writeStringProperty("CONES",symCom.toString(symCom.getMinDim(),symCom.getMaxDim(),false,flags&FPF_group,0,false,flags&FPF_tPlaneSort)); |
---|
| 619 | // log1 fprintf(Stderr,"Done producing list of cones.\n"); |
---|
| 620 | } |
---|
| 621 | if(flags&FPF_maximalCones) |
---|
| 622 | { |
---|
| 623 | // log1 fprintf(Stderr,"Producing list of maximal cones.\n"); |
---|
| 624 | stringstream multiplicities; |
---|
| 625 | polymakeFile.writeStringProperty("MAXIMAL_CONES",symCom.toString(symCom.getMinDim(),symCom.getMaxDim(),true,flags&FPF_group, &multiplicities,false,flags&FPF_tPlaneSort)); |
---|
| 626 | if(flags&FPF_multiplicities)polymakeFile.writeStringProperty("MULTIPLICITIES",multiplicities.str()); |
---|
| 627 | // log1 fprintf(Stderr,"Done producing list of maximal cones.\n"); |
---|
| 628 | } |
---|
| 629 | } |
---|
| 630 | #endif |
---|
| 631 | #if 0 |
---|
| 632 | if(flags&FPF_values) |
---|
| 633 | { |
---|
| 634 | { |
---|
| 635 | ZMatrix values; |
---|
| 636 | for(int i=0;i<linealitySpaceGenerators.getHeight();i++) |
---|
| 637 | { |
---|
| 638 | ZVector v(1); |
---|
| 639 | v[0]=evaluatePiecewiseLinearFunction(linealitySpaceGenerators[i]); |
---|
| 640 | values.appendRow(v); |
---|
| 641 | } |
---|
| 642 | polymakeFile.writeMatrixProperty("LINEALITY_VALUES",rowsToIntegerMatrix(values,1)); |
---|
| 643 | } |
---|
| 644 | { |
---|
| 645 | ZMatrix values; |
---|
| 646 | for(IntegerVectorList::const_iterator i=rays.begin();i!=rays.end();i++) |
---|
| 647 | { |
---|
| 648 | ZVector v(1); |
---|
| 649 | v[0]=evaluatePiecewiseLinearFunction(*i); |
---|
| 650 | values.push_back(v); |
---|
| 651 | } |
---|
| 652 | polymakeFile.writeMatrixProperty("RAY_VALUES",rowsToIntegerMatrix(values,1)); |
---|
| 653 | } |
---|
| 654 | } |
---|
| 655 | #endif |
---|
| 656 | |
---|
| 657 | |
---|
| 658 | // log1 fprintf(Stderr,"Producing final string for output.\n"); |
---|
| 659 | /* stringstream s; |
---|
| 660 | polymakeFile.writeStream(s); |
---|
| 661 | string S=s.str(); |
---|
| 662 | // log1 fprintf(Stderr,"Printing string.\n"); |
---|
| 663 | p->printString(S.c_str()); |
---|
| 664 | */// log1 fprintf(Stderr,"Done printing string.\n"); |
---|
| 665 | } |
---|
| 666 | |
---|
| 667 | #if 0 |
---|
| 668 | PolyhedralFan PolyhedralFan::readFan(string const &filename, bool onlyMaximal, IntegerVector *w, set<int> const *coneIndices, SymmetryGroup const *sym, bool readCompressedIfNotSym) |
---|
| 669 | { |
---|
| 670 | PolymakeFile inFile; |
---|
| 671 | inFile.open(filename.c_str()); |
---|
| 672 | |
---|
| 673 | int n=inFile.readCardinalProperty("AMBIENT_DIM"); |
---|
| 674 | int nRays=inFile.readCardinalProperty("N_RAYS"); |
---|
| 675 | IntegerMatrix rays=inFile.readMatrixProperty("RAYS",nRays,n); |
---|
| 676 | int linealityDim=inFile.readCardinalProperty("LINEALITY_DIM"); |
---|
| 677 | IntegerMatrix linealitySpace=inFile.readMatrixProperty("LINEALITY_SPACE",linealityDim,n); |
---|
| 678 | |
---|
| 679 | |
---|
| 680 | const char *sectionName=0; |
---|
| 681 | const char *sectionNameMultiplicities=0; |
---|
| 682 | if(sym || readCompressedIfNotSym) |
---|
| 683 | { |
---|
| 684 | sectionName=(onlyMaximal)?"MAXIMAL_CONES_ORBITS":"CONES_ORBITS"; |
---|
| 685 | sectionNameMultiplicities=(onlyMaximal)?"MULTIPLICITIES_ORBITS":"DUMMY123"; |
---|
| 686 | } |
---|
| 687 | else |
---|
| 688 | { sectionName=(onlyMaximal)?"MAXIMAL_CONES":"CONES"; |
---|
| 689 | sectionNameMultiplicities=(onlyMaximal)?"MULTIPLICITIES":"DUMMY123"; |
---|
| 690 | } |
---|
| 691 | |
---|
| 692 | |
---|
| 693 | IntegerVector w2(n); |
---|
| 694 | if(w==0)w=&w2; |
---|
| 695 | |
---|
| 696 | SymmetryGroup sym2(n); |
---|
| 697 | if(sym==0)sym=&sym2; |
---|
| 698 | |
---|
| 699 | vector<list<int> > cones=inFile.readMatrixIncidenceProperty(sectionName); |
---|
| 700 | IntegerVectorList r; |
---|
| 701 | |
---|
| 702 | bool hasMultiplicities=inFile.hasProperty(sectionNameMultiplicities); |
---|
| 703 | IntegerMatrix multiplicities(0,0); |
---|
| 704 | if(hasMultiplicities)multiplicities=inFile.readMatrixProperty(sectionNameMultiplicities,cones.size(),1); |
---|
| 705 | |
---|
| 706 | |
---|
| 707 | PolyhedralFan ret(n); |
---|
| 708 | |
---|
| 709 | log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; |
---|
| 710 | for(int i=0;i<cones.size();i++) |
---|
| 711 | if(coneIndices==0 || coneIndices->count(i)) |
---|
| 712 | { |
---|
| 713 | log2 cerr<<"Expanding symmetries of cone"<<endl; |
---|
| 714 | { |
---|
| 715 | IntegerVectorList coneRays; |
---|
| 716 | for(list<int>::const_iterator j=cones[i].begin();j!=cones[i].end();j++) |
---|
| 717 | coneRays.push_back((rays[*j])); |
---|
| 718 | PolyhedralCone C=PolyhedralCone::givenByRays(coneRays,linealitySpace.getRows(),n); |
---|
| 719 | if(hasMultiplicities)C.setMultiplicity(multiplicities[i][0]); |
---|
| 720 | for(SymmetryGroup::ElementContainer::const_iterator perm=sym->elements.begin();perm!=sym->elements.end();perm++) |
---|
| 721 | { |
---|
| 722 | if(C.contains(SymmetryGroup::composeInverse(*perm,*w))) |
---|
| 723 | { |
---|
| 724 | PolyhedralCone C2=C.permuted(*perm); |
---|
| 725 | C2.canonicalize(); |
---|
| 726 | ret.insert(C2); |
---|
| 727 | } |
---|
| 728 | } |
---|
| 729 | } |
---|
| 730 | } |
---|
| 731 | return ret; |
---|
| 732 | } |
---|
| 733 | #endif |
---|
| 734 | |
---|
| 735 | #if 0 |
---|
| 736 | IncidenceList PolyhedralFan::getIncidenceList(SymmetryGroup *sym)const //fan must be pure |
---|
| 737 | { |
---|
| 738 | IncidenceList ret; |
---|
| 739 | SymmetryGroup symm(n); |
---|
| 740 | if(!sym)sym=&symm; |
---|
| 741 | assert(!cones.empty()); |
---|
| 742 | int h=cones.begin()->dimensionOfLinealitySpace(); |
---|
| 743 | IntegerVectorList rays=getRaysInPrintingOrder(sym); |
---|
| 744 | PolyhedralFan f=*this; |
---|
| 745 | |
---|
| 746 | while(f.getMaxDimension()!=h) |
---|
| 747 | { |
---|
| 748 | IntegerVectorList l; |
---|
| 749 | PolyhedralFan done(n); |
---|
| 750 | IntegerVector rayIncidenceCounter(rays.size()); |
---|
| 751 | int faceIndex =0; |
---|
| 752 | for(PolyhedralConeList::const_iterator i=f.cones.begin();i!=f.cones.end();i++) |
---|
| 753 | { |
---|
| 754 | if(!done.contains(*i)) |
---|
| 755 | { |
---|
| 756 | for(SymmetryGroup::ElementContainer::const_iterator k=sym->elements.begin();k!=sym->elements.end();k++) |
---|
| 757 | { |
---|
| 758 | PolyhedralCone cone=i->permuted(*k); |
---|
| 759 | if(!done.contains(cone)) |
---|
| 760 | { |
---|
| 761 | int rayIndex=0; |
---|
| 762 | IntegerVector indices(0); |
---|
| 763 | for(IntegerVectorList::const_iterator j=rays.begin();j!=rays.end();j++) |
---|
| 764 | { |
---|
| 765 | if(cone.contains(*j)) |
---|
| 766 | { |
---|
| 767 | indices.grow(indices.size()+1); |
---|
| 768 | indices[indices.size()-1]=rayIndex; |
---|
| 769 | rayIncidenceCounter[rayIndex]++; |
---|
| 770 | } |
---|
| 771 | rayIndex++; |
---|
| 772 | } |
---|
| 773 | l.push_back(indices); |
---|
| 774 | faceIndex++; |
---|
| 775 | done.insert(cone); |
---|
| 776 | } |
---|
| 777 | } |
---|
| 778 | } |
---|
| 779 | } |
---|
| 780 | ret[f.getMaxDimension()]=l; |
---|
| 781 | f=f.facetComplex(); |
---|
| 782 | } |
---|
| 783 | return ret; |
---|
| 784 | } |
---|
| 785 | #endif |
---|
| 786 | |
---|
| 787 | void PolyhedralFan::makePure() |
---|
| 788 | { |
---|
| 789 | if(getMaxDimension()!=getMinDimension())removeAllLowerDimensional(); |
---|
| 790 | } |
---|
| 791 | |
---|
| 792 | bool PolyhedralFan::contains(ZCone const &c)const |
---|
| 793 | { |
---|
| 794 | return cones.count(c); |
---|
| 795 | } |
---|
| 796 | |
---|
| 797 | |
---|
| 798 | #if 0 |
---|
| 799 | PolyhedralCone PolyhedralFan::coneContaining(ZVector const &v)const |
---|
| 800 | { |
---|
| 801 | for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) |
---|
| 802 | if(i->contains(v))return i->faceContaining(v); |
---|
| 803 | debug<<"Vector "<<v<<" not contained in support of fan\n"; |
---|
| 804 | assert(0); |
---|
| 805 | } |
---|
| 806 | #endif |
---|
| 807 | |
---|
| 808 | PolyhedralFan::coneIterator PolyhedralFan::conesBegin()const |
---|
| 809 | { |
---|
| 810 | return cones.begin(); |
---|
| 811 | } |
---|
| 812 | |
---|
| 813 | |
---|
| 814 | PolyhedralFan::coneIterator PolyhedralFan::conesEnd()const |
---|
| 815 | { |
---|
| 816 | return cones.end(); |
---|
| 817 | } |
---|
| 818 | |
---|
| 819 | |
---|
| 820 | |
---|
| 821 | PolyhedralFan PolyhedralFan::link(ZVector const &w, SymmetryGroup *sym)const |
---|
| 822 | { |
---|
| 823 | SymmetryGroup symL(n); |
---|
| 824 | if(!sym)sym=&symL; |
---|
| 825 | |
---|
| 826 | PolyhedralFan ret(n); |
---|
| 827 | |
---|
| 828 | for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) |
---|
| 829 | { |
---|
| 830 | for(SymmetryGroup::ElementContainer::const_iterator perm=sym->elements.begin();perm!=sym->elements.end();perm++) |
---|
| 831 | { |
---|
| 832 | ZVector w2=perm->applyInverse(w); |
---|
| 833 | if(i->contains(w2)) |
---|
| 834 | { |
---|
| 835 | ret.insert(i->link(w2)); |
---|
| 836 | } |
---|
| 837 | } |
---|
| 838 | } |
---|
| 839 | return ret; |
---|
| 840 | } |
---|
| 841 | |
---|
| 842 | PolyhedralFan PolyhedralFan::link(ZVector const &w)const |
---|
| 843 | { |
---|
| 844 | PolyhedralFan ret(n); |
---|
| 845 | |
---|
| 846 | for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) |
---|
| 847 | { |
---|
| 848 | if(i->contains(w)) |
---|
| 849 | { |
---|
| 850 | ret.insert(i->link(w)); |
---|
| 851 | } |
---|
| 852 | } |
---|
| 853 | return ret; |
---|
| 854 | } |
---|
| 855 | |
---|
| 856 | |
---|
| 857 | int PolyhedralFan::size()const |
---|
| 858 | { |
---|
| 859 | return cones.size(); |
---|
| 860 | } |
---|
| 861 | |
---|
| 862 | int PolyhedralFan::dimensionOfLinealitySpace()const |
---|
| 863 | { |
---|
[26b713] | 864 | if(cones.size()) //slow! |
---|
| 865 | return 0; |
---|
| 866 | else |
---|
| 867 | return cones.begin()->dimensionOfLinealitySpace(); |
---|
[74a91c9] | 868 | } |
---|
| 869 | |
---|
| 870 | |
---|
| 871 | |
---|
| 872 | |
---|
| 873 | void PolyhedralFan::removeNonMaximal() |
---|
| 874 | { |
---|
| 875 | for(PolyhedralConeList::iterator i=cones.begin();i!=cones.end();) |
---|
| 876 | { |
---|
| 877 | ZVector w=i->getRelativeInteriorPoint(); |
---|
| 878 | bool containedInOther=false; |
---|
| 879 | for(PolyhedralConeList::iterator j=cones.begin();j!=cones.end();j++) |
---|
| 880 | if(j!=i) |
---|
| 881 | { |
---|
| 882 | if(j->contains(w)){containedInOther=true;break;} |
---|
| 883 | } |
---|
| 884 | if(containedInOther) |
---|
| 885 | { |
---|
| 886 | PolyhedralConeList::iterator k=i; |
---|
| 887 | i++; |
---|
| 888 | cones.erase(k); |
---|
| 889 | } |
---|
| 890 | else i++; |
---|
| 891 | } |
---|
| 892 | } |
---|
| 893 | |
---|
| 894 | |
---|
| 895 | } |
---|