Path: blob/master/sage/graphs/planarity/graphFunctionTable.h
4057 views
#ifndef GRAPHFUNCTIONTABLE_H1#define GRAPHFUNCTIONTABLE_H23/*4Planarity-Related Graph Algorithms Project5Copyright (c) 1997-2010, John M. Boyer6All rights reserved. Includes a reference implementation of the following:78* John M. Boyer. "Simplified O(n) Algorithms for Planar Graph Embedding,9Kuratowski Subgraph Isolation, and Related Problems". Ph.D. Dissertation,10University of Victoria, 2001.1112* John M. Boyer and Wendy J. Myrvold. "On the Cutting Edge: Simplified O(n)13Planarity by Edge Addition". Journal of Graph Algorithms and Applications,14Vol. 8, No. 3, pp. 241-273, 2004.1516* John M. Boyer. "A New Method for Efficiently Generating Planar Graph17Visibility Representations". In P. Eades and P. Healy, editors,18Proceedings of the 13th International Conference on Graph Drawing 2005,19Lecture Notes Comput. Sci., Volume 3843, pp. 508-511, Springer-Verlag, 2006.2021Redistribution and use in source and binary forms, with or without modification,22are permitted provided that the following conditions are met:2324* Redistributions of source code must retain the above copyright notice, this25list of conditions and the following disclaimer.2627* Redistributions in binary form must reproduce the above copyright notice, this28list of conditions and the following disclaimer in the documentation and/or29other materials provided with the distribution.3031* Neither the name of the Planarity-Related Graph Algorithms Project nor the names32of its contributors may be used to endorse or promote products derived from this33software without specific prior written permission.3435THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"36AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE37IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE38DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR39ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES40(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;41LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON42ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT43(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS44SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.45*/4647#ifdef __cplusplus48extern "C" {49#endif5051/*52NOTE: If you add any FUNCTION POINTERS to this function table, then you must53also initialize them in _InitFunctionTable() in graphUtils.c.54*/5556typedef struct57{58// These function pointers allow extension modules to overload some of59// the behaviors of protected functions. Only advanced applications60// will overload these functions61int (*fpCreateFwdArcLists)();62void (*fpCreateDFSTreeEmbedding)();63void (*fpEmbedBackEdgeToDescendant)();64void (*fpWalkUp)();65int (*fpWalkDown)();66int (*fpMergeBicomps)();67int (*fpHandleInactiveVertex)();68int (*fpHandleBlockedDescendantBicomp)();69int (*fpHandleBlockedEmbedIteration)();70int (*fpEmbedPostprocess)();71int (*fpMarkDFSPath)();7273int (*fpCheckEmbeddingIntegrity)();74int (*fpCheckObstructionIntegrity)();7576// These function pointers allow extension modules to overload77// vertex and graphnode initialization. These are not part of the78// public API, but many extensions are expected to overload them79// if they equip vertices or edges with additional parameters80void (*fpInitGraphNode)();81void (*fpInitVertexRec)();8283// These function pointers allow extension modules to overload some84// of the behaviors of gp_* function in the public API85int (*fpInitGraph)();86void (*fpReinitializeGraph)();87int (*fpEnsureArcCapacity)();88int (*fpSortVertices)();8990int (*fpReadPostprocess)();91int (*fpWritePostprocess)();9293int (*fpHideVertex)();94void (*fpHideEdge)();95void (*fpRestoreEdge)();96int (*fpContractEdge)();97int (*fpIdentifyVertices)();98int (*fpRestoreVertex)();99100} graphFunctionTable;101102typedef graphFunctionTable * graphFunctionTableP;103104#ifdef __cplusplus105}106#endif107108#endif109110111