1 /* -*- mode: C -*- */ 2 /* 3 IGraph library. 4 Copyright (C) 2009-2012 Gabor Csardi <csardi.gabor@gmail.com> 5 334 Harvard street, Cambridge, MA 02139 USA 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2 of the License, or 10 (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; if not, write to the Free Software 19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 20 02110-1301 USA 21 22 */ 23 24 #ifndef IGRAPH_CONSTANTS_H 25 #define IGRAPH_CONSTANTS_H 26 27 #include "igraph_decls.h" 28 #include "igraph_types.h" 29 #include "igraph_datatype.h" 30 31 __BEGIN_DECLS 32 33 /* -------------------------------------------------- */ 34 /* Constants */ 35 /* -------------------------------------------------- */ 36 37 typedef enum { IGRAPH_UNDIRECTED = 0, IGRAPH_DIRECTED = 1 } igraph_i_directed_t; 38 39 /* Note for the enum below: yes, IGRAPH_LOOPS_TWICE is 1, and IGRAPH_LOOPS_ONCE 40 * is 2. This is intentional, for the sake of backwards compatibility with 41 * earlier versions where we only had IGRAPH_LOOPS and it meant 42 * IGRAPH_LOOPS_TWICE */ 43 typedef enum { IGRAPH_NO_LOOPS = 0, IGRAPH_LOOPS = 1, IGRAPH_LOOPS_TWICE = 1, IGRAPH_LOOPS_ONCE = 2 } igraph_loops_t; 44 45 typedef enum { IGRAPH_NO_MULTIPLE = 0, IGRAPH_MULTIPLE = 1 } igraph_multiple_t; 46 47 typedef enum { IGRAPH_ASCENDING = 0, IGRAPH_DESCENDING = 1 } igraph_order_t; 48 49 typedef enum { IGRAPH_MINIMUM = 0, IGRAPH_MAXIMUM = 1 } igraph_optimal_t; 50 51 typedef enum { IGRAPH_OUT = 1, IGRAPH_IN = 2, IGRAPH_ALL = 3, 52 IGRAPH_TOTAL = 3 53 } igraph_neimode_t; 54 55 typedef enum { IGRAPH_WEAK = 1, IGRAPH_STRONG = 2 } igraph_connectedness_t; 56 57 typedef enum { IGRAPH_RECIPROCITY_DEFAULT = 0, 58 IGRAPH_RECIPROCITY_RATIO = 1 59 } igraph_reciprocity_t; 60 61 typedef enum { IGRAPH_ADJ_DIRECTED = 0, 62 IGRAPH_ADJ_UNDIRECTED = 1, IGRAPH_ADJ_MAX = 1, 63 IGRAPH_ADJ_UPPER, IGRAPH_ADJ_LOWER, IGRAPH_ADJ_MIN, 64 IGRAPH_ADJ_PLUS 65 } igraph_adjacency_t; 66 67 typedef enum { IGRAPH_STAR_OUT = 0, IGRAPH_STAR_IN, 68 IGRAPH_STAR_UNDIRECTED, 69 IGRAPH_STAR_MUTUAL 70 } igraph_star_mode_t; 71 72 typedef enum { IGRAPH_TREE_OUT = 0, IGRAPH_TREE_IN, 73 IGRAPH_TREE_UNDIRECTED 74 } igraph_tree_mode_t; 75 76 typedef enum { IGRAPH_ERDOS_RENYI_GNP = 0, 77 IGRAPH_ERDOS_RENYI_GNM 78 } igraph_erdos_renyi_t; 79 80 typedef enum { IGRAPH_GET_ADJACENCY_UPPER = 0, 81 IGRAPH_GET_ADJACENCY_LOWER, 82 IGRAPH_GET_ADJACENCY_BOTH 83 } igraph_get_adjacency_t; 84 85 typedef enum { IGRAPH_DEGSEQ_SIMPLE = 0, 86 IGRAPH_DEGSEQ_VL, 87 IGRAPH_DEGSEQ_SIMPLE_NO_MULTIPLE, 88 IGRAPH_DEGSEQ_SIMPLE_NO_MULTIPLE_UNIFORM 89 } igraph_degseq_t; 90 91 typedef enum { IGRAPH_REALIZE_DEGSEQ_SMALLEST = 0, 92 IGRAPH_REALIZE_DEGSEQ_LARGEST, 93 IGRAPH_REALIZE_DEGSEQ_INDEX 94 } igraph_realize_degseq_t; 95 96 typedef enum { IGRAPH_RANDOM_TREE_PRUFER = 0, 97 IGRAPH_RANDOM_TREE_LERW 98 } igraph_random_tree_t; 99 100 typedef enum { IGRAPH_FILEFORMAT_EDGELIST = 0, 101 IGRAPH_FILEFORMAT_NCOL, 102 IGRAPH_FILEFORMAT_PAJEK, 103 IGRAPH_FILEFORMAT_LGL, 104 IGRAPH_FILEFORMAT_GRAPHML 105 } igraph_fileformat_type_t; 106 107 typedef enum { IGRAPH_REWIRING_SIMPLE = 0, 108 IGRAPH_REWIRING_SIMPLE_LOOPS 109 } igraph_rewiring_t; 110 111 typedef enum { IGRAPH_EDGEORDER_ID = 0, 112 IGRAPH_EDGEORDER_FROM, 113 IGRAPH_EDGEORDER_TO 114 } igraph_edgeorder_type_t; 115 116 typedef enum { IGRAPH_TO_DIRECTED_ARBITRARY = 0, 117 IGRAPH_TO_DIRECTED_MUTUAL, 118 IGRAPH_TO_DIRECTED_RANDOM, 119 IGRAPH_TO_DIRECTED_ACYCLIC 120 } igraph_to_directed_t; 121 122 typedef enum { IGRAPH_TO_UNDIRECTED_EACH = 0, 123 IGRAPH_TO_UNDIRECTED_COLLAPSE, 124 IGRAPH_TO_UNDIRECTED_MUTUAL 125 } igraph_to_undirected_t; 126 127 typedef enum { IGRAPH_VCONN_NEI_ERROR = 0, 128 IGRAPH_VCONN_NEI_NUMBER_OF_NODES, 129 IGRAPH_VCONN_NEI_IGNORE, 130 IGRAPH_VCONN_NEI_NEGATIVE 131 } igraph_vconn_nei_t; 132 133 typedef enum { IGRAPH_SPINCOMM_UPDATE_SIMPLE = 0, 134 IGRAPH_SPINCOMM_UPDATE_CONFIG 135 } igraph_spincomm_update_t; 136 137 typedef enum { IGRAPH_DONT_SIMPLIFY = 0, 138 IGRAPH_SIMPLIFY 139 } igraph_lazy_adlist_simplify_t; 140 141 typedef enum { IGRAPH_TRANSITIVITY_NAN = 0, 142 IGRAPH_TRANSITIVITY_ZERO 143 } igraph_transitivity_mode_t; 144 145 typedef enum { IGRAPH_SPINCOMM_IMP_ORIG = 0, 146 IGRAPH_SPINCOMM_IMP_NEG 147 } igraph_spinglass_implementation_t; 148 149 typedef enum { IGRAPH_COMMCMP_VI = 0, 150 IGRAPH_COMMCMP_NMI, 151 IGRAPH_COMMCMP_SPLIT_JOIN, 152 IGRAPH_COMMCMP_RAND, 153 IGRAPH_COMMCMP_ADJUSTED_RAND 154 } igraph_community_comparison_t; 155 156 typedef enum { IGRAPH_ADD_WEIGHTS_NO = 0, 157 IGRAPH_ADD_WEIGHTS_YES, 158 IGRAPH_ADD_WEIGHTS_IF_PRESENT 159 } igraph_add_weights_t; 160 161 typedef enum { IGRAPH_BARABASI_BAG = 0, 162 IGRAPH_BARABASI_PSUMTREE, 163 IGRAPH_BARABASI_PSUMTREE_MULTIPLE 164 } igraph_barabasi_algorithm_t; 165 166 typedef enum { IGRAPH_FAS_EXACT_IP = 0, 167 IGRAPH_FAS_APPROX_EADES 168 } igraph_fas_algorithm_t; 169 170 typedef enum { IGRAPH_SUBGRAPH_AUTO = 0, 171 IGRAPH_SUBGRAPH_COPY_AND_DELETE, 172 IGRAPH_SUBGRAPH_CREATE_FROM_SCRATCH 173 } igraph_subgraph_implementation_t; 174 175 typedef enum { IGRAPH_IMITATE_AUGMENTED = 0, 176 IGRAPH_IMITATE_BLIND, 177 IGRAPH_IMITATE_CONTRACTED 178 } igraph_imitate_algorithm_t; 179 180 typedef igraph_real_t igraph_scalar_function_t(const igraph_vector_t *var, 181 const igraph_vector_t *par, 182 void* extra); 183 typedef void igraph_vector_function_t(const igraph_vector_t *var, 184 const igraph_vector_t *par, 185 igraph_vector_t* res, void* extra); 186 187 typedef enum { IGRAPH_LAYOUT_GRID = 0, 188 IGRAPH_LAYOUT_NOGRID, 189 IGRAPH_LAYOUT_AUTOGRID 190 } igraph_layout_grid_t; 191 192 typedef enum { IGRAPH_RANDOM_WALK_STUCK_ERROR = 0, 193 IGRAPH_RANDOM_WALK_STUCK_RETURN 194 } igraph_random_walk_stuck_t; 195 196 197 __END_DECLS 198 199 #endif 200