~ubuntu-branches/ubuntu/vivid/regina-normal/vivid-proposed

« back to all changes in this revision

Viewing changes to engine/triangulation/nisomorphism.h

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2011-09-10 07:17:25 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110910071725-97n90tywdq60w2cr
Tags: 4.90-1
* New upstream release!
* The user interface has been ported from KDE3 to KDE4 (closes: #556318).
  Re-enabled the GUI as a result.
* The build system has been ported from autotools to cmake.
* The new upstream release builds fine on amd64 (closes: #624882).
* Moved the users' handbook into regina-normal-doc.
* Upgraded several suggests/recommends.  Upgraded regina-normal-mpi to
  depend on mpi-default-bin, and regina-normal to depend on both graphviz
  and regina-normal-doc (which the GUI expends to be present).  Upgraded
  regina-normal to recommend gap.
* Bumped standards-version to 3.9.2.0 (no changes required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Regina - A Normal Surface Theory Calculator                           *
5
5
 *  Computational Engine                                                  *
6
6
 *                                                                        *
7
 
 *  Copyright (c) 1999-2009, Ben Burton                                   *
 
7
 *  Copyright (c) 1999-2011, Ben Burton                                   *
8
8
 *  For further details contact Ben Burton (bab@debian.org).              *
9
9
 *                                                                        *
10
10
 *  This program is free software; you can redistribute it and/or         *
26
26
 
27
27
/* end stub */
28
28
 
29
 
/*! \file nisomorphism.h
 
29
/*! \file triangulation/nisomorphism.h
30
30
 *  \brief Deals with combinatorial isomorphisms of triangulations.
31
31
 */
32
32
 
35
35
#define __NISOMORPHISM_H
36
36
#endif
37
37
 
 
38
#include "regina-core.h"
38
39
#include "shareableobject.h"
39
 
#include "triangulation/nperm.h"
 
40
#include "maths/nperm4.h"
40
41
#include "triangulation/ntetface.h"
41
42
 
42
43
namespace regina {
82
83
 *
83
84
 * \todo \feature Composition of isomorphisms.
84
85
 */
85
 
class NIsomorphism : public ShareableObject {
 
86
class REGINA_API NIsomorphism : public ShareableObject {
86
87
    protected:
87
88
        unsigned nTetrahedra;
88
89
            /**< The number of tetrahedra in the source triangulation. */
89
90
        int* mTetImage;
90
91
            /**< The tetrahedron of the destination triangulation that
91
92
                 each tetrahedron of the source triangulation maps to. */
92
 
        NPerm* mFacePerm;
 
93
        NPerm4* mFacePerm;
93
94
            /**< The permutation applied to the four faces of each
94
95
                 source tetrahedron. */
95
96
 
165
166
         * @return a read-write reference to the permutation applied to the
166
167
         * four faces of the source tetrahedron.
167
168
         */
168
 
        NPerm& facePerm(unsigned sourceTet);
 
169
        NPerm4& facePerm(unsigned sourceTet);
169
170
        /**
170
171
         * Determines the permutation that is applied to the four faces
171
172
         * of the given source tetrahedron under this isomorphism.
179
180
         * @return the permutation applied to the four faces of the
180
181
         * source tetrahedron.
181
182
         */
182
 
        NPerm facePerm(unsigned sourceTet) const;
 
183
        NPerm4 facePerm(unsigned sourceTet) const;
183
184
        /**
184
185
         * Determines the image of the given source tetrahedron face
185
186
         * under this isomorphism.  Note that a value only is returned; this
206
207
        bool isIdentity() const;
207
208
 
208
209
        /**
209
 
         * Applies this isomorphism to the given triangulation.
 
210
         * Applies this isomorphism to the given triangulation and
 
211
         * returns the result as a new triangulation.
210
212
         *
211
213
         * The given triangulation (call this T) is not modified in any way.
212
214
         * A new triangulation (call this S) is returned, so that this
244
246
         */
245
247
        NTriangulation* apply(const NTriangulation* original) const;
246
248
 
 
249
        /**
 
250
         * Applies this isomorphism to the given triangulation,
 
251
         * modifying the given triangulation directly.
 
252
         *
 
253
         * This is similar to apply(), except that instead of creating a
 
254
         * new triangulation, the tetrahedra and vertices of the given
 
255
         * triangulation are modified directly.
 
256
         *
 
257
         * See apply() for further details on how this operation is performed.
 
258
         *
 
259
         * As with apply(), there are several preconditions to this routine.
 
260
         * This routine does a small amount of sanity checking (and returns
 
261
         * without changes if an error is detected), but it certainly does
 
262
         * not check the entire set of preconditions.  It is up to the
 
263
         * caller of this routine to verify that all of the following
 
264
         * preconditions are met.
 
265
         *
 
266
         * \pre The number of tetrahedra in the given triangulation is
 
267
         * precisely the number returned by getSourceTetrahedra() for
 
268
         * this isomorphism.
 
269
         * \pre This is a valid isomorphism (i.e., it has been properly
 
270
         * initialised, so that all tetrahedron images are non-negative
 
271
         * and distinct, and all face permutations are real permutations
 
272
         * of (0,1,2,3).
 
273
         * \pre Each tetrahedron image for this isomorphism lies
 
274
         * between 0 and <tt>getSourceTetrahedra()-1</tt> inclusive
 
275
         * (i.e., this isomorphism does not represent a mapping from a
 
276
         * smaller triangulation into a larger triangulation).
 
277
         *
 
278
         * @param tri the triangulation to which this isomorphism
 
279
         * should be applied.
 
280
         */
 
281
        void applyInPlace(NTriangulation* tri) const;
 
282
 
247
283
        void writeTextShort(std::ostream& out) const;
248
284
        void writeTextLong(std::ostream& out) const;
249
285
 
283
319
 *
284
320
 * \ifacespython Not present.
285
321
 */
286
 
class NIsomorphismDirect : public NIsomorphism {
 
322
class REGINA_API NIsomorphismDirect : public NIsomorphism {
287
323
    public:
288
324
        /**
289
325
         * Creates a new isomorphism with no initialisation.
310
346
        mTetImage(sourceTetrahedra > 0 ?
311
347
            new int[sourceTetrahedra] : 0),
312
348
        mFacePerm(sourceTetrahedra > 0 ?
313
 
            new NPerm[sourceTetrahedra] : 0) {
 
349
            new NPerm4[sourceTetrahedra] : 0) {
314
350
}
315
351
inline NIsomorphism::~NIsomorphism() {
316
352
    delete[] mTetImage;
328
364
    return mTetImage[sourceTet];
329
365
}
330
366
 
331
 
inline NPerm& NIsomorphism::facePerm(unsigned sourceTet) {
 
367
inline NPerm4& NIsomorphism::facePerm(unsigned sourceTet) {
332
368
    return mFacePerm[sourceTet];
333
369
}
334
 
inline NPerm NIsomorphism::facePerm(unsigned sourceTet) const {
 
370
inline NPerm4 NIsomorphism::facePerm(unsigned sourceTet) const {
335
371
    return mFacePerm[sourceTet];
336
372
}
337
373