Skip to content

Commit cdc7f95

Browse files
committed
chore: Update vendored sources to igraph/igraph@0f38345
feat: added generic, algorithm-agnostic versions of igraph_count_automorphisms(), igraph_automorphism_group() and igraph_canonical_permutation() refactor!: rename BLISS-specific isomorphism functions so they always have _bliss in the suffix - part 2 refactor!: rename BLISS-specific isomorphism functions so they always have _bliss in the suffix Merge branch 'master' into develop fix: fix segfault in GraphML reader refactor: remove unneeded include refactor: remove deprecated igraph_decompose_destroy() Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge pull request igraph/igraph#2470 from igraph/feat/is-biconnected Merge branch 'master' into develop Merge pull request igraph/igraph#2462 from igraph/feat/attribute-record-list Merge branch 'master' into develop fix: re-added missing master header in changelog Merge branch 'master' into develop Merge branch 'master' into develop refactor: consistently use ARPACK_DEFAULTS as the default arpack options chore: updated changelog feat: include Texinfo docs in source tarball fix: fix typo fix: look for either docbook2x-texi or docbook2texi fix: replace utf8 with utf-8 to prevent a warning when building texinfo docs ci: make sure that the Texinfo docs are also built Add target to build documentation in info format docs: clarify that Infomap considers edge directions fuzzer: update libxml2 to 2.12.3 fix: correct header includion in cliquer chore(deps): bump github/codeql-action from 2 to 3 chore(deps): bump actions/upload-artifact from 3 to 4 doc: clarify the effect of loop edges in igraph_similarity_inverse_log_weighted(), closes igraph/igraph#2448 refactor: rename deprecated functions in generated interfaces docs: fix typos refactor: clean up dfs/bfs and their docs refactor: replace void* with const igraph_vector_ptr_t* in attribute-related functions; more refactoring coming soon refactor!: strvector now contains pointers to const Merge branch 'master' into develop refactor: rename igraph_i_attribute_gettype() to igraph_i_attribute_get_type() for sake of consistency refactor: simplify attribute table init, copy and destroy methods chore: post-release tasks Merge branch 'master' into develop fix: fix stimulus function spec Merge branch 'master' into develop fix: community_spinglass_single() now uses igraph_real_t for output parameters that return real values, fixes igraph/igraph#2435 Merge branch 'master' into develop fix: fix jdm unit test and add rate-limited interruption to erdos_renyi_gnm_multi() fix: fix Stimulus type specs Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop fix: fix Stimulus type specs fix: allow interruption for multigaph case of G(n,m) generator Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop chore: fixed line endings and stale whitespace fix!: NCOL and LGL readers now use a default weight of 1, closes igraph/igraph#2395 fix: EDGEWEIGHTS type parameter was renamed to EDGE_WEIGHTS earlier Merge branch 'master' into develop Merge branch 'master' into develop refactor!: igraph_vector_swap() and igraph_matrix_swap() no longer return an error code Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Multi edge support for igraph_bipartite_game_gnm (igraph/igraph#2375) Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop correct number of erdos_renyi arguments in voronoi test chore: fix mismerged changelog refactor!: remove deprecated allocation macros Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop docs: clarify that usage of sub-headers is not supported closes igraph/igraph#2332 Merge branch 'master' into develop refactor: more readable variable named in similarity code Use two vertex selectors in Jaccard and Dice (igraph/igraph#2346) Merge branch 'master' into develop chore: update changelog, mentioning the the Pajek reader/writer now uses the 'name' attribute docs: update Pajek docs, mentioning that the 'name' attribute is used Merge pull request igraph/igraph#2276 from igraph/fix/pajek-names Merge pull request igraph/igraph#2265 from VRajesh7649/feat/erdos_penyi_gnm_multiedges Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop refactor: fixed singular/plural issues with abstract types in types.yaml, now they are consistent fix: fix typo in functions.yaml refactor: rename igraph_delete_vertices_idx() to igraph_delete_vertices_map(), closes igraph/igraph#2310 Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop chore: update changelog [skip ci] refactor: igraph_rng_set_default() now returns old RNG, fixes igraph/igraph#2273 Merge branch 'master' into develop Merge branch 'master' into develop move community_fastgreedy example to tests move community_edge_betweenness example to tests (igraph/igraph#2270) Revert "move community_edge_betweenness example to tests" move community_edge_betweenness example to tests Merge branch 'master' into develop refactor!: igraph_vector_shuffle() no longer returns an error code, closes igraph/igraph#2268 Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop fix: standards-complient definition for igraph_allow_interruption() refactor: replace IGRAPH_SUCCESS by false in IGRAPH_ALLOW_INTERRUPTION() refactor!: interruption handlers now return igraph_bool_t Merge branch 'master' into develop refactor!: removed void* argument of interruption handlers Merge branch 'master' into develop refactor!: igraph_induced_subgraph_map() does not offset the vertex IDs in the mapping any more refactor!: igraph_delete_vertices_idx() does not offset the vertex IDs in the mapping any more Merge branch 'master' into develop Merge branch 'master' into develop Merge branch 'master' into develop add mode parameter to distances_johnson (igraph/igraph#2218) Merge branch 'master' into develop chore: added 'develop' section to changelog Merge branch 'master' into develop Merge branch 'master' into develop refactor: remove unused 'destroy' field from heap data types; ABI-breaking change; refs igraph/igraph#2214
1 parent c442be2 commit cdc7f95

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4158
-5993
lines changed

