2
* gfanlib_polyhedralfan.h
4
* Created on: Nov 16, 2010
8
#ifndef GFANLIB_POLYHEDRALFAN_H_INCLUDED
9
#define GFANLIB_POLYHEDRALFAN_H_INCLUDED
14
#include "gfanlib_symmetry.h"
15
#include "gfanlib_matrix.h"
16
#include "gfanlib_zcone.h"
17
#include "gfanlib_symmetriccomplex.h"
22
typedef std::set<ZCone> PolyhedralConeList;
23
typedef std::list<IntVector> IntVectorList;
24
typedef std::map<int,IntVectorList> IncidenceList;
28
/** A PolyhedralFan is simply a collection of canonicalized PolyhedralCones.
29
* It contains no combinatorial information in the sense of a polyhedral complex.
30
* A cone being present in the PolyhedralFan corresponds to the cone and all its facets being present
31
* in the mathematical object.
32
* The intersection of cones in the fan must be a face of both.
33
* In particular all cones in a PolyhedralFan have the same lineality space.*/
37
SymmetryGroup symmetries;
38
PolyhedralConeList cones;
40
static class PolyhedralFan fullSpace(int n);
41
static class PolyhedralFan facetsOfCone(ZCone const &c);
42
PolyhedralFan(int ambientDimension);
43
PolyhedralFan(SymmetryGroup const &sym);
44
std::string toString(int flags=FPF_default)const;
45
/* Read in a polyhedral fan, but with the cones containing w. If
46
present, only read in cones among coneIndices. If sym is
47
present, read COMPRESSED section and make w containment up to
48
symmetry, taking all elements in the orbit that contains w into
49
the fan. If onlyMaximal is set then only maximal cones are read
52
int getAmbientDimension()const;
53
int getMaxDimension()const;
54
int getMinDimension()const;
55
friend PolyhedralFan refinement(const PolyhedralFan &a, const PolyhedralFan &b, int cutOffDimension=-1, bool allowASingleConeOfCutOffDimension=false);
56
ZMatrix getRays(int dim=1);//This can be called for other dimensions than 1. The term "Rays" still makes sense modulo the common linearity space
57
ZMatrix getRelativeInteriorPoints();
58
void insert(ZCone const &c);
59
void remove(ZCone const &c);
60
void removeAllLowerDimensional();
62
Since the cones stored in a PolyhedralFan are cones of a
63
polyhedral fan, it is possible to identify non maximal cones by
64
just checking containment of relative interior points in other
65
cones. This routine removes all non-maximal cones.
67
void removeNonMaximal();
69
Returns the number of cones stored in the fan. This is not the number of cones in the fan in a mathematical sense.
72
int dimensionOfLinealitySpace()const;
74
bool contains(ZCone const &c)const;
76
* For a vector contained in the support of the fan represented by the fan object, this function
77
* computes the cone that contains the vector in its relative interior.
79
ZCone coneContaining(ZVector const &v)const;
80
PolyhedralFan facetComplex()const;
82
ZMatrix getRaysInPrintingOrder(bool upToSymmetry=false)const;
83
IncidenceList getIncidenceList(SymmetryGroup *sym=0)const;
88
Computes the link of the face containing w in its relative interior.
90
PolyhedralFan link(ZVector const &w)const;
91
PolyhedralFan link(ZVector const &w, SymmetryGroup *sym)const;
95
typedef PolyhedralConeList::const_iterator coneIterator;
96
PolyhedralFan::coneIterator conesBegin()const;
97
PolyhedralFan::coneIterator conesEnd()const;
101
* Converts a PolyhedralFan into a SymmetricComplex. This is used for homology computations, but not for printing yet.
103
SymmetricComplex toSymmetricComplex()const;
104
// static PolyhedralFan readFan(string const &filename, bool onlyMaximal=true, IntegerVector *w=0, set<int> const *conesIndice=0, SymmetryGroup const *sym=0, bool readCompressedIfNotSym=false);
108
void addFacesToSymmetricComplex(SymmetricComplex &c, ZCone const &cone, ZMatrix const &facetCandidates, ZMatrix const &generatorsOfLinealitySpace);
109
void addFacesToSymmetricComplex(SymmetricComplex &c, std::set<int> const &indices, ZMatrix const &facetCandidates, int dimension, Integer multiplicity);