File: igraph_count_multiple.c

package info (click to toggle)
igraph 0.8.5%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,284 kB
  • sloc: ansic: 97,287; cpp: 22,541; yacc: 1,150; makefile: 546; lex: 478; xml: 450; pascal: 82; sh: 9
file content (37 lines) | stat: -rw-r--r-- 820 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

#include <igraph.h>

#include "test_utilities.inc"

int main() {
    igraph_t graph;
    igraph_vector_t counts;

    igraph_vector_init(&counts, 0);

    /* undirected case */
    igraph_small(&graph, 2, IGRAPH_UNDIRECTED,
                 0,1, 0,1, 0,1, 0,0, 1,1, 1,1,
                 -1);

    igraph_count_multiple(&graph, &counts, igraph_ess_all(IGRAPH_EDGEORDER_ID));
    print_vector_round(&counts, stdout);

    igraph_destroy(&graph);

    /* directed case */
    igraph_small(&graph, 2, IGRAPH_DIRECTED,
                 0,1, 0,1, 0,1, 0,0, 1,1, 1,1,
                 -1);

    igraph_count_multiple(&graph, &counts, igraph_ess_all(IGRAPH_EDGEORDER_ID));
    print_vector_round(&counts, stdout);

    igraph_destroy(&graph);

    igraph_vector_destroy(&counts);

    VERIFY_FINALLY_STACK();

    return 0;
}