File: igraph_count_multiple.c

package info (click to toggle)
igraph 0.10.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 16,176 kB
  • sloc: ansic: 121,500; cpp: 21,699; xml: 2,734; python: 411; makefile: 147; javascript: 20; sh: 9
file content (37 lines) | stat: -rw-r--r-- 814 bytes parent folder | download | duplicates (6)
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.h"

int main(void) {
    igraph_t graph;
    igraph_vector_int_t counts;

    igraph_vector_int_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_int(&counts);

    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_int(&counts);

    igraph_destroy(&graph);

    igraph_vector_int_destroy(&counts);

    VERIFY_FINALLY_STACK();

    return 0;
}