src/graph.c
/* Nabbed from the igraph examples, very handy */
Nabbed from the igraph examples, very handy
Nabbed from the igraph examples very handy
void print(igraph_t *g) {
  igraph_vector_t el;
  long int i, j, n;
  char ch = igraph_is_directed(g) ? '>' : '-';
  igraph_vector_init(&el, 0);
  igraph_get_edgelist(g, &el, 0);
  n = igraph_ecount(g);
  for (i=0, j=0; i<n; i++, j+=2) {
    printf("%ld --%c %ld: %ld\n",
      (long)VECTOR(el)[j], ch, (long)VECTOR(el)[j+1], (long)EAN(g, "weight", i)); 
  }
  printf("\n");
  igraph_vector_destroy(&el);
}
void print ( igraph_t * g ) { igraph_vector_t el ; long int i , j , n ; char ch = igraph_is_directed ( g ) ? ' ' : ' ' ; igraph_vector_init ( & el , 0 ) ; igraph_get_edgelist ( g , & el , 0 ) ; n = igraph_ecount ( g ) ; for ( i = 0 , j = 0 ; i < n ; i ++ , j += 2 ) { printf ( " \n " , ( long ) VECTOR ( el ) [ j ] , ch , ( long ) VECTOR ( el ) [ j + 1 ] , ( long ) EAN ( g , " " , i ) ) ; } printf ( " \n " ) ; igraph_vector_destroy ( & el ) ; }
Nabbed from the igraph examples, very handy
Nabbed from the igraph examples very handy