Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/graphs/planarity/graphFunctionTable.h
4057 views
1
#ifndef GRAPHFUNCTIONTABLE_H
2
#define GRAPHFUNCTIONTABLE_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
#ifdef __cplusplus
49
extern "C" {
50
#endif
51
52
/*
53
NOTE: If you add any FUNCTION POINTERS to this function table, then you must
54
also initialize them in _InitFunctionTable() in graphUtils.c.
55
*/
56
57
typedef struct
58
{
59
// These function pointers allow extension modules to overload some of
60
// the behaviors of protected functions. Only advanced applications
61
// will overload these functions
62
int (*fpCreateFwdArcLists)();
63
void (*fpCreateDFSTreeEmbedding)();
64
void (*fpEmbedBackEdgeToDescendant)();
65
void (*fpWalkUp)();
66
int (*fpWalkDown)();
67
int (*fpMergeBicomps)();
68
int (*fpHandleInactiveVertex)();
69
int (*fpHandleBlockedDescendantBicomp)();
70
int (*fpHandleBlockedEmbedIteration)();
71
int (*fpEmbedPostprocess)();
72
int (*fpMarkDFSPath)();
73
74
int (*fpCheckEmbeddingIntegrity)();
75
int (*fpCheckObstructionIntegrity)();
76
77
// These function pointers allow extension modules to overload
78
// vertex and graphnode initialization. These are not part of the
79
// public API, but many extensions are expected to overload them
80
// if they equip vertices or edges with additional parameters
81
void (*fpInitGraphNode)();
82
void (*fpInitVertexRec)();
83
84
// These function pointers allow extension modules to overload some
85
// of the behaviors of gp_* function in the public API
86
int (*fpInitGraph)();
87
void (*fpReinitializeGraph)();
88
int (*fpEnsureArcCapacity)();
89
int (*fpSortVertices)();
90
91
int (*fpReadPostprocess)();
92
int (*fpWritePostprocess)();
93
94
int (*fpHideVertex)();
95
void (*fpHideEdge)();
96
void (*fpRestoreEdge)();
97
int (*fpContractEdge)();
98
int (*fpIdentifyVertices)();
99
int (*fpRestoreVertex)();
100
101
} graphFunctionTable;
102
103
typedef graphFunctionTable * graphFunctionTableP;
104
105
#ifdef __cplusplus
106
}
107
#endif
108
109
#endif
110
111