MCPcopy Create free account
hub / github.com/Singular/Singular / readFan

Method readFan

gfanlib/gfanlib_polyhedralfan.cpp:669–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667
668#if 0
669PolyhedralFan PolyhedralFan::readFan(string const &filename, bool onlyMaximal, IntegerVector *w, set<int> const *coneIndices, SymmetryGroup const *sym, bool readCompressedIfNotSym)
670{
671 PolymakeFile inFile;
672 inFile.open(filename.c_str());
673
674 int n=inFile.readCardinalProperty("AMBIENT_DIM");
675 int nRays=inFile.readCardinalProperty("N_RAYS");
676 IntegerMatrix rays=inFile.readMatrixProperty("RAYS",nRays,n);
677 int linealityDim=inFile.readCardinalProperty("LINEALITY_DIM");
678 IntegerMatrix linealitySpace=inFile.readMatrixProperty("LINEALITY_SPACE",linealityDim,n);
679
680
681 const char *sectionName=0;
682 const char *sectionNameMultiplicities=0;
683 if(sym || readCompressedIfNotSym)
684 {
685 sectionName=(onlyMaximal)?"MAXIMAL_CONES_ORBITS":"CONES_ORBITS";
686 sectionNameMultiplicities=(onlyMaximal)?"MULTIPLICITIES_ORBITS":"DUMMY123";
687 }
688 else
689 { sectionName=(onlyMaximal)?"MAXIMAL_CONES":"CONES";
690 sectionNameMultiplicities=(onlyMaximal)?"MULTIPLICITIES":"DUMMY123";
691 }
692
693
694 IntegerVector w2(n);
695 if(w==0)w=&w2;
696
697 SymmetryGroup sym2(n);
698 if(sym==0)sym=&sym2;
699
700 vector<list<int> > cones=inFile.readMatrixIncidenceProperty(sectionName);
701 IntegerVectorList r;
702
703 bool hasMultiplicities=inFile.hasProperty(sectionNameMultiplicities);
704 IntegerMatrix multiplicities(0,0);
705 if(hasMultiplicities)multiplicities=inFile.readMatrixProperty(sectionNameMultiplicities,cones.size(),1);
706
707
708 PolyhedralFan ret(n);
709
710 log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl;
711 for(int i=0;i<cones.size();i++)
712 if(coneIndices==0 || coneIndices->count(i))
713 {
714 log2 cerr<<"Expanding symmetries of cone"<<endl;
715 {
716 IntegerVectorList coneRays;
717 for(list<int>::const_iterator j=cones[i].begin();j!=cones[i].end();j++)
718 coneRays.push_back((rays[*j]));
719 PolyhedralCone C=PolyhedralCone::givenByRays(coneRays,linealitySpace.getRows(),n);
720 if(hasMultiplicities)C.setMultiplicity(multiplicities[i][0]);
721 for(SymmetryGroup::ElementContainer::const_iterator perm=sym->elements.begin();perm!=sym->elements.end();perm++)
722 {
723 if(C.contains(SymmetryGroup::composeInverse(*perm,*w)))
724 {
725 PolyhedralCone C2=C.permuted(*perm);
726 C2.canonicalize();

Callers

nothing calls this directly

Calls 15

openMethod · 0.80
c_strMethod · 0.80
readCardinalPropertyMethod · 0.80
readMatrixPropertyMethod · 0.80
hasPropertyMethod · 0.80
setMultiplicityMethod · 0.80
permutedMethod · 0.80
sizeMethod · 0.45
countMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected