/usr/include/igraph/igraph_sparsemat.h is in libigraph0-dev 0.7.1-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | /* -*- mode: C -*- */
/*
IGraph library.
Copyright (C) 2009-2012 Gabor Csardi <csardi.gabor@gmail.com>
334 Harvard street, Cambridge, MA 02139 USA
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
*/
#ifndef IGRAPH_SPARSEMAT_H
#define IGRAPH_SPARSEMAT_H
#include "igraph_types.h"
#include "igraph_vector.h"
#include "igraph_datatype.h"
#include "igraph_arpack.h"
#include <stdio.h>
struct cs_di_sparse;
struct cs_di_symbolic;
struct cs_di_numeric;
typedef struct {
struct cs_di_sparse *cs;
} igraph_sparsemat_t;
typedef struct {
struct cs_di_symbolic *symbolic;
} igraph_sparsemat_symbolic_t;
typedef struct {
struct cs_di_numeric *numeric;
} igraph_sparsemat_numeric_t;
typedef enum { IGRAPH_SPARSEMAT_TRIPLET,
IGRAPH_SPARSEMAT_CC } igraph_sparsemat_type_t;
typedef struct {
igraph_sparsemat_t *mat;
int pos;
int col;
} igraph_sparsemat_iterator_t;
int igraph_sparsemat_init(igraph_sparsemat_t *A, int rows, int cols, int nzmax);
int igraph_sparsemat_copy(igraph_sparsemat_t *to,
const igraph_sparsemat_t *from);
void igraph_sparsemat_destroy(igraph_sparsemat_t *A);
int igraph_sparsemat_realloc(igraph_sparsemat_t *A, int nzmax);
long int igraph_sparsemat_nrow(const igraph_sparsemat_t *A);
long int igraph_sparsemat_ncol(const igraph_sparsemat_t *B);
igraph_sparsemat_type_t igraph_sparsemat_type(const igraph_sparsemat_t *A);
igraph_bool_t igraph_sparsemat_is_triplet(const igraph_sparsemat_t *A);
igraph_bool_t igraph_sparsemat_is_cc(const igraph_sparsemat_t *A);
int igraph_sparsemat_permute(const igraph_sparsemat_t *A,
const igraph_vector_int_t *p,
const igraph_vector_int_t *q,
igraph_sparsemat_t *res);
int igraph_sparsemat_index(const igraph_sparsemat_t *A,
const igraph_vector_int_t *p,
const igraph_vector_int_t *q,
igraph_sparsemat_t *res,
igraph_real_t *constres);
int igraph_sparsemat_entry(igraph_sparsemat_t *A, int row, int col,
igraph_real_t elem);
int igraph_sparsemat_compress(const igraph_sparsemat_t *A,
igraph_sparsemat_t *res);
int igraph_sparsemat_transpose(const igraph_sparsemat_t *A,
igraph_sparsemat_t *res, int values);
igraph_bool_t igraph_sparsemat_is_symmetric(const igraph_sparsemat_t *A);
int igraph_sparsemat_dupl(igraph_sparsemat_t *A);
int igraph_sparsemat_fkeep(igraph_sparsemat_t *A,
int (*fkeep)(int, int, igraph_real_t, void*),
void *other);
int igraph_sparsemat_dropzeros(igraph_sparsemat_t *A);
int igraph_sparsemat_droptol(igraph_sparsemat_t *A, igraph_real_t tol);
int igraph_sparsemat_multiply(const igraph_sparsemat_t *A,
const igraph_sparsemat_t *B,
igraph_sparsemat_t *res);
int igraph_sparsemat_add(const igraph_sparsemat_t *A,
const igraph_sparsemat_t *B,
igraph_real_t alpha,
igraph_real_t beta,
igraph_sparsemat_t *res);
int igraph_sparsemat_gaxpy(const igraph_sparsemat_t *A,
const igraph_vector_t *x,
igraph_vector_t *res);
int igraph_sparsemat_lsolve(const igraph_sparsemat_t *A,
const igraph_vector_t *b,
igraph_vector_t *res);
int igraph_sparsemat_ltsolve(const igraph_sparsemat_t *A,
const igraph_vector_t *b,
igraph_vector_t *res);
int igraph_sparsemat_usolve(const igraph_sparsemat_t *A,
const igraph_vector_t *b,
igraph_vector_t *res);
int igraph_sparsemat_utsolve(const igraph_sparsemat_t *A,
const igraph_vector_t *b,
igraph_vector_t *res);
int igraph_sparsemat_cholsol(const igraph_sparsemat_t *A,
const igraph_vector_t *b,
igraph_vector_t *res,
int order);
int igraph_sparsemat_lusol(const igraph_sparsemat_t *A,
const igraph_vector_t *b,
igraph_vector_t *res,
int order,
igraph_real_t tol);
int igraph_sparsemat_print(const igraph_sparsemat_t *A,
FILE *outstream);
int igraph_sparsemat_eye(igraph_sparsemat_t *A, int n, int nzmax,
igraph_real_t value,
igraph_bool_t compress);
int igraph_sparsemat_diag(igraph_sparsemat_t *A, int nzmax,
const igraph_vector_t *values,
igraph_bool_t compress);
int igraph_sparsemat(igraph_t *graph, const igraph_sparsemat_t *A,
igraph_bool_t directed);
int igraph_weighted_sparsemat(igraph_t *graph, const igraph_sparsemat_t *A,
igraph_bool_t directed, const char *attr,
igraph_bool_t loops);
int igraph_get_sparsemat(const igraph_t *graph, igraph_sparsemat_t *res);
int igraph_matrix_as_sparsemat(igraph_sparsemat_t *res,
const igraph_matrix_t *mat,
igraph_real_t tol);
int igraph_sparsemat_as_matrix(igraph_matrix_t *res,
const igraph_sparsemat_t *spmat);
typedef enum { IGRAPH_SPARSEMAT_SOLVE_LU,
IGRAPH_SPARSEMAT_SOLVE_QR } igraph_sparsemat_solve_t;
int igraph_sparsemat_arpack_rssolve(const igraph_sparsemat_t *A,
igraph_arpack_options_t *options,
igraph_arpack_storage_t *storage,
igraph_vector_t *values,
igraph_matrix_t *vectors,
igraph_sparsemat_solve_t solvemethod);
int igraph_sparsemat_arpack_rnsolve(const igraph_sparsemat_t *A,
igraph_arpack_options_t *options,
igraph_arpack_storage_t *storage,
igraph_matrix_t *values,
igraph_matrix_t *vectors);
int igraph_sparsemat_lu(const igraph_sparsemat_t *A,
const igraph_sparsemat_symbolic_t *dis,
igraph_sparsemat_numeric_t *din, double tol);
int igraph_sparsemat_qr(const igraph_sparsemat_t *A,
const igraph_sparsemat_symbolic_t *dis,
igraph_sparsemat_numeric_t *din);
int igraph_sparsemat_luresol(const igraph_sparsemat_symbolic_t *dis,
const igraph_sparsemat_numeric_t *din,
const igraph_vector_t *b,
igraph_vector_t *res);
int igraph_sparsemat_qrresol(const igraph_sparsemat_symbolic_t *dis,
const igraph_sparsemat_numeric_t *din,
const igraph_vector_t *b,
igraph_vector_t *res);
int igraph_sparsemat_symbqr(long int order, const igraph_sparsemat_t *A,
igraph_sparsemat_symbolic_t *dis);
int igraph_sparsemat_symblu(long int order, const igraph_sparsemat_t *A,
igraph_sparsemat_symbolic_t *dis);
void igraph_sparsemat_symbolic_destroy(igraph_sparsemat_symbolic_t *dis);
void igraph_sparsemat_numeric_destroy(igraph_sparsemat_numeric_t *din);
igraph_real_t igraph_sparsemat_max(igraph_sparsemat_t *A);
igraph_real_t igraph_sparsemat_min(igraph_sparsemat_t *A);
int igraph_sparsemat_minmax(igraph_sparsemat_t *A,
igraph_real_t *min, igraph_real_t *max);
long int igraph_sparsemat_count_nonzero(igraph_sparsemat_t *A);
long int igraph_sparsemat_count_nonzerotol(igraph_sparsemat_t *A,
igraph_real_t tol);
int igraph_sparsemat_rowsums(const igraph_sparsemat_t *A,
igraph_vector_t *res);
int igraph_sparsemat_colsums(const igraph_sparsemat_t *A,
igraph_vector_t *res);
int igraph_sparsemat_scale(igraph_sparsemat_t *A, igraph_real_t by);
int igraph_sparsemat_add_rows(igraph_sparsemat_t *A, long int n);
int igraph_sparsemat_add_cols(igraph_sparsemat_t *A, long int n);
int igraph_sparsemat_resize(igraph_sparsemat_t *A, long int nrow,
long int ncol, int nzmax);
int igraph_sparsemat_nonzero_storage(const igraph_sparsemat_t *A);
int igraph_sparsemat_getelements(const igraph_sparsemat_t *A,
igraph_vector_int_t *i,
igraph_vector_int_t *j,
igraph_vector_t *x);
int igraph_sparsemat_getelements_sorted(const igraph_sparsemat_t *A,
igraph_vector_int_t *i,
igraph_vector_int_t *j,
igraph_vector_t *x);
int igraph_sparsemat_scale_rows(igraph_sparsemat_t *A,
const igraph_vector_t *fact);
int igraph_sparsemat_scale_cols(igraph_sparsemat_t *A,
const igraph_vector_t *fact);
int igraph_sparsemat_multiply_by_dense(const igraph_sparsemat_t *A,
const igraph_matrix_t *B,
igraph_matrix_t *res);
int igraph_sparsemat_dense_multiply(const igraph_matrix_t *A,
const igraph_sparsemat_t *B,
igraph_matrix_t *res);
int igraph_i_sparsemat_view(igraph_sparsemat_t *A, int nzmax, int m, int n,
int *p, int *i, double *x, int nz);
int igraph_sparsemat_sort(const igraph_sparsemat_t *A,
igraph_sparsemat_t *sorted);
int igraph_sparsemat_nzmax(const igraph_sparsemat_t *A);
int igraph_sparsemat_neg(igraph_sparsemat_t *A);
int igraph_sparsemat_iterator_init(igraph_sparsemat_iterator_t *it,
igraph_sparsemat_t *sparsemat);
int igraph_sparsemat_iterator_reset(igraph_sparsemat_iterator_t *it);
igraph_bool_t
igraph_sparsemat_iterator_end(const igraph_sparsemat_iterator_t *it);
int igraph_sparsemat_iterator_row(const igraph_sparsemat_iterator_t *it);
int igraph_sparsemat_iterator_col(const igraph_sparsemat_iterator_t *it);
int igraph_sparsemat_iterator_idx(const igraph_sparsemat_iterator_t *it);
igraph_real_t
igraph_sparsemat_iterator_get(const igraph_sparsemat_iterator_t *it);
int igraph_sparsemat_iterator_next(igraph_sparsemat_iterator_t *it);
#endif
|