source: git/gfanlib/gfanlib_zfan.h @ 7b8818

spielwiese
Last change on this file since 7b8818 was e543dd, checked in by Frank Seelisch <seelisch@…>, 13 years ago
new gfanlib from Anders git-svn-id: file:///usr/local/Singular/svn/trunk@14098 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.9 KB
Line 
1/*
2 * gfanlib_zfan.h
3 *
4 *  Created on: Nov 17, 2010
5 *      Author: anders
6 */
7
8#ifndef GFANLIB_ZFAN_H_
9#define GFANLIB_ZFAN_H_
10
11/*
12 * gfanlib_polyhedralfan.h
13 *
14 *  Created on: Nov 16, 2010
15 *      Author: anders
16 */
17
18#ifndef GFANLIB_ZFAN_H_INCLUDED
19#define GFANLIB_ZFAN_H_INCLUDED
20
21#include <set>
22#include <list>
23#include <map>
24#include "gfanlib_polyhedralfan.h"
25#include "gfanlib_symmetriccomplex.h"
26
27namespace gfan{
28
29/**
30 * This class represents a Polyhedral fan with the combined features of a SymmetricComplex, and
31 * a PolyhedralFan (which we regards as some collection of cones of the fan with the property that every cone
32 * of the fan is a face of these (up to action by the group)).
33 * It is important to distinguis between the cones of the collection, the cones of the fan as a mathematical object, and the orbits of cones of the fan.
34 *
35 *
36 * TEMPLATES SHOULD BE HIDDEN
37 */
38class ZFan
39{
40  mutable PolyhedralFan *coneCollection;
41  mutable SymmetricComplex *complex;
42  mutable std::vector<std::vector<IntVector > > cones;
43  mutable std::vector<std::vector<IntVector > > maximalCones;
44  mutable std::vector<std::vector<IntVector > > coneOrbits;
45  mutable std::vector<std::vector<IntVector > > maximalConeOrbits;
46
47
48  //  SymmetryGroup sym;
49
50  /**
51   * Functions that makes the symmetric complex invalid:
52   * insert() and construction
53   *
54   * Functions that make the cone collection invalid:
55   * readFan()
56   *
57   */
58  void ensureConeCollection()const;
59  void ensureComplex()const;
60  void killComplex()const;
61  std::vector<std::vector<IntVector> > &table(bool orbit, bool maximal)const;
62public:
63  ~ZFan();
64  ZFan(ZFan const& f);
65  /**
66   *
67   * To read from string, do the following:
68   *       std::string test="TEST";
69   *   std::istringstream s(test);
70   *   ZFan G(s);
71   *
72   */
73  ZFan(std::istream  &f);
74  ZFan& operator=(ZFan const &f);
75  /**
76   * Creates an empty fan in the ambient space of dimension n.
77   * It is a mistake to:
78   *  specify a negative ambientDimension.
79   */
80  ZFan(int ambientDimension);
81  /**
82   * Creates an empty fan in the ambient space with dimension equal to the number of elements being permuted by the group.
83   * The fan will have the symmmetries given by sym_ associated.
84   */
85  ZFan(SymmetryGroup const &sym_);
86  /**
87   * Creates the fan in dimension n consisting of the n-dimensional space.
88   */
89  static ZFan fullFan(int n);
90  /**
91   * Creates the full space as a fan in the ambient space with dimension equal to the number of elements being permuted by the group.
92   * The fan will have the symmetries given by sym_ associated.
93   */
94  static ZFan fullFan(SymmetryGroup const &sym_);
95  /**
96   * Reads from stream
97   */
98//  static ZFan readFan(string const &filename, bool onlyMaximal=true, IntegerVector *w=0, set<int> const *conesIndice=0, SymmetryGroup const *sym=0, bool readCompressedIfNotSym=false);
99  /**
100   * Writes to string
101   */
102  std::string toString(int flags=0)const;
103  /**
104   * Returns the dimension of the ambient space.
105   */
106  int getAmbientDimension()const;
107  /**
108   * Inserts c into the fan.
109   * It is a mistake to insert a cone which live in a space of the wrong dimension.
110   * It is a mistake to insert a cone which does not result in a fan satisfying the nice intersection properties of a fan.
111   * However, the second mistake will not cause the code to crash, but only give undefined results.
112   *
113   * The method insert() is expensive in the sense that calling it may require part of the representation
114   * of the fan to be recomputed. The recomputation only happens on request. Therefore it is expensive
115   * to have alternating calls to for example "insert()" and "numberOfConesOfDimension()".
116   *
117   * Notice that insert() has the effect of reordering cones, orbits and rays of the fan.
118   */
119  void insert(ZCone const &c);
120//  void remove(ZCone const &c);
121  /**
122   * Returns the number of cones of dimension d in the collection.
123   */
124  int numberOfConesOfDimension(int d, bool orbit, bool maximal)const;
125  int numberOfConesInCollection()const;
126  /**
127   * Returns the largest dimension of a cone in the fan. If the fan is empty, then -1 is returned.
128   */
129  int dimension()const;
130  /**
131   * Returns the dimension of the lineality space of the fan. Notice that the lineality space of the
132   * empty fan is the ambient space.
133   */
134  int dimensionOfLinealitySpace();
135  /**
136   * Returns the cone in the collection given by the index. It is a mistake to specify an index which
137   * is out of range.
138   */
139  ZCone const &getConeInCollection(int index)const;
140  /**
141   * Returns the cone in the cone of the fan
142   */
143  ZCone getCone(int dimension, int index, bool orbit, bool maximal)const;
144  IntVector getConeIndices(int dimension, int index, bool orbit, bool maximal)const;
145
146//  ZFan expand()const;
147//  SymmetryGorup recoverAllSymmetries()const;
148
149/*  typedef PolyhedralConeList::const_iterator coneIterator;
150  PolyhedralFan::coneIterator conesBegin()const;
151  PolyhedralFan::coneIterator conesEnd()const;
152*/
153
154};
155
156}
157
158#endif
159
160#endif /* GFANLIB_ZFAN_H_ */
Note: See TracBrowser for help on using the repository browser.