R/aaa-auto.R

Lines changed: 101 additions & 830 deletions
Large diffs are not rendered by default.

src/cpp11.cpp

Lines changed: 474 additions & 466 deletions
Large diffs are not rendered by default.

src/rinterface.c

Lines changed: 272 additions & 826 deletions
Large diffs are not rendered by default.

src/vendor/cigraph/CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# igraph C library changelog
22

3+
## [develop]
4+
5+
### Breaking changes
6+
7+
- Interruption handlers do not take a `void*` argument any more; this is relevant to maintainers of higher-level interfaces only.
8+
- Interruption handlers now return an `igraph_bool_t` instead of an `igraph_error_t`; the returned value must be true if the calculation has to be interrupted and false otherwise.
9+
- `igraph_delete_vertices_map()` (formerly called `igraph_delete_vertices_idx()`) and `igraph_induced_subgraph_map()` now use -1 to represent unmapped vertices in the returned forward mapping vector and they do not offset vertex indices by 1 any more. (Note that the inverse map always behaved this way, this change makes the two mappings consistent).
10+
- `igraph_distances_johnson()` now takes a mode parameter to determine in which direction paths should be followed.
11+
- `igraph_vector_shuffle()` no longer returns an error code.
12+
- `igraph_vector_swap()` no longer returns an error code.
13+
- `igraph_matrix_swap()` no longer returns an error code.
14+
- `igraph_rng_set_default()` now returns a pointer to the previous RNG. Furthermore, this function now only stores a pointer to the `igraph_rng_t` struct passed to it, instead of copying the struct. Thus the `igraph_rng_t` must continue to exist for as long as it is used as the default RNG.
15+
- `igraph_similarity_jaccard()` and `igraph_similarity_dice()` now take two sets of vertices to create vertex pairs of, instead of one.
16+
- `igraph_read_graph_ncol()` and `igraph_read_graph_lgl()` now uses a default edge weight of 1 instead of 0 for files that do not contain edge weights for at least some of the edges.
17+
- `igraph_count_automorphisms()` has been renamed to `igraph_count_automorphisms_bliss()` because it has a BLISS-specific interface. A new `igraph_count_automorphisms()` function was added with a simplified interface that does not depend on BLISS.
18+
- `igraph_automorphism_group()` has been renamed to `igraph_automorphism_group_bliss()` because it has a BLISS-specific interface. A new `igraph_automorphism_group()` function was added with a simplified interface that does not depend on BLISS.
19+
- `igraph_canonical_permutation()` has been renamed to `igraph_canonical_permutation_bliss()` because it has a BLISS-specific interface. A new `igraph_canonical_permutation()` function was added with a simplified interface that does not depend on BLISS.
20+
21+
### Added
22+
23+
- `igraph_erdos_renyi_game_gnm()` gained a `multiple` Boolean argument to generate Erdős-Rényi graphs with multi-edges
24+
- `igraph_bipartite_game_gnm()` gained a `multiple` Boolean argument to generate random bipartite graphs with multi-edges
25+
26+
### Changed
27+
28+
- The Pajek format reader and writer now map vertex labels to the `name` vertex attribute in igraph. The `id` attribute is no longer used.
29+
30+
### Fixed
31+
32+
- `igraph_community_spinglass_single()` now uses `igraph_real_t` for its `inner_links` and `outer_links` output parameters, as these return not simply edge counts, but the sum of the weights of some edges.
33+
34+
### Removed
35+
36+
- Removed `igraph_Calloc()`, `igraph_Realloc()` and `igraph_Free()`. Use `IGRAPH_CALLOC()`, `IGRAPH_REALLOC()` and `IGRAPH_FREE()` instead.
37+
38+
### Deprecated
39+
40+
- `igraph_delete_vertices_idx()` is now deprecated in favour of `igraph_delete_vertices_map()`, which is functionally equivalent but has a name that is consistent with `igraph_induced_subgraph_map()`.
41+
342
## [master]
443

