Skip to content

Commit

Permalink
vendor: Update vendored sources to igraph/igraph@6981deb (#1680)
Browse files Browse the repository at this point in the history
Co-authored-by: krlmlr <[email protected]>
  • Loading branch information
github-actions[bot] and krlmlr authored Feb 11, 2025
1 parent 8417828 commit 9aa78e0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/vendor/cigraph/src/math/safe_intop.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ igraph_error_t igraph_i_safe_mult(igraph_integer_t a, igraph_integer_t b, igraph

/* Overflow-safe sum of integer vector elements. */
igraph_error_t igraph_i_safe_vector_int_sum(const igraph_vector_int_t *vec, igraph_integer_t *res) {
igraph_integer_t i, n = igraph_vector_int_size(vec);
const igraph_integer_t n = igraph_vector_int_size(vec);
igraph_integer_t sum = 0;
for (i=0; i < n; ++i) {
for (igraph_integer_t i=0; i < n; ++i) {
IGRAPH_SAFE_ADD(sum, VECTOR(*vec)[i], &sum);
}
*res = sum;
Expand All @@ -44,9 +44,9 @@ igraph_error_t igraph_i_safe_vector_int_sum(const igraph_vector_int_t *vec, igra

/* Overflow-safe product of integer vector elements. */
igraph_error_t igraph_i_safe_vector_int_prod(const igraph_vector_int_t *vec, igraph_integer_t *res) {
igraph_integer_t i, n = igraph_vector_int_size(vec);
const igraph_integer_t n = igraph_vector_int_size(vec);
igraph_integer_t prod = 1;
for (i=0; i < n; ++i) {
for (igraph_integer_t i=0; i < n; ++i) {
IGRAPH_SAFE_MULT(prod, VECTOR(*vec)[i], &prod);
}
*res = prod;
Expand Down
6 changes: 3 additions & 3 deletions src/vendor/cigraph/src/misc/bipartite.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ igraph_error_t igraph_bipartite_projection_size(const igraph_t *graph,
neilen1 = igraph_vector_int_size(neis1);
for (igraph_integer_t j = 0; j < neilen1; j++) {
igraph_integer_t neilen2, nei = VECTOR(*neis1)[j];
igraph_vector_int_t *neis2 = igraph_adjlist_get(&adjlist, nei);
const igraph_vector_int_t *neis2 = igraph_adjlist_get(&adjlist, nei);
if (IGRAPH_UNLIKELY(VECTOR(*types)[i] == VECTOR(*types)[nei])) {
IGRAPH_ERROR("Non-bipartite edge found in bipartite projection.",
IGRAPH_EINVAL);
Expand Down Expand Up @@ -179,7 +179,7 @@ static igraph_error_t igraph_i_bipartite_projection(const igraph_t *graph,
igraph_vector_int_t vertex_perm, vertex_index;
igraph_vector_int_t edges;
igraph_adjlist_t adjlist;
igraph_vector_int_t *neis1, *neis2;
const igraph_vector_int_t *neis1, *neis2;
igraph_integer_t neilen1, neilen2;
igraph_vector_int_t added;
igraph_vector_int_t mult;
Expand Down Expand Up @@ -354,7 +354,7 @@ igraph_error_t igraph_bipartite_projection(const igraph_t *graph,
igraph_vector_int_t *multiplicity2,
igraph_integer_t probe1) {

igraph_integer_t no_of_nodes = igraph_vcount(graph);
const igraph_integer_t no_of_nodes = igraph_vcount(graph);

/* t1 is -1 if proj1 is omitted, it is 0 if it belongs to type zero,
it is 1 if it belongs to type one. The same for t2 */
Expand Down
6 changes: 2 additions & 4 deletions src/vendor/cigraph/src/misc/chordality.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,16 @@ igraph_error_t igraph_is_chordal(const igraph_t *graph,
(igraph_vector_int_t*) my_alpha,
(igraph_vector_int_t*) my_alpham1));
} else if (alpha && !alpham1) {
igraph_integer_t v;
IGRAPH_VECTOR_INT_INIT_FINALLY(&v_alpham1, no_of_nodes);
my_alpham1 = &v_alpham1;
for (v = 0; v < no_of_nodes; v++) {
for (igraph_integer_t v = 0; v < no_of_nodes; v++) {
igraph_integer_t i = VECTOR(*my_alpha)[v];
VECTOR(*my_alpham1)[i] = v;
}
} else if (!alpha && alpham1) {
igraph_integer_t i;
IGRAPH_VECTOR_INT_INIT_FINALLY(&v_alpha, no_of_nodes);
my_alpha = &v_alpha;
for (i = 0; i < no_of_nodes; i++) {
for (igraph_integer_t i = 0; i < no_of_nodes; i++) {
igraph_integer_t v = VECTOR(*my_alpham1)[i];
VECTOR(*my_alpha)[v] = i;
}
Expand Down
4 changes: 1 addition & 3 deletions src/vendor/cigraph/src/properties/triangles_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ for (i = 0; i < no_of_nodes; i++) {
IGRAPH_CHECK(igraph_i_trans4_al_simplify(&allneis, &rank));

neis = IGRAPH_CALLOC(no_of_nodes, igraph_integer_t);
if (neis == 0) {
IGRAPH_ERROR("undirected local transitivity failed", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
}
IGRAPH_CHECK_OOM(neis, "Insufficient memory to count triangles.");
IGRAPH_FINALLY(igraph_free, neis);

#ifndef TRIANGLES
Expand Down
4 changes: 1 addition & 3 deletions src/vendor/cigraph/src/properties/triangles_template1.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ if (nodes_to_calc == 0) {
}

neis = IGRAPH_CALLOC(no_of_nodes, igraph_integer_t);
if (neis == 0) {
IGRAPH_ERROR("local undirected transitivity failed", IGRAPH_ENOMEM); /* LCOV_EXCL_LINE */
}
IGRAPH_CHECK_OOM(neis, "Insufficient memory to count triangles.");
IGRAPH_FINALLY(igraph_free, neis);

IGRAPH_CHECK(igraph_vector_resize(res, nodes_to_calc));
Expand Down
4 changes: 2 additions & 2 deletions src/vendor/igraph_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

__BEGIN_DECLS

#define IGRAPH_VERSION "0.10.15-52-g7955e08f3"
#define IGRAPH_VERSION "0.10.15-53-g6981deb37"
#define IGRAPH_VERSION_MAJOR 0
#define IGRAPH_VERSION_MINOR 10
#define IGRAPH_VERSION_PATCH 15
#define IGRAPH_VERSION_PRERELEASE "52-g7955e08f3"
#define IGRAPH_VERSION_PRERELEASE "53-g6981deb37"

IGRAPH_EXPORT void igraph_version(const char **version_string,
int *major,
Expand Down

0 comments on commit 9aa78e0

Please sign in to comment.