Regina Calculation Engine
Functions
Foreign

Functions

Containerregina::readDehydrationList (const char *filename, unsigned colDehydrations=0, int colLabels=-1, unsigned long ignoreLines=0)
 Reads a list of dehydrated triangulations from the given text file. More...
 
Containerregina::readIsoSigList (const char *filename, unsigned dimension=3, unsigned colSigs=0, int colLabels=-1, unsigned long ignoreLines=0)
 Reads a list of isomorphism signatures from the given text file. More...
 
Triangulation< 3 > * regina::readOrb (const char *filename)
 Reads a triangulation from the given Orb / Casson file. More...
 

Detailed Description

Function Documentation

§ readDehydrationList()

Container* regina::readDehydrationList ( const char *  filename,
unsigned  colDehydrations = 0,
int  colLabels = -1,
unsigned long  ignoreLines = 0 
)

Reads a list of dehydrated triangulations from the given text file.

The file should contain one dehydration string per line. These strings will be rehydrated as described in Triangulation<3>::insertRehydration().

A newly allocated container will be returned; the imported triangulations will be inserted as children of this container. The container will not be assigned a label. The individual triangulations will be assigned labels according to the parameter colLabels.

If any dehydrations strings are invalid, these will be recorded in an additional text packet that will be the last child of the returned container.

If an I/O error occurred while trying to read the given file, 0 will be returned.

In its simplest form, the text file can simply contain one dehydration string per line and nothing else. However, more complex formats are allowed. In particular, by passing appropriate values for the arguments colDehydrations and colLabels, the dehydration strings and triangulation packet labels can be taken from arbitrary columns of the text file. Columns are considered to be separated by whitespace and are numbered beginning at 0.

Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. It assumes however that the contents of the file are in UTF-8.
Parameters
filenamethe name of the text file from which to read.
colDehydrationsthe column of the text file containing the dehydration strings.
colLabelsthe column of the text file containing the triangulation packet labels. If this is negative then the dehydration strings themselves will be used as packet labels.
ignoreLinesthe number of lines at the beginning of the text file that should be ignored completely.
Returns
a new container as described above, or 0 if an I/O error occurred whilst reading the given file.

§ readIsoSigList()

Container* regina::readIsoSigList ( const char *  filename,
unsigned  dimension = 3,
unsigned  colSigs = 0,
int  colLabels = -1,
unsigned long  ignoreLines = 0 
)

Reads a list of isomorphism signatures from the given text file.

The file should contain one isomorphism signature per line. Signatures for both 3-manifold triangulations and 4-manifold triangulations are accepted (though they cannot be mixed together within the same file). These isomorphism signatures will be converted into triangulations using Triangulation<3>::fromIsoSig() and Triangulation<4>::fromIsoSig() respectively.

A newly allocated container will be returned; the imported triangulations will be inserted as children of this container. The container will not be assigned a label. The individual triangulations will be assigned labels according to the parameter colLabels.

If any isomorphism signatures are invalid, these will be recorded in an additional text packet that will be the last child of the returned container.

If an I/O error occurred while trying to read the given file, 0 will be returned.

In its simplest form, the text file can simply contain one isomorphism signature per line and nothing else. However, more complex formats are allowed. In particular, by passing appropriate values for the arguments colSigs and colLabels, the isomorphism signatures and triangulation packet labels can be taken from arbitrary columns of the text file. Columns are considered to be separated by whitespace and are numbered beginning at 0.

Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. It assumes however that the contents of the file are in UTF-8.
Parameters
filenamethe name of the text file from which to read.
dimensioneither 3 or 4, indicating whether isomorphism signatures should be expanded into 3-manifold triangulations or 4-manifold triangulations respectively.
colSigsthe column of the text file containing the isomorphism signatures.
colLabelsthe column of the text file containing the triangulation packet labels. If this is negative then the isomorphism signatures themselves will be used as packet labels.
ignoreLinesthe number of lines at the beginning of the text file that should be ignored completely.
Returns
a new container as described above, or 0 if an I/O error occurred whilst reading the given file.

§ readOrb()

Triangulation<3>* regina::readOrb ( const char *  filename)

Reads a triangulation from the given Orb / Casson file.

A newly allocated triangulation will be returned; it is the user's responsibility to deallocate this when it is finished with.

The packet label of the new triangulation will be the manifold name read from the second line of the Orb / Casson file. The first line of the Orb / Casson file must simply be ``% orb''.

If the file could not be read or if the data was not in the correct format, 0 will be returned.

Internationalisation:
This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. It assumes however that the contents of the file are in UTF-8.
Parameters
filenamethe name of the Orb / Casson file from which to read.
Returns
a new triangulation containing the data read from the Orb / Casson file, or 0 on error.
Author
Ryan Budney, also with code from Damien Heard

Copyright © 1999-2016, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).