# vim:set ts=4 sw=4 sts=4 et:
#
# This file is a YAML representation of the types used in the functions.yaml
# function specification file. It provides the meaning of each type in comments
# and also specifies the C types corresponding to each abstract type.
#
# See https://github.com/igraph/stimulus for more information

###############################################################################
## Core igraph data types
###############################################################################

INTEGER:
    # An ordinary igraph integer
    CTYPE: igraph_integer_t

REAL:
    # An ordinary igraph floating-point number
    CTYPE: igraph_real_t

BOOLEAN:
    # An ordinary igraph Boolean value
    CTYPE: igraph_bool_t

COMPLEX:
    # An ordinary igraph complex number
    CTYPE: igraph_complex_t

ERROR:
    # An igraph error code
    CTYPE: igraph_error_t

###############################################################################
## C data types
###############################################################################

INT:
    # A C integer
    CTYPE: int

LONGINT:
    # A C long integer
    CTYPE: long int

CSTRING:
    # A null-terminated immutable C string
    CTYPE: const char*

INFILE:
    # A file, already open for reading
    CTYPE: FILE*

OUTFILE:
    # A file, already open for writing
    CTYPE: FILE*

DOUBLE:
    # A C double
    CTYPE: double

VOID:
    # C void
    CTYPE: void

###############################################################################
# Vectors, matrices and other template types
###############################################################################

INDEX_VECTOR:
    # A vector of integer indices that should adapt to the conventions of the
    # host language (i.e. 1-based for R, Mathematica, Octave etc., 0-based for
    # Python and similar).
    CTYPE: igraph_vector_int_t
    FLAGS: BY_REF

VECTOR:
    # A vector of floating-point numbers
    CTYPE: igraph_vector_t
    FLAGS: BY_REF

VECTOR_INT:
    # A vector of igraph integers
    CTYPE: igraph_vector_int_t
    FLAGS: BY_REF

VECTOR_BOOL:
    # A vector of Boolean values
    CTYPE: igraph_vector_bool_t
    FLAGS: BY_REF

VECTOR_COMPLEX:
    # A vector of igraph complex numbers
    CTYPE: igraph_vector_complex_t

VECTOR_STR:
    # A vector of strings
    CTYPE: igraph_strvector_t
    FLAGS: BY_REF

VECTOR_LIST:
    # A list containing vectors of floating-point numbers
    CTYPE: igraph_vector_list_t
    FLAGS: BY_REF

VECTOR_INT_LIST:
    # A list containing vectors of integers
    CTYPE: igraph_vector_int_list_t
    FLAGS: BY_REF

MATRIX:
    # A matrix of floating-point numbers
    CTYPE: igraph_matrix_t
    FLAGS: BY_REF

MATRIX_INT:
    # A matrix of igraph integers
    CTYPE: igraph_matrix_int_t
    FLAGS: BY_REF

MATRIX_COMPLEX:
    # A matrix of igraph complex numbers
    CTYPE: igraph_matrix_complex_t

MATRIX_LIST:
    # A list containing matrices of floating-point numbers
    CTYPE: igraph_matrix_list_t
    FLAGS: BY_REF

SPARSEMAT:
    # A sparse matrix of floating-point numbers
    CTYPE: igraph_sparsemat_t
    FLAGS: BY_REF

###############################################################################
# Vertices, edges, vertex and edge selectors
###############################################################################

EDGE:
    # A single edge index
    CTYPE: igraph_integer_t

EDGE_INDICES:
    # An integer vector containing edge indices.
    CTYPE: igraph_vector_int_t
    FLAGS: BY_REF

EDGE_SELECTOR:
    # An igraph edge selector. Typically used only as an input argument type.
    CTYPE: igraph_es_t

VERTEX:
    # A single vertex index
    CTYPE: igraph_integer_t

VERTEX_INDICES:
    # An integer vector containing vertex indices.
    CTYPE: igraph_vector_int_t
    FLAGS: BY_REF

VERTEX_INDEX_PAIRS:
    # An integer vector containing pairs of vertex indices, in a flattened
    # representation
    CTYPE: igraph_vector_int_t
    FLAGS: BY_REF

VERTEX_SELECTOR:
    # An igraph vertex selector. Typically used only as an input argument type.
    CTYPE: igraph_vs_t

###############################################################################
# Specialized vectors with semantic meaning
###############################################################################

BIPARTITE_TYPES:
    # A vector containing Booleans that define the two partitions of a
    # bipartite graph
    CTYPE: igraph_vector_bool_t
    FLAGS: BY_REF

EDGE_CAPACITY:
    # A vector containing edge capacities (typically for max-flow algorithms)
    CTYPE: igraph_vector_t
    FLAGS: BY_REF