544
### Added
@@ -1308,6 +1347,7 @@ Some of the highlights are:
13081347
- Provide proper support for Windows, using `__declspec(dllexport)` and `__declspec(dllimport)` for `DLL`s and static usage by using `#define IGRAPH_STATIC 1`.
13091348
- Provided integer versions of `dqueue` and `stack` data types.
13101349

1350+
[develop]: https://github.com/igraph/igraph/compare/master..develop
13111351
[master]: https://github.com/igraph/igraph/compare/0.10.10..master
13121352
[0.10.10]: https://github.com/igraph/igraph/compare/0.10.9..0.10.10
13131353
[0.10.9]: https://github.com/igraph/igraph/compare/0.10.8..0.10.9

src/vendor/cigraph/etc/cmake/cpack_install_script.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,9 @@ if(CPACK_SOURCE_INSTALLED_DIRECTORIES)
7979
"${CPACK_PACKAGE_DIRECTORY}/doc/html"
8080
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/doc"
8181
)
82+
file(
83+
INSTALL
84+
"${CPACK_PACKAGE_DIRECTORY}/doc/igraph-docs.info"
85+
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/doc"
86+
)
8287
endif()

src/vendor/cigraph/etc/cmake/packaging.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set(CPACK_PACKAGE_VENDOR "The igraph development team")
44

55
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
66

7-
if(TARGET html)
7+
if(TARGET html AND TARGET info)
88
# Alias "dist" to "package_source"
99
add_custom_target(dist
1010
COMMAND "${CMAKE_COMMAND}"
@@ -14,13 +14,13 @@ if(TARGET html)
1414
USES_TERMINAL
1515
)
1616

17-
# We want to include the HTML docs in the source package so add a dependency
18-
add_dependencies(dist html)
17+
# Add dependencies to "dist"
18+
add_dependencies(dist html info)
1919
else()
2020
add_custom_target(dist
2121
COMMAND "${CMAKE_COMMAND}" -E false
2222
COMMENT
23-
"Cannot build source tarball since the HTML documentation was not built."
23+
"Cannot build source tarball since the HTML or the Texinfo documentation was not built."
2424
VERBATIM
2525
USES_TERMINAL
2626
)

src/vendor/cigraph/include/igraph_attributes.h

