1 /* -*- mode: C -*-  */
2 /*
3    IGraph library.
4    Copyright (C) 2007-2012  Gabor Csardi <csardi.gabor@gmail.com>
5    334 Harvard st, Cambridge MA, 02139 USA
6 
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA
20    02110-1301 USA
21 
22 */
23 
24 #include <igraph.h>
25 
print_vector(igraph_vector_bool_t * v,FILE * f)26 void print_vector(igraph_vector_bool_t *v, FILE *f) {
27     long int i;
28     for (i = 0; i < igraph_vector_bool_size(v); i++) {
29         fprintf(f, " %i", (int) VECTOR(*v)[i]);
30     }
31     fprintf(f, "\n");
32 }
33 
main()34 int main() {
35 
36     igraph_t graph;
37     igraph_bool_t res;
38 
39     igraph_small(&graph, 0, IGRAPH_DIRECTED, 0, 1, 1, 2, 2, 1, 0, 1, 1, 0, 3, 4, 11, 10, -1);
40     igraph_has_multiple(&graph, &res);
41     if (!res) {
42         return 1;
43     }
44     igraph_destroy(&graph);
45 
46     igraph_small(&graph, 0, IGRAPH_UNDIRECTED,
47                  0, 0, 1, 2, 1, 1, 2, 2, 2, 1, 2, 3, 2, 4,
48                  2, 5, 2, 6, 2, 2, 3, 2, 0, 0, 6, 2, 2, 2, 0, 0, -1);
49     igraph_has_multiple(&graph, &res);
50     if (!res) {
51         return 2;
52     }
53     igraph_destroy(&graph);
54 
55     igraph_small(&graph, 0, IGRAPH_DIRECTED, 0, 1, 1, 2, 2, 1, 1, 0, 3, 4, 11, 10, -1);
56     igraph_has_multiple(&graph, &res);
57     if (res) {
58         return 3;
59     }
60     igraph_destroy(&graph);
61 
62     igraph_small(&graph, 0, IGRAPH_UNDIRECTED,
63                  0, 0, 1, 2, 1, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 2, -1);
64     igraph_has_multiple(&graph, &res);
65     if (!res) {
66         return 4;
67     }
68     igraph_destroy(&graph);
69 
70     igraph_small(&graph, 0, IGRAPH_UNDIRECTED,
71                  0, 0, 1, 2, 1, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, -1);
72     igraph_has_multiple(&graph, &res);
73     if (res) {
74         return 5;
75     }
76     igraph_destroy(&graph);
77 
78     igraph_small(&graph, 0, IGRAPH_UNDIRECTED, 0, 1, 0, 1, 1, 2, -1);
79     igraph_has_multiple(&graph, &res);
80     if (!res) {
81         return 6;
82     }
83     igraph_destroy(&graph);
84 
85     igraph_small(&graph, 0, IGRAPH_UNDIRECTED, 0, 0, 0, 0, -1);
86     igraph_has_multiple(&graph, &res);
87     if (!res) {
88         return 7;
89     }
90     igraph_destroy(&graph);
91 
92     return 0;
93 }
94