Esempio n. 1
0
int main() {
  int res;
  int i;
  igraph_vector_t weights;
  igraph_integer_t is_weighted;

  igraph_vector_init_real(&weights, 5, 1.0, 2.0, 3.0, 4.0, 5.0);

  for (i = 0; i < 8; i++) {
    igraph_bool_t is_normalized = i / 4;
    igraph_vector_t* v = ((i & 2) / 2 ? &weights : 0);
    igraph_bool_t dir = (i % 2 ? IGRAPH_DIRECTED : IGRAPH_UNDIRECTED);

    printf("=== %sormalized, %sweighted, %sdirected\n",
      (is_normalized ? "N" : "Unn"),
      (v != 0 ? "" : "un"),
      (dir == IGRAPH_DIRECTED ? "" : "un")
    );

    if (is_normalized)
      res = test_normalized_laplacian(v, dir);
    else
      res = test_unnormalized_laplacian(v, dir);

    if (res)
      return i+1;
  }

  igraph_vector_destroy(&weights);

  return 0;
}
int main() {
  int res;
  int i;

  for (i = 0; i < 4; i++) {
    igraph_bool_t is_normalized = i / 2;
    igraph_bool_t dir = (i % 2 ? IGRAPH_DIRECTED : IGRAPH_UNDIRECTED);

    printf("=== %sormalized, unweighted, %sdirected\n",
      (is_normalized ? "N" : "Unn"),
      (dir == IGRAPH_DIRECTED ? "" : "un")
    );

    if (is_normalized)
      res = test_normalized_laplacian(dir);
    else
      res = test_unnormalized_laplacian(dir);

    if (res)
      return i+1;
  }

  return 0;
}