EDGE_COLOR:
    # A vector containing edge colors
    CTYPE: igraph_vector_int_t
    FLAGS: BY_REF

EDGE_LENGTHS:
    # A vector containing edge lengths
    CTYPE: igraph_vector_t
    FLAGS: BY_REF

EDGEWEIGHTS:
    # A vector containing edge weights
    CTYPE: igraph_vector_t
    FLAGS: BY_REF

EDGESET_LIST:
    # A list containing vectors of igraph integers where each such
    # vector represents a sequence of edge indices.
    CTYPE: igraph_vector_int_list_t
    FLAGS: BY_REF

GRAPH_LIST:
    # A list containing graphs (owned by the list itself)
    CTYPE: igraph_graph_list_t
    FLAGS: BY_REF

GRAPH_PTR_LIST:
    # A vector containing pointers to graph objects (not owned by the vector)
    CTYPE: igraph_vector_ptr_t
    FLAGS: BY_REF

VERTEX_QTY:
    # A vector of floating-point numbers where each entry corresponds to
    # one of the vertices in a graph and its value represents some quantity
    # associated to the vertex with the same index. Higher-level interfaces may
    # use this type to provide a "named vector" such that each entry can be
    # indexed either by the vertex index or by the vertex name.
    CTYPE: igraph_vector_t
    FLAGS: BY_REF

SIR_LIST:
    # A vector containing pointers to igraph_sir_t objects
    CTYPE: igraph_vector_ptr_t
    FLAGS: BY_REF

VERTEXSET_LIST:
    # A list containing vectors of igraph integers where each such
    # vector represents a sequence of vertex indices.
    CTYPE: igraph_vector_int_list_t
    FLAGS: BY_REF

VERTEX_COLOR:
    # A vector containing vertex colors
    CTYPE: igraph_vector_int_t
    FLAGS: BY_REF

VERTEXWEIGHTS:
    # A vector containing vertex weights
    CTYPE: igraph_vector_t
    FLAGS: BY_REF

###############################################################################
# Graph representations
###############################################################################

GRAPH:
    # An igraph graph
    CTYPE: igraph_t
    FLAGS: BY_REF

ADJLIST:
    # A graph represented as an adjacency list
    CTYPE: igraph_adjlist_t
    FLAGS: BY_REF

INCLIST:
    # A graph represented as an incidence list
    CTYPE: igraph_inclist_t
    FLAGS: BY_REF

###############################################################################
# Enums
###############################################################################

ADD_WEIGHTS:
    # Whether to add the weights of the edges read from a file to the graph
    # being created
    CTYPE: igraph_add_weights_t
    FLAGS: ENUM

ADJACENCY_MODE:
    # Enum that describes how an adjacency matrix should be constructed
    CTYPE: igraph_adjacency_t
    FLAGS: ENUM

BARABASI_ALGORITHM:
    # Enum that describes the various implementations of the Barabasi model
    # that igraph supports
    CTYPE: igraph_barabasi_algorithm_t
    FLAGS: ENUM

BLISSSH:
    # Enum containing splitting heuristics for the Bliss algorithm
    CTYPE: igraph_bliss_sh_t
    FLAGS: ENUM

COMMCMP:
    # Enum containing identifiers for community comparison methods
    CTYPE: igraph_community_comparison_t
    FLAGS: ENUM

CONNECTEDNESS:
    # Enum that selects between weak and strong connectivity
    CTYPE: igraph_connectedness_t
    FLAGS: ENUM

DEGSEQ_MODE:
    # Enum that describes the various implementations of generating a graph
    # with an arbitrary degree sequence
    CTYPE: igraph_degseq_t
    FLAGS: ENUM

EIGENALGO:
    # Enum used for selecting an algorithm that determines the eigenvalues
    # and eigenvectors of some input
    CTYPE: igraph_eigen_algorithm_t
    FLAGS: ENUM

EIGENWHICHPOS:
    # Enum representing which eigenvalues to use in the spectral embedding
    # algorithm
    CTYPE: igraph_eigen_which_position_t
    FLAGS: ENUM

ERDOS_RENYI_TYPE:
    # Enum that says wheter a GNM (n vertices, m edges) or
    # GNP (n vertices, every edge exists with probability p)
    # graph is created
    CTYPE: igraph_erdos_renyi_t
    FLAGS: ENUM

FAS_ALGORITHM:
    # Enum representing feedback arc set algorithms
    CTYPE: igraph_fas_algorithm_t
    FLAGS: ENUM

FWALGORITHM:
    # Enum that describes the variant of the Floyd-Warshall algorithm to use in
    # Floyd-Warshall graph distances computing function
    CTYPE: igraph_floyd_warshall_algorithm_t
    FLAGS: ENUM

