source: git/gfanlib/gfanlib_zfan.h @ 74a91c9

spielwiese
Last change on this file since 74a91c9 was 74a91c9, checked in by Frank Seelisch <seelisch@…>, 13 years ago
new gfan lib version by Anders Jensen git-svn-id: file:///usr/local/Singular/svn/trunk@13668 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.7 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  std::vector<std::vector<IntVector> > &table(bool orbit, bool maximal)const;
61public:
62  ~ZFan();
63  ZFan(ZFan const& f);
64  ZFan& operator=(ZFan const &f);
65  /**
66   * Creates an empty fan in the ambient space of dimension n.
67   * It is a mistake to:
68   *  specify a negative ambientDimension.
69   */
70  ZFan(int ambientDimension);
71  /**
72   * Creates an empty fan in the ambient space with dimension equal to the number of elements being permuted by the group.
73   * The fan will have the symmmetries given by sym_ associated.
74   */
75  ZFan(SymmetryGroup const &sym_);
76  /**
77   * Creates the fan in dimension n consisting of the n-dimensional space.
78   */
79  static ZFan fullFan(int n);
80  /**
81   * Creates the full space as a fan in the ambient space with dimension equal to the number of elements being permuted by the group.
82   * The fan will have the symmetries given by sym_ associated.
83   */
84  static ZFan fullFan(SymmetryGroup const &sym_);
85  /**
86   * Reads from stream
87   */
88//  static ZFan readFan(string const &filename, bool onlyMaximal=true, IntegerVector *w=0, set<int> const *conesIndice=0, SymmetryGroup const *sym=0, bool readCompressedIfNotSym=false);
89  /**
90   * Writes to string
91   */
92  std::string toString(int flags=0)const;
93  /**
94   * Returns the dimension of the ambient space.
95   */
96  int getAmbientDimension()const;
97  /**
98   * Inserts c into the fan.
99   * It is a mistake to insert a cone which live in a space of the wrong dimension.
100   * It is a mistake to insert a cone which does not result in a fan satisfying the nice intersection properties of a fan.
101   * However, the second mistake will not cause the code to crash, but only give undefined results.
102   *
103   * The method insert() is expensive in the sense that calling it may require part of the representation
104   * of the fan to be recomputed. The recomputation only happens on request. Therefore it is expensive
105   * to have alternating calls to for example "insert()" and "numberOfConesOfDimension()".
106   *
107   * Notice that insert() has the effect of reordering cones, orbits and rays of the fan.
108   */
109  void insert(ZCone const &c);
110//  void remove(ZCone const &c);
111  /**
112   * Returns the number of cones of dimension d in the collection.
113   */
114  int numberOfConesOfDimension(int d, bool orbit, bool maximal)const;
115  int numberOfConesInCollection()const;
116  /**
117   * Returns the largest dimension of a cone in the fan. If the fan is empty, then -1 is returned.
118   */
119  int dimension()const;
120  /**
121   * Returns the dimension of the lineality space of the fan. Notice that the lineality space of the
122   * empty fan is the ambient space.
123   */
124  int dimensionOfLinealitySpace();
125  /**
126   * Returns the cone in the collection given by the index. It is a mistake to specify an index which
127   * is out of range.
128   */
129  ZCone const &getConeInCollection(int index)const;
130  /**
131   * Returns the cone in the cone of the fan
132   */
133  ZCone getCone(int dimension, int index, bool orbit, bool maximal)const;
134  IntVector getConeIndices(int dimension, int index, bool orbit, bool maximal)const;
135
136//  ZFan expand()const;
137//  SymmetryGorup recoverAllSymmetries()const;
138
139/*  typedef PolyhedralConeList::const_iterator coneIterator;
140  PolyhedralFan::coneIterator conesBegin()const;
141  PolyhedralFan::coneIterator conesEnd()const;
142*/
143
144};
145
146}
147
148#endif
149
150#endif /* GFANLIB_ZFAN_H_ */
Note: See TracBrowser for help on using the repository browser.