~ubuntu-branches/ubuntu/saucy/gfan/saucy-proposed

« back to all changes in this revision

Viewing changes to gfanlib_polyhedralfan.h

  • Committer: Package Import Robot
  • Author(s): Cédric Boutillier
  • Date: 2013-07-09 10:44:01 UTC
  • mfrom: (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130709104401-5q66ozz5j5af0dak
Tags: 0.5+dfsg-3
* Upload to unstable.
* modify remove_failing_tests_on_32bits.patch to replace command of
  0009RenderStairCase test with an empty one instead of deleting it.
* remove lintian override about spelling error

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * gfanlib_polyhedralfan.h
 
3
 *
 
4
 *  Created on: Nov 16, 2010
 
5
 *      Author: anders
 
6
 */
 
7
 
 
8
#ifndef GFANLIB_POLYHEDRALFAN_H_INCLUDED
 
9
#define GFANLIB_POLYHEDRALFAN_H_INCLUDED
 
10
 
 
11
#include <set>
 
12
#include <list>
 
13
#include <map>
 
14
#include "gfanlib_symmetry.h"
 
15
#include "gfanlib_matrix.h"
 
16
#include "gfanlib_zcone.h"
 
17
#include "gfanlib_symmetriccomplex.h"
 
18
 
 
19
namespace gfan{
 
20
 
 
21
 
 
22
typedef std::set<ZCone> PolyhedralConeList;
 
23
typedef std::list<IntVector> IntVectorList;
 
24
typedef std::map<int,IntVectorList> IncidenceList;
 
25
 
 
26
 
 
27
 
 
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.*/
 
34
class PolyhedralFan
 
35
{
 
36
  int n;
 
37
  SymmetryGroup symmetries;
 
38
  PolyhedralConeList cones;
 
39
 public:
 
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
 
50
     in.
 
51
   */
 
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();
 
61
  /**
 
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.
 
66
   */
 
67
  void removeNonMaximal();
 
68
  /**
 
69
     Returns the number of cones stored in the fan. This is not the number of cones in the fan in a mathematical sense.
 
70
   */
 
71
  int size()const;
 
72
  int dimensionOfLinealitySpace()const;
 
73
  void makePure();
 
74
  bool contains(ZCone const &c)const;
 
75
  /**
 
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.
 
78
   */
 
79
  ZCone coneContaining(ZVector const &v)const;
 
80
  PolyhedralFan facetComplex()const;
 
81
 
 
82
  ZMatrix getRaysInPrintingOrder(bool upToSymmetry=false)const;
 
83
  IncidenceList getIncidenceList(SymmetryGroup *sym=0)const;
 
84
  bool isEmpty()const;
 
85
 
 
86
 
 
87
  /**
 
88
     Computes the link of the face containing w in its relative interior.
 
89
   */
 
90
  PolyhedralFan link(ZVector const &w)const;
 
91
  PolyhedralFan link(ZVector const &w, SymmetryGroup *sym)const;
 
92
 
 
93
 
 
94
 
 
95
  typedef PolyhedralConeList::const_iterator coneIterator;
 
96
  PolyhedralFan::coneIterator conesBegin()const;
 
97
  PolyhedralFan::coneIterator conesEnd()const;
 
98
 
 
99
 
 
100
  /**
 
101
   * Converts a PolyhedralFan into a SymmetricComplex. This is used for homology computations, but not for printing yet.
 
102
   */
 
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);
 
105
};
 
106
 
 
107
 
 
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);
 
110
 
 
111
}
 
112
 
 
113
#endif