GETADJACENCY:
    # Enum storing how to retrieve the adjacency matrix from a graph
    CTYPE: igraph_get_adjacency_t
    FLAGS: ENUM

GREEDY_COLORING_HEURISTIC:
    # Enum representing different heuristics for a greedy vertex coloring
    CTYPE: igraph_coloring_greedy_t
    FLAGS: ENUM

IMITATE_ALGORITHM:
    # This enum controls which algorithm to use in stochastic imitation
    CTYPE: igraph_imitate_algorithm_t
    FLAGS: ENUM

LAPLACIAN_NORMALIZATION:
    # Enum representing the possible normalization methods of a Laplacian
    # matrix
    CTYPE: igraph_laplacian_normalization_t
    FLAGS: ENUM

LAYOUT_GRID:
    # Whether to use the fast (but less accurate) grid-based version of a
    # layout algorithm that supports it (typically the Fruchterman-Reingold
    # layout)
    CTYPE: igraph_layout_grid_t
    FLAGS: ENUM

LOOPS:
    # Enum that describes how loop edges should be handled in undirected graphs
    # in functions that support it. Possible options are: no loops, loops
    # counted once, loops counted twice
    CTYPE: igraph_loops_t
    FLAGS: ENUM

LSETYPE:
    # Enum storing the possible types (definitions) of the Laplacian matrix
    # to use in the Laplacian spectral embedding algorithms
    CTYPE: igraph_laplacian_spectral_embedding_type_t
    FLAGS: ENUM

NEIMODE:
    # Enum that describes how a particular function should take into account
    # the neighbors of vertices
    CTYPE: igraph_neimode_t
    FLAGS: ENUM

OPTIMALITY:
    # This enum controls which algorithm to use in deterministic optimal imitation
    CTYPE: igraph_optimal_t
    FLAGS: ENUM

ORDER:
    # Whether ordering should be ascending or descending
    CTYPE: igraph_order_t
    FLAGS: ENUM

PAGERANKALGO:
    # Enum that describes the various implementations of the PageRank algorithm
    CTYPE: igraph_pagerank_algo_t
    FLAGS: ENUM

RANDOM_TREE_METHOD:
    # Enum that describes the various implementation of the uniform random tree
    # sampling method
    CTYPE: igraph_random_tree_t
    FLAGS: ENUM

REALIZE_DEGSEQ_METHOD:
    # Enum that describes the various methods for realizing a graph with an
    # arbitrary degree sequence
    CTYPE: igraph_realize_degseq_t
    FLAGS: ENUM

RECIP:
    # Enum that describes how the reciprocity of a graph should be calculated
    CTYPE: igraph_reciprocity_t
    FLAGS: ENUM

REWIRING_MODE:
    # Enum for the rewiring modes of igraph_rewire()
    CTYPE: igraph_rewiring_t
    FLAGS: ENUM

ROOTCHOICE:
    # Enum for the heuristic of igraph_roots_for_tree_layout()
    CTYPE: igraph_root_choice_t
    FLAGS: ENUM

RWSTUCK:
    # Enum that describes what igraph should do when a random walk gets stuck
    # in a sink vertex
    CTYPE: igraph_random_walk_stuck_t
    FLAGS: ENUM

SPINCOMMUPDATE:
    # Enum containing update modes for the spinglass community detection
    # algorithm
    CTYPE: igraph_spincomm_update_t
    FLAGS: ENUM

SPINGLASS_IMPLEMENTATION:
    # Enum that describes the various implementations of the spinglass community
    # detection algorithm
    CTYPE: igraph_spinglass_implementation_t
    FLAGS: ENUM

STAR_MODE:
    # Enum that describes how a star graph should be constructed
    CTYPE: igraph_star_mode_t
    FLAGS: ENUM

SUBGRAPH_IMPL:
    # Enum that describes how igraph should create an induced subgraph of a
    # graph
    CTYPE: igraph_subgraph_implementation_t
    FLAGS: ENUM

TODIRECTED:
    # Enum representing the possible ways to convert an undirected graph to a
    # directed one
    CTYPE: igraph_to_directed_t
    FLAGS: ENUM

TOUNDIRECTED:
    # Enum representing the possible ways to convert a directed graph to an
    # undirected one
    CTYPE: igraph_to_undirected_t
    FLAGS: ENUM

TRANSITIVITY_MODE:
    # Enum that specifies how isolated vertices should be handled in transitivity
    # calcuations
    CTYPE: igraph_transitivity_mode_t
    FLAGS: ENUM

TREE_MODE:
    # Enum that describes how a tree graph should be constructed
    CTYPE: igraph_tree_mode_t
    FLAGS: ENUM

VCONNNEI:
    # Enum specifying what to do in vertex connectivity tests when the two
    # vertices being tested are already connected
    CTYPE: igraph_vconn_nei_t
    FLAGS: ENUM