Lines changed: 148 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -41,108 +41,135 @@ __BEGIN_DECLS
4141
/* Attributes */
4242
/* -------------------------------------------------- */
4343

44-
/**
45-
* \section about_attributes
46-
*
47-
* <para>Attributes are numbers, boolean values or strings associated with
48-
* the vertices or edges of a graph, or with the graph itself. E.g. you may
49-
* label vertices with symbolic names or attach numeric weights to the edges
50-
* of a graph. In addition to these three basic types, a custom object
51-
* type is supported as well.</para>
52-
*
53-
* <para>igraph attributes are designed to be flexible and extensible.
54-
* In igraph attributes are implemented via an interface abstraction:
55-
* any type implementing the functions in the interface, can be used
56-
* for storing vertex, edge and graph attributes. This means that
57-
* different attribute implementations can be used together with
58-
* igraph. This is reasonable: if igraph is used from Python attributes can be
59-
* of any Python type, from R all R types are allowed. There is also an
60-
* experimental attribute implementation to be used when programming
61-
* in C, but by default it is currently turned off.</para>
62-
*
63-
* <para>First we briefly look over how attribute handlers can be
64-
* implemented. This is not something a user does every day. It is
65-
* rather typically the job of the high level interface writers. (But
66-
* it is possible to write an interface without implementing
67-
* attributes.) Then we show the experimental C attribute handler.</para>
68-
*/
69-
70-
/**
71-
* \section about_attribute_table
72-
* <para>It is possible to attach an attribute handling
73-
* interface to \a igraph. This is simply a table of functions, of
74-
* type \ref igraph_attribute_table_t. These functions are invoked to
75-
* notify the attribute handling code about the structural changes in
76-
* a graph. See the documentation of this type for details.</para>
77-
*
78-
* <para>By default there is no attribute interface attached to \a igraph.
79-
* To attach one, call \ref igraph_set_attribute_table with your new
80-
* table. This is normally done on program startup, and is kept untouched
81-
* for the program's lifetime. It must be done before any graph object
82-
* is created, as graphs created with a given attribute handler
83-
* cannot be manipulated while a different attribute handler is
84-
* active.</para>
85-
*/
86-
87-
/**
88-
* \section about_attribute_combination
89-
*
90-
* <para>Several graph operations may collapse multiple vertices or edges into
91-
* a single one. Attribute combination lists are used to indicate to the attribute
92-
* handler how to combine the attributes of the original vertices or edges and
93-
* how to derive the final attribute value that is to be assigned to the collapsed
94-
* vertex or edge. For example, \ref igraph_simplify() removes loops and combines
95-
* multiple edges into a single one; in case of a graph with an edge attribute
96-
* named \c weight the attribute combination list can tell the attribute handler
97-
* whether the weight of a collapsed edge should be the sum, the mean or some other
98-
* function of the weights of the original edges that were collapsed into one.</para>
99-
*
100-
* <para>One attribute combination list may contain several attribute combination
101-
* records, one for each vertex or edge attribute that is to be handled during the
102-
* operation.</para>
103-
*/
104-
10544
/**
10645
* \typedef igraph_attribute_type_t
107-
* The possible types of the attributes.
108-
*
109-
* Note that this is only the
110-
* type communicated by the attribute interface towards igraph
111-
* functions. E.g. in the R attribute handler, it is safe to say
112-
* that all complex R object attributes are strings, as long as this
113-
* interface is able to serialize them into strings. See also \ref
114-
* igraph_attribute_table_t.
46+
* \brief The possible types of the attributes.
47+
*
48+
* Values of this enum are used by the attribute interface to communicate the
49+
* type of an attribute to igraph's C core. When igraph is integrated in a
50+
* high-level language, the attribute type reported by the interface may not
51+
* necessarily have to match the exact data type in the high-level language as
52+
* long as the attribute interface can provide a conversion from the native
53+
* high-level attribute value to one of the data types listed here. When the
54+
* high-level data type is complex and has no suitable conversion to one of the
55+
* atomic igraph attribute types (numeric, string or Boolean), the attribute
56+
* interface should report the attribute as having an "object" type, which is
57+
* ignored by the C core. See also \ref igraph_attribute_table_t.
58+
*
11559
* \enumval IGRAPH_ATTRIBUTE_UNSPECIFIED Currently used internally
11660
* as a "null value" or "placeholder value" in some algorithms.
11761
* Attribute records with this type must not be passed to igraph
11862
* functions.
11963
* \enumval IGRAPH_ATTRIBUTE_NUMERIC Numeric attribute.
12064
* \enumval IGRAPH_ATTRIBUTE_BOOLEAN Logical values, true or false.
121-
* \enumval IGRAPH_ATTRIBUTE_STRING Attribute that can be converted to
122-
* a string.
65+
* \enumval IGRAPH_ATTRIBUTE_STRING String attribute.
12366
* \enumval IGRAPH_ATTRIBUTE_OBJECT Custom attribute type, to be
12467
* used for special data types by client applications. The R and
12568
* Python interfaces use this for attributes that hold R or Python
12669
* objects. Usually ignored by igraph functions.
12770
*/
128-
typedef enum { IGRAPH_ATTRIBUTE_UNSPECIFIED = 0,
129-
IGRAPH_ATTRIBUTE_DEFAULT IGRAPH_DEPRECATED_ENUMVAL = IGRAPH_ATTRIBUTE_UNSPECIFIED,
130-
IGRAPH_ATTRIBUTE_NUMERIC = 1,
131-
IGRAPH_ATTRIBUTE_BOOLEAN = 2,
132-
IGRAPH_ATTRIBUTE_STRING = 3,
133-
IGRAPH_ATTRIBUTE_OBJECT = 127
134-
} igraph_attribute_type_t;
71+
typedef enum {
72+
IGRAPH_ATTRIBUTE_UNSPECIFIED = 0,
73+
IGRAPH_ATTRIBUTE_DEFAULT IGRAPH_DEPRECATED_ENUMVAL = IGRAPH_ATTRIBUTE_UNSPECIFIED,
74+
IGRAPH_ATTRIBUTE_NUMERIC = 1,
75+
IGRAPH_ATTRIBUTE_BOOLEAN = 2,
76+
IGRAPH_ATTRIBUTE_STRING = 3,
77+
IGRAPH_ATTRIBUTE_OBJECT = 127
78+
} igraph_attribute_type_t;
13579

