Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/graphs/planarity/appconst.h
4084 views
1
#ifndef APPCONST_H
2
#define APPCONST_H
3
4
/*
5
Planarity-Related Graph Algorithms Project
6
Copyright (c) 1997-2010, John M. Boyer
7
All rights reserved. Includes a reference implementation of the following:
8
9
* John M. Boyer. "Simplified O(n) Algorithms for Planar Graph Embedding,
10
Kuratowski Subgraph Isolation, and Related Problems". Ph.D. Dissertation,
11
University of Victoria, 2001.
12
13
* John M. Boyer and Wendy J. Myrvold. "On the Cutting Edge: Simplified O(n)
14
Planarity by Edge Addition". Journal of Graph Algorithms and Applications,
15
Vol. 8, No. 3, pp. 241-273, 2004.
16
17
* John M. Boyer. "A New Method for Efficiently Generating Planar Graph
18
Visibility Representations". In P. Eades and P. Healy, editors,
19
Proceedings of the 13th International Conference on Graph Drawing 2005,
20
Lecture Notes Comput. Sci., Volume 3843, pp. 508-511, Springer-Verlag, 2006.
21
22
Redistribution and use in source and binary forms, with or without modification,
23
are permitted provided that the following conditions are met:
24
25
* Redistributions of source code must retain the above copyright notice, this
26
list of conditions and the following disclaimer.
27
28
* Redistributions in binary form must reproduce the above copyright notice, this
29
list of conditions and the following disclaimer in the documentation and/or
30
other materials provided with the distribution.
31
32
* Neither the name of the Planarity-Related Graph Algorithms Project nor the names
33
of its contributors may be used to endorse or promote products derived from this
34
software without specific prior written permission.
35
36
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
37
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
40
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
41
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
42
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
43
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46
*/
47
48
// When PROFILE is defined, prints out run-time stats on a number of subordinate
49
// routines in the embedder
50
51
//#define PROFILE
52
#ifdef PROFILE
53
#include "platformTime.h"
54
#endif
55
56
/* Define DEBUG to get additional debugging. The default is to define it when MSC does */
57
58
#ifdef _DEBUG
59
#define DEBUG
60
#endif
61
62
/* Some low-level functions are replaced by faster macros, except when debugging */
63
64
#define SPEED_MACROS
65
#ifdef DEBUG
66
#undef SPEED_MACROS
67
#endif
68
69
/* Return status values; OK/NOTOK behave like Boolean true/false,
70
not like program exit codes. */
71
72
#define OK 1
73
#define NOTOK 0
74
75
#ifdef DEBUG
76
#undef NOTOK
77
extern int debugNOTOK();
78
#include <stdio.h>
79
#define NOTOK (printf("NOTOK on Line %d of %s\n", __LINE__, __FILE__), debugNOTOK())
80
#endif
81
82
#define NONEMBEDDABLE -3
83
84
#ifndef TRUE
85
#define TRUE 1
86
#endif
87
88
#ifndef FALSE
89
#define FALSE 0
90
#endif
91
92
#ifndef NULL
93
#define NULL 0L
94
#endif
95
96
/* Array indices are used as pointers, and this means bad pointer */
97
98
#define NIL -1
99
#define NIL_CHAR 0xFF
100
101
/* Defines fopen strings for reading and writing text files on PC and UNIX */
102
103
#ifdef WINDOWS
104
#define READTEXT "rt"
105
#define WRITETEXT "wt"
106
#else
107
#define READTEXT "r"
108
#define WRITETEXT "w"
109
#endif
110
111
#endif
112
113