VORONOI_TIEBREAKER:
    # Enum specifying what to do when two vertices are at equal distance from
    # multiple generators while computing Voronoi partitionings
    CTYPE: igraph_voronoi_tiebreaker_t
    FLAGS: ENUM

WHEEL_MODE:
    # Enum that describes how a star graph should be constructed
    CTYPE: igraph_wheel_mode_t
    FLAGS: ENUM

###############################################################################
# Switches / flags / bits
###############################################################################

EDGE_TYPE_SW:
    # Flag bitfield that specifies what sort of edges are allowed in an
    # algorithm
    CTYPE: igraph_edge_type_sw_t
    FLAGS: BITS

WRITE_GML_SW:
    # Flag bitfield that specifies how to write GML files.
    CTYPE: igraph_write_gml_sw_t
    FLAGS: BITS

###############################################################################
# Callbacks
###############################################################################

ARPACKFUNC:
    # ARPACK matrix multiplication function.
    CTYPE: igraph_arpack_function_t

CLIQUE_FUNC:
    # Callback function for igraph_cliques_callback(). called with every clique
    # that was found by the function.
    CTYPE: igraph_clique_handler_t

BFS_FUNC:
    # Callback function for igraph_bfs(). Called with every vertex that was
    # visited during the BFS traversal.
    CTYPE: igraph_bfshandler_t

DFS_FUNC:
    # Callback function for igraph_dfs(). Called with every vertex that was
    # visited during the DFS traversal.
    CTYPE: igraph_dfshandler_t

ISOCOMPAT_FUNC:
    # Callback function for isomorphism algorithms that determines whether two
    # vertices are compatible or not.
    CTYPE: igraph_isocompat_t

ISOMORPHISM_FUNC:
    # Callback function that is called by isomorphism functions when an
    # isomorphism is found
    CTYPE: igraph_isohandler_t

LEVCFUNC:
    # Callback function for igraph_leading_eigenvector_community(). Called
    # after each eigenvalue / eigenvector calculation.
    CTYPE: igraph_community_leading_eigenvector_callback_t

###############################################################################
# Miscellaneous
###############################################################################

ARPACKOPT:
    # Structure that contains the options of the ARPACK eigensolver.
    CTYPE: igraph_arpack_options_t
    FLAGS: BY_REF

ARPACKSTORAGE:
    # Pointer to a general-purpose memory block that ARPACK-based algorithms
    # may use as a working area.
    CTYPE: igraph_arpack_storage_t
    FLAGS: BY_REF

ASTAR_HEURISTIC_FUNC:
    # A* heuristic function
    CTYPE: igraph_astar_heuristic_func_t

ATTRIBUTES:
    # An opaque data structure that a high-level interface may use to pass
    # information about graph/vertex/edge attributes to a low-level igraph
    # C function
    CTYPE: void
    FLAGS: BY_REF

BLISSINFO:
    # Struct holding information about the internal statistics of a single
    # run of the Bliss algorithm
    CTYPE: igraph_bliss_info_t

DRL_OPTIONS:
    # Structure containing the options of the DrL layout algorithm
    CTYPE: igraph_layout_drl_options_t
    FLAGS: BY_REF

EDGE_ATTRIBUTE_COMBINATION:
    # Structure specifying how the attributes of edges should be combined
    # during graph operations that may merge multiple edges into a single one
    CTYPE: igraph_attribute_combination_t
    FLAGS: BY_REF

EIGENWHICH:
    # Structure representing which eigenvalue(s) to use in the spectral embedding
    # algorithm
    CTYPE: igraph_eigen_which_t
    FLAGS: BY_REF

EXTRA:
    # Thunk argument that usually accompanies callback functions and can be used
    # to provide user-specific data or context to the callback function
    CTYPE: void
    FLAGS: BY_REF

HRG:
    # Structure storing a fitted hierarchical random graph model
    CTYPE: igraph_hrg_t
    FLAGS: BY_REF

MAXFLOW_STATS:
    # Structure storing statistics about a single run of a max-flow algorithm
    CTYPE: igraph_maxflow_stats_t
    FLAGS: BY_REF

PAGERANKOPT:
    # Enum that describes the PageRank options pointer, which is used only if
    # the PageRank implementation uses ARPACK
    CTYPE: igraph_arpack_options_t
    FLAGS: BY_REF

PLFIT:
    # Structure representing the result of a power-law fitting algorithms
    CTYPE: igraph_plfit_result_t
    FLAGS: BY_REF

VERTEX_ATTRIBUTE_COMBINATION:
    # Structure specifying how the attributes of vertices should be combined
    # during graph operations that may merge multiple vertices into a single one
    CTYPE: igraph_attribute_combination_t
    FLAGS: BY_REF