80+
/**
81+
* \typedef igraph_attribute_elemtype_t
82+
* \brief Types of objects to which attributes can be attached.
83+
*
84+
* \enumval IGRAPH_ATTRIBUTE_GRAPH Denotes that an attribute belongs to the
85+
* entire graph.
86+
* \enumval IGRAPH_ATTRIBUTE_VERTEX Denotes that an attribute belongs to the
87+
* vertices of a graph.
88+
* \enumval IGRAPH_ATTRIBUTE_EDGE Denotes that an attribute belongs to the
89+
* edges of a graph.
90+
*/
91+
typedef enum {
92+
IGRAPH_ATTRIBUTE_GRAPH = 0,
93+
IGRAPH_ATTRIBUTE_VERTEX,
94+
IGRAPH_ATTRIBUTE_EDGE
95+
} igraph_attribute_elemtype_t;
96+
97+
/* -------------------------------------------------- */
98+
/* Attribute records */
99+
/* -------------------------------------------------- */
100+
101+
/**
102+
* \typedef igraph_attribute_record_t
103+
* \brief An attribute record holding the name, type and values of an attribute.
104+
*
105+
* This composite data type is used in the attribute interface to specify a
106+
* name-type-value triplet where the name is the name of a graph, vertex or
107+
* edge attribute, the type is the corresponding igraph type of the attribute
108+
* and the value is a \em vector of attribute values. Note that for graph
109+
* attributes we use a vector of length 1. The type of the vector depends on
110+
* the attribute type: it is \ref igraph_vector_t for numeric attributes,
111+
* \c igraph_strvector_t for string attributes and \c igraph_vector_bool_t
112+
* for Boolean attributes.
113+
*
114+
* </para><para>
115+
* The record also stores default values for the attribute. The default values
116+
* are used when the value vector of the record is resized with
117+
* \ref igraph_attribute_record_resize(). It is important that the record
118+
* stores \em one default value only, corresponding to the type of the
119+
* attribute record. The default value is \em cleared when the type of the
120+
* record is changed.
121+
*/
136122
typedef struct igraph_attribute_record_t {
137-
const char *name;
123+
char *name;
138124
igraph_attribute_type_t type;
139-
const void *value;
125+
union {
126+
void *as_raw;
127+
igraph_vector_t *as_vector;
128+
igraph_strvector_t *as_strvector;
129+
igraph_vector_bool_t *as_vector_bool;
130+
} value;
131+
union {
132+
igraph_real_t numeric;
133+
igraph_bool_t boolean;
134+
char *string;
135+
} default_value;
140136
} igraph_attribute_record_t;
141137

142-
typedef enum { IGRAPH_ATTRIBUTE_GRAPH = 0,
143-
IGRAPH_ATTRIBUTE_VERTEX,
144-
IGRAPH_ATTRIBUTE_EDGE
145-
} igraph_attribute_elemtype_t;
138+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_init(
139+
igraph_attribute_record_t *attr, const char* name, igraph_attribute_type_t type
140+
);
141+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_init_copy(
142+
igraph_attribute_record_t *to, const igraph_attribute_record_t *from
143+
);
144+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_check_type(
145+
const igraph_attribute_record_t *attr, igraph_attribute_type_t type
146+
);
147+
IGRAPH_EXPORT igraph_integer_t igraph_attribute_record_size(
148+
const igraph_attribute_record_t *attr
149+
);
150+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_resize(
151+
igraph_attribute_record_t *attr, igraph_integer_t new_size
152+
);
153+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_set_name(
154+
igraph_attribute_record_t *attr, const char* name
155+
);
156+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_set_default_numeric(
157+
igraph_attribute_record_t *attr, igraph_real_t value
158+
);
159+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_set_default_boolean(
160+
igraph_attribute_record_t *attr, igraph_bool_t value
161+
);
162+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_set_default_string(
163+
igraph_attribute_record_t *attr, const char* value
164+
);
165+
IGRAPH_EXPORT igraph_error_t igraph_attribute_record_set_type(
166+
igraph_attribute_record_t *attr, igraph_attribute_type_t type
167+
);
168+
IGRAPH_EXPORT void igraph_attribute_record_destroy(igraph_attribute_record_t *attr);
169+
170+
/* -------------------------------------------------- */
171+
/* Attribute combinations */
172+
/* -------------------------------------------------- */
146173

147174
/**
148175
* \typedef igraph_attribute_combination_type_t
@@ -207,6 +234,22 @@ IGRAPH_EXPORT igraph_error_t igraph_attribute_combination_query(const igraph_att
207234
igraph_attribute_combination_type_t *type,
208235
igraph_function_pointer_t *func);
209236

237+
/* -------------------------------------------------- */
238+
/* List of attribute records */
239+
/* -------------------------------------------------- */
240+
241+
#define ATTRIBUTE_RECORD_LIST
242+
#define BASE_ATTRIBUTE_RECORD
243+
#include "igraph_pmt.h"
244+
#include "igraph_typed_list_pmt.h"
245+
#include "igraph_pmt_off.h"
246+
#undef BASE_ATTRIBUTE_RECORD
247+
#undef ATTRIBUTE_RECORD_LIST
248+
249+
/* -------------------------------------------------- */
250+
/* Attribute handler interface */
251+
/* -------------------------------------------------- */
252+
210253
/**
211254
* \struct igraph_attribute_table_t
212255
* \brief Table of functions to perform operations on attributes.
@@ -218,18 +261,23 @@ IGRAPH_EXPORT igraph_error_t igraph_attribute_combination_query(const igraph_att
218261
* created, right after it is created but before any vertices or
219262
* edges are added. It is supposed to set the \c attr member of the \c
220263
* igraph_t object, which is guaranteed to be set to a null pointer
221-
* before this function is called. It is expected to return an error code.
264+
* before this function is called. It is expected to set the \c attr member
265+
* to a non-null value \em or return an error code. Leaving the \c attr
266+
* member at a null value while returning success is invalid and will trigger
267+
* an error in the C core of igraph itself.
222268
* \member destroy This function is called whenever the graph object
223269
* is destroyed, right before freeing the allocated memory. It is supposed
224270
* to do any cleanup operations that are need to dispose of the \c attr
225271
* member of the \c igraph_t object properly. The caller will set the
226272
* \c attr member to a null pointer after this function returns.
227-
* \member copy This function is called when copying a graph with \ref
228-
* igraph_copy, after the structure of the graph has been already
229-
* copied. It is supposed to populate the \c attr member of the target
230-
* \c igraph_t object. The \c attr member of the target is guaranteed to be
231-
* set to a null pointer before this function is called. It is expected to
232-
* return an error code.
273+
* \member copy This function is called when the C core wants to populate the
274+
* attributes of a graph from another graph. The struvture of the target
275+
* graph is already initialized by the time this function is called, and the
276+
* \c attr member of the graph is set to null pointer. The function is
277+
* supposed to populate the \c attr member of the target \c igraph_t object
278+
* to a non-null value \em or return an error code. Leaving the \c attr
279+
* member at a null value while returning success is invalid and will trigger
280+
* an error in the C core of igraph itself.
233281
* \member add_vertices Called when vertices are added to a
234282
* graph, before adding the vertices themselves.
235283
* The number of vertices to add is supplied as an
@@ -311,20 +359,25 @@ IGRAPH_EXPORT igraph_error_t igraph_attribute_combination_query(const igraph_att
311359
*/
312360

313361
typedef struct igraph_attribute_table_t {
314-
igraph_error_t (*init)(igraph_t *graph, igraph_vector_ptr_t *attr);
362+
igraph_error_t (*init)(igraph_t *graph, const igraph_attribute_record_list_t *attr);
315363
void (*destroy)(igraph_t *graph);
316364
igraph_error_t (*copy)(igraph_t *to, const igraph_t *from, igraph_bool_t ga,
317365
igraph_bool_t va, igraph_bool_t ea);
318-
igraph_error_t (*add_vertices)(igraph_t *graph, igraph_integer_t nv, igraph_vector_ptr_t *attr);
366+
igraph_error_t (*add_vertices)(
367+
igraph_t *graph, igraph_integer_t nv,
368+
const igraph_attribute_record_list_t *attr
369+
);
319370
igraph_error_t (*permute_vertices)(const igraph_t *graph,
320371
igraph_t *newgraph,
321372
const igraph_vector_int_t *idx);
322373
igraph_error_t (*combine_vertices)(const igraph_t *graph,
323374
igraph_t *newgraph,
324375
const igraph_vector_int_list_t *merges,
325376
const igraph_attribute_combination_t *comb);
326-
igraph_error_t (*add_edges)(igraph_t *graph, const igraph_vector_int_t *edges,
327-
igraph_vector_ptr_t *attr);
377+
igraph_error_t (*add_edges)(
378+
igraph_t *graph, const igraph_vector_int_t *edges,
379+
const igraph_attribute_record_list_t *attr
380+
);
328381
igraph_error_t (*permute_edges)(const igraph_t *graph,
329382
igraph_t *newgraph, const igraph_vector_int_t *idx);
330383
igraph_error_t (*combine_edges)(const igraph_t *graph,

0 commit comments

Comments
 (0)