INGOR
Loading...
Searching...
No Matches
ytPCGraph.h
1/*
2 math/ytPCGraph.{h,c} : Parent and Child list Graph
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_PC_GRAPH_H
10#define __YTLIB_PC_GRAPH_H
11
12#include <stdlib.h>
13#include "ytGraph.h"
14#include "util/ytIntArray.h"
15
16typedef struct {
17#ifdef DOXY
18private:
19#endif /* DOXY */
20 ytGraph super;
21 int nodes;
22 ytIntArray * parents;
23 ytIntArray * children;
24} ytPCGraph;
25
26ytPCGraph * ytPCGraph_new(int nodes);
27ytObject * ytPCGraph_newI();
28void ytPCGraph_setOrder(ytPCGraph * this, int nodes);
29ytObject * ytPCGraph_obj(ytPCGraph * this);
30void ytPCGraph_delete(ytPCGraph * this);
31ytGraph * ytPCGraph_Graph(ytPCGraph * g);
32ytPCGraph * ytPCGraph_from_Graph(ytGraph * this);
33void ytPCGraph_clear(ytPCGraph * this);
34int ytPCGraph_numNodes(const ytPCGraph * this);
35int ytPCGraph_numParents(const ytPCGraph * this, int j);
36int ytPCGraph_numChildren(const ytPCGraph * this, int j);
37int ytPCGraph_numEdges(const ytPCGraph * this);
38int ytPCGraph_degree(const ytPCGraph * this, int j);
39int ytPCGraph_getParent(const ytPCGraph * this, int j, int k);
40int ytPCGraph_getChild(const ytPCGraph * this, int j, int k);
41const int * ytPCGraph_getParents(const ytPCGraph * this, int j);
42const int * ytPCGraph_getChildren(const ytPCGraph * this, int j);
43int ytPCGraph_checkEdge(const ytPCGraph * this, int src, int dst);
44void ytPCGraph_addEdge(ytPCGraph * this, int src, int dst);
45void ytPCGraph_removeEdge(ytPCGraph * this, int src, int dst);
46int ytPCGraph_removeLastEdge(ytPCGraph * this, int src, int dst);
47void ytPCGraph_copy(ytPCGraph * this, const ytPCGraph * src);
48void ytPCGraph_copyGraph(ytPCGraph * this, const ytGraph * src);
49void ytPCGraph_addGraph(ytPCGraph * this, const ytGraph * src);
50ytGraphEdgeIter * ytPCGraph_edgeIter(const ytPCGraph * this);
51void ytPCGraph_edgeIterNext(const ytPCGraph * this, ytGraphEdgeIter * iter);
52void ytPCGraph_print(const ytPCGraph * this, FILE * fp);
53int ytPCGraph_test(int argc, char * argv[]);
54
55#endif /* __YTLIB_PC_GRAPH_H */
Interface class for handling graph structure.
Expandable array.
The basis class.
Definition ytGraph.h:26
Definition ytPCGraph.h:16