INGOR
Loading...
Searching...
No Matches
ytNetwork.h
1/*
2 net/ytNetwork.{h,c} : Network
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 * Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
13 * Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in
15 the documentation and/or other materials provided with the
16 distribution.
17
18 * Neither the name of Kyoto University nor the names of its
19 contributors may be used to endorse or promote products derived
20 from this software without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 POSSIBILITY OF SUCH DAMAGE.
34*/
35
36#ifndef __YTLIB_NETWORK_H
37#define __YTLIB_NETWORK_H
38
39#include "math/ytGraph.h"
40#include "util/ytArray.h"
41#include "net/ytNode.h"
42#include "net/ytEdge.h"
43
44typedef struct ytNetwork_t ytNetwork;
45
46ytNetwork * ytNetwork_new();
47void ytNetwork_delete(ytNetwork * this);
48void ytNetwork_dump(ytNetwork * this, FILE * fp);
49int ytNetwork_numNodes(const ytNetwork * this);
50int ytNetwork_numGraphNodes(const ytNetwork * this);
51void ytNetwork_setGraph(ytNetwork * this, ytGraph * g);
52ytGraph * ytNetwork_getGraph(const ytNetwork * this);
53void ytNetwork_addNode(ytNetwork * this, ytNode * node);
54ytNode * ytNetwork_getNode(const ytNetwork * this, int j);
55ytNode * ytNetwork_setNode(ytNetwork * this, int j, ytNode * node);
56int ytNetwork_degree(const ytNetwork * this, int j);
57int ytNetwork_numParents(const ytNetwork * this, int j);
58int ytNetwork_maxParents(const ytNetwork * this);
59int ytNetwork_numChildren(const ytNetwork * this, int j);
60int ytNetwork_numEdges(const ytNetwork * this);
61const int * ytNetwork_getParents(const ytNetwork * this, int j);
62ytNode * ytNetwork_getParent(const ytNetwork * this, int j, int k);
63int ytNetwork_getParentId(const ytNetwork * this, int j, int k);
64void ytNetwork_setProperty(ytNetwork * this, const char * key, ytObject * value);
65ytObject * ytNetwork_getProperty(const ytNetwork * this, const char * key);
66int ytNetwork_getPropertySize(const ytNetwork * this);
67const char * ytNetwork_getPropertyKey(const ytNetwork * this, int i);
68ytObject * ytNetwork_getPropertyAt(const ytNetwork * this, int i);
69int ytNetwork_findNode(const ytNetwork * this, const char * name);
70ytObject * ytNetwork_getNodeProperty(ytNetwork * this, int j, const char * key);
71void ytNetwork_setNodeProperty(ytNetwork * this, int j, const char * key, ytObject * value);
72void ytNetwork_setEdge(ytNetwork * this, ytEdge * edge);
73ytEdge * ytNetwork_getEdge(ytNetwork * this, int u, int v);
74ytEdge * ytNetwork_getEdgeConst(const ytNetwork * this, int u, int v);
75ytEdge * ytNetwork_removeEdge(ytNetwork * this, int u, int v);
76
77#include "util/ytMPI.h"
78void ytNetwork_MPI_Bcast(ytNetwork ** pNetwork, int root, MPI_Comm comm);
79
80int ytNetwork_test(int argc, char * argv[]);
81
82#endif /* __YTLIB_NETWORK_H */
Network edge.
Interface class for handling graph structure.
Network abstraction.
The basis class.
Definition ytNetwork.c:48
Network node.
Definition ytNode.h:42