File: canonize.c

package info (click to toggle)
snappea 3.0d3-20.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,896 kB
  • ctags: 3,582
  • sloc: ansic: 33,469; sh: 8,293; python: 7,623; makefile: 240
file content (47 lines) | stat: -rw-r--r-- 1,268 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 *	canonize.c
 *
 *	This file provides the function
 *
 *		FuncResult canonize(Triangulation *manifold);
 *
 *	canonize() is a shell, which calls the functions
 *
 *		proto_canonize()			[found in canonize_part_1.c]
 *		canonical_retriangulation()	[found in canonize_part_2.c]
 *
 *	The purpose of these functions is explained in the code below.
 *	For the mathematical details, please see canonize_part_1.c
 *	and canonize_part_2.c. 
 *
 *	canonize() does not preserve the original Triangulation;
 *	if you need to keep it, make a copy with copy_triangulation()
 *	before calling canonize().
 */

#include "kernel.h"

FuncResult canonize(
	Triangulation	*manifold)
{
	/*
	 *	Apply the tilt theorem to compute a Triangulation
	 *	which is a subdivision of the canonical cell decomposition.
	 *	Please see canonize_part_1.c for details.
	 */

	if (proto_canonize(manifold) == func_failed)
		return func_failed;

	/*
	 *	Replace the given subdivision of the canonical cell
	 *	decomposition with the canonical retriangulation.
	 *	This operation introduces finite vertices whenever
	 *	the canonical cell decomposition is not a triangulation
	 *	to begin with.  Please see canonize_part_2.c for details.
	 */

	canonical_retriangulation(manifold);

	return func_OK;
}