INGOR
Loading...
Searching...
No Matches
ytAdjGraph.h
1/*
2 math/ytAdjGraph.{h,c} : Adjacent Matrix 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_ADJ_GRAPH_H
10#define __YTLIB_ADJ_GRAPH_H
11
12#include "ytGraph.h"
13
14typedef struct {
15#ifdef DOXY
16private:
17#endif
18 ytGraph super;
19 int nodes;
20 char * matrix; /* (u,v) edge is stored in matrix[u + v * nodes]. */
21 int * work; /* for returning a parent list. */
23
24ytAdjGraph * ytAdjGraph_new(int nodes);
25void ytAdjGraph_delete(ytAdjGraph * this);
26int ytAdjGraph_numNodes(const ytAdjGraph * this);
27int ytAdjGraph_numEdges(const ytAdjGraph * this);
28int ytAdjGraph_checkEdge(const ytAdjGraph * this, int src, int dst);
29int ytAdjGraph_degree(const ytAdjGraph * this, int j);
30int ytAdjGraph_numParents(const ytAdjGraph * this, int j);
31int ytAdjGraph_numChildren(const ytAdjGraph * this, int j);
32void ytAdjGraph_addEdge(ytAdjGraph * this, int src, int dst);
33const int * ytAdjGraph_getParents(const ytAdjGraph * this, int j);
34void ytAdjGraph_removeEdge(ytAdjGraph * this, int src, int dst);
35void ytAdjGraph_clear(ytAdjGraph * this);
36void ytAdjGraph_print(const ytAdjGraph * this, FILE * fp);
37ytGraphEdgeIter * ytAdjGraph_edgeIter(const ytAdjGraph * this);
38void ytAdjGraph_edgeIterNext(const ytAdjGraph * this, ytGraphEdgeIter * iter);
39
40#ifdef USE_MPI
41void ytAdjGraph_MPI_BcastI(ytObject ** pg, int root, MPI_Comm comm);
42#endif
43
44#endif /* __YTLIB_ADJ_GRAPH_H */
Interface class for handling graph structure.
The basis class.
Graph by adjacent matrix.
Definition ytAdjGraph.h:14
Definition ytGraph.h:26