INGOR
ytNetUtils.h
1/*
2 net/ytNetUtils.{h,c} : Utility functions for networks
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#ifndef __YTLIB_NET_UTILS_H
36#define __YTLIB_NET_UTILS_H
37#include "ytNetwork.h"
38#include "util/ytData.h"
39int ytNetUtils_checkConsistency(const ytNetwork * network, const ytData * data,
40 const char * name);
41void ytNetUtils_countParentTypes(const ytNetwork * network, const ytData * data,
42 int * mp, int * mc, int * md);
43void ytNetUtils_countParentType(const ytData * data,
44 int j, const int * parents, int q,
45 int * nc, int * nd);
46int ytNetUtils_dataToNetMap(const ytData * data, const ytNetwork * network, int * map);
47int ytNetUtils_netToDataMap(const ytNetwork * network, const ytData * data, int * map);
48void ytNetUtils_countParentTypes2(const ytNetwork * network, const ytData * data,
49 const int * rmap, int * mp, int * mc, int * md);
50#endif /* __YTLIB_NET_UTILS_H */
void ytNetUtils_countParentTypes(const ytNetwork *network, const ytData *data, int *mp, int *mc, int *md)
Counts the maximum numbers of type specific parents in a network.
Definition: ytNetUtils.c:98
int ytNetUtils_netToDataMap(const ytNetwork *network, const ytData *data, int *map)
Sets a map of indices from the network to the data.
Definition: ytNetUtils.c:201
void ytNetUtils_countParentType(const ytData *data, int j, const int *parents, int q, int *nc, int *nd)
Counts the maximum numbers of type specific parents for a single node.
Definition: ytNetUtils.c:75
int ytNetUtils_checkConsistency(const ytNetwork *network, const ytData *data, const char *name)
Checks if the nodes in the network are consistent with given ytData instance.
Definition: ytNetUtils.c:53
int ytNetUtils_dataToNetMap(const ytData *data, const ytNetwork *network, int *map)
Sets a map of indices from the data to the network.
Definition: ytNetUtils.c:181
void ytNetUtils_countParentTypes2(const ytNetwork *network, const ytData *data, const int *rmap, int *mp, int *mc, int *md)
Counts the maximum numbers of types of parents in a network with the node map.
Definition: ytNetUtils.c:126
Network abstraction.
General data container.
Definition: ytData.h:73