Graphviz  2.41.20170921.2350
Data Structures | Macros | Typedefs | Enumerations | Functions
SparseMatrix.h File Reference
#include <general.h>
#include <stdio.h>
Include dependency graph for SparseMatrix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SparseMatrix_struct
 

Macros

#define SYMMETRY_EPSILON   0.0000001
 
#define SparseMatrix_set_undirected(A)   set_flag((A)->property, MATRIX_UNDIRECTED)
 
#define SparseMatrix_set_symmetric(A)   set_flag((A)->property, MATRIX_SYMMETRIC)
 
#define SparseMatrix_set_pattern_symmetric(A)   set_flag((A)->property, MATRIX_PATTERN_SYMMETRIC)
 
#define SparseMatrix_set_skew(A)   set_flag((A)->property, MATRIX_SKEW)
 
#define SparseMatrix_set_hemitian(A)   set_flag((A)->property, MATRIX_HERMITIAN)
 
#define SparseMatrix_clear_undirected(A)   clear_flag((A)->property, MATRIX_UNDIRECTED)
 
#define SparseMatrix_clear_symmetric(A)   clear_flag((A)->property, MATRIX_SYMMETRIC)
 
#define SparseMatrix_clear_pattern_symmetric(A)   clear_flag((A)->property, MATRIX_PATTERN_SYMMETRIC)
 
#define SparseMatrix_clear_skew(A)   clear_flag((A)->property, MATRIX_SKEW)
 
#define SparseMatrix_clear_hemitian(A)   clear_flag((A)->property, MATRIX_HERMITIAN)
 
#define SparseMatrix_known_undirected(A)   test_flag((A)->property, MATRIX_UNDIRECTED)
 
#define SparseMatrix_known_symmetric(A)   test_flag((A)->property, MATRIX_SYMMETRIC)
 
#define SparseMatrix_known_strucural_symmetric(A)   test_flag((A)->property, MATRIX_PATTERN_SYMMETRIC)
 
#define SparseMatrix_known_skew(A)   test_flag((A)->property, MATRIX_SKEW)
 
#define SparseMatrix_known_hemitian(A)   test_flag((A)->property, MATRIX_HERMITIAN)
 

Typedefs

typedef struct
SparseMatrix_struct
SparseMatrix
 

Enumerations

enum  { FORMAT_CSC, FORMAT_CSR, FORMAT_COORD }
 
enum  { UNMASKED = -10, MASKED = 1 }
 
enum  {
  MATRIX_PATTERN_SYMMETRIC = 1<<0, MATRIX_SYMMETRIC = 1<<1, MATRIX_SKEW = 1<<2, MATRIX_HERMITIAN = 1<<3,
  MATRIX_UNDIRECTED = 1<<4
}
 
enum  { BIPARTITE_RECT = 0, BIPARTITE_PATTERN_UNSYM, BIPARTITE_UNSYM, BIPARTITE_ALWAYS }
 
enum  {
  MATRIX_TYPE_REAL = 1<<0, MATRIX_TYPE_COMPLEX = 1<<1, MATRIX_TYPE_INTEGER = 1<<2, MATRIX_TYPE_PATTERN = 1<<3,
  MATRIX_TYPE_UNKNOWN = 1<<4
}
 
enum  {
  SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART,
  SUM_IMGINARY_KEEP_LAST_REAL
}
 

Functions

SparseMatrix SparseMatrix_new (int m, int n, int nz, int type, int format)
 
SparseMatrix SparseMatrix_general_new (int m, int n, int nz, int type, size_t sz, int format)
 
SparseMatrix SparseMatrix_from_coordinate_format (SparseMatrix A)
 
SparseMatrix SparseMatrix_from_coordinate_format_not_compacted (SparseMatrix A, int what_to_sum)
 
SparseMatrix SparseMatrix_from_coordinate_arrays (int nz, int m, int n, int *irn, int *jcn, void *val, int type, size_t sz)
 
SparseMatrix SparseMatrix_from_coordinate_arrays_not_compacted (int nz, int m, int n, int *irn, int *jcn, void *val, int type, size_t sz, int what_to_sum)
 
void SparseMatrix_print (char *, SparseMatrix A)
 
void SparseMatrix_export (FILE *f, SparseMatrix A)
 
SparseMatrix SparseMatrix_import_binary (char *name)
 
SparseMatrix SparseMatrix_import_binary_fp (FILE *f)
 
void SparseMatrix_export_binary (char *name, SparseMatrix A, int *flag)
 
void SparseMatrix_export_binary_fp (FILE *f, SparseMatrix A)
 
void SparseMatrix_delete (SparseMatrix A)
 
SparseMatrix SparseMatrix_add (SparseMatrix A, SparseMatrix B)
 
SparseMatrix SparseMatrix_multiply (SparseMatrix A, SparseMatrix B)
 
SparseMatrix SparseMatrix_multiply3 (SparseMatrix A, SparseMatrix B, SparseMatrix C)
 
SparseMatrix SparseMatrix_sum_repeat_entries (SparseMatrix A, int what_to_sum)
 
SparseMatrix SparseMatrix_coordinate_form_add_entries (SparseMatrix A, int nentries, int *irn, int *jcn, void *val)
 
int SparseMatrix_is_symmetric (SparseMatrix A, int test_pattern_symmetry_only)
 
SparseMatrix SparseMatrix_transpose (SparseMatrix A)
 
SparseMatrix SparseMatrix_symmetrize (SparseMatrix A, int pattern_symmetric_only)
 
SparseMatrix SparseMatrix_symmetrize_nodiag (SparseMatrix A, int pattern_symmetric_only)
 
void SparseMatrix_multiply_vector (SparseMatrix A, real *v, real **res, int transposed)
 
SparseMatrix SparseMatrix_remove_diagonal (SparseMatrix A)
 
SparseMatrix SparseMatrix_remove_upper (SparseMatrix A)
 
SparseMatrix SparseMatrix_divide_row_by_degree (SparseMatrix A)
 
SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized (SparseMatrix A)
 
SparseMatrix SparseMatrix_normalize_to_rowsum1 (SparseMatrix A)
 
void SparseMatrix_multiply_dense (SparseMatrix A, int ATranspose, real *v, int vTransposed, real **res, int res_transpose, int dim)
 
SparseMatrix SparseMatrix_apply_fun (SparseMatrix A, double(*fun)(double x))
 
SparseMatrix SparseMatrix_apply_fun_general (SparseMatrix A, void(*fun)(int i, int j, int n, double *x))
 
SparseMatrix SparseMatrix_copy (SparseMatrix A)
 
int SparseMatrix_has_diagonal (SparseMatrix A)
 
SparseMatrix SparseMatrix_normalize_by_row (SparseMatrix A)
 
SparseMatrix SparseMatrix_crop (SparseMatrix A, real epsilon)
 
SparseMatrix SparseMatrix_scaled_by_vector (SparseMatrix A, real *v, int apply_to_row)
 
SparseMatrix SparseMatrix_multiply_by_scaler (SparseMatrix A, real s)
 
SparseMatrix SparseMatrix_make_undirected (SparseMatrix A)
 
int SparseMatrix_connectedQ (SparseMatrix A)
 
real SparseMatrix_pseudo_diameter_only (SparseMatrix A)
 
real SparseMatrix_pseudo_diameter_weighted (SparseMatrix A0, int root, int aggressive, int *end1, int *end2, int *connectedQ)
 
real SparseMatrix_pseudo_diameter_unweighted (SparseMatrix A0, int root, int aggressive, int *end1, int *end2, int *connectedQ)
 
void SparseMatrix_level_sets (SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reintialize_mask)
 
void SparseMatrix_level_sets_khops (int khops, SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reintialize_mask)
 
void SparseMatrix_weakly_connected_components (SparseMatrix A0, int *ncomp, int **comps, int **comps_ptr)
 
void SparseMatrix_decompose_to_supervariables (SparseMatrix A, int *ncluster, int **cluster, int **clusterp)
 
SparseMatrix SparseMatrix_get_submatrix (SparseMatrix A, int nrow, int ncol, int *rindices, int *cindices)
 
SparseMatrix SparseMatrix_exclude_submatrix (SparseMatrix A, int nrow, int ncol, int *rindices, int *cindices)
 
SparseMatrix SparseMatrix_get_augmented (SparseMatrix A)
 
SparseMatrix SparseMatrix_to_square_matrix (SparseMatrix A, int bipartite_options)
 
SparseMatrix SparseMatrix_largest_component (SparseMatrix A)
 
SparseMatrix SparseMatrix_delete_empty_columns (SparseMatrix A, int **new2old, int *nnew, int inplace)
 
SparseMatrix SparseMatrix_delete_sparse_columns (SparseMatrix A, int threshold, int **new2old, int *nnew, int inplace)
 
SparseMatrix SparseMatrix_sort (SparseMatrix A)
 
SparseMatrix SparseMatrix_set_entries_to_real_one (SparseMatrix A)
 
SparseMatrix SparseMatrix_complement (SparseMatrix A, int undirected)
 
int SparseMatrix_k_centers (SparseMatrix D, int weighted, int K, int root, int **centers, int centering, real **dist)
 
int SparseMatrix_k_centers_user (SparseMatrix D, int weighted, int K, int *centers_user, int centering, real **dist)
 
SparseMatrix SparseMatrix_distance_matrix_k_centers (int K, SparseMatrix D, int weighted)
 
int SparseMatrix_distance_matrix (SparseMatrix A, int weighted, real **dist_matrix)
 
SparseMatrix SparseMatrix_distance_matrix_khops (int khops, SparseMatrix A, int weighted)
 
void SparseMatrix_kcoreness (SparseMatrix A, int **coreness)
 
void SparseMatrix_kcore_decomposition (SparseMatrix A, int *coreness_max0, int **coreness_ptr0, int **coreness_list0)
 
void SparseMatrix_khairness (SparseMatrix A, int **hairness)
 
void SparseMatrix_khair_decomposition (SparseMatrix A, int *hairness_max0, int **hairness_ptr0, int **hairness_list0)
 
SparseMatrix SparseMatrix_from_dense (int m, int n, real *x)
 
void SparseMatrix_page_rank (SparseMatrix A, real teleport_probablity, int weighted, real epsilon, real **page_rank)
 

Macro Definition Documentation

#define SparseMatrix_clear_hemitian (   A)    clear_flag((A)->property, MATRIX_HERMITIAN)

Definition at line 172 of file SparseMatrix.h.

#define SparseMatrix_clear_pattern_symmetric (   A)    clear_flag((A)->property, MATRIX_PATTERN_SYMMETRIC)

Definition at line 170 of file SparseMatrix.h.

#define SparseMatrix_clear_skew (   A)    clear_flag((A)->property, MATRIX_SKEW)

Definition at line 171 of file SparseMatrix.h.

#define SparseMatrix_clear_symmetric (   A)    clear_flag((A)->property, MATRIX_SYMMETRIC)

Definition at line 169 of file SparseMatrix.h.

#define SparseMatrix_clear_undirected (   A)    clear_flag((A)->property, MATRIX_UNDIRECTED)

Definition at line 168 of file SparseMatrix.h.

#define SparseMatrix_known_hemitian (   A)    test_flag((A)->property, MATRIX_HERMITIAN)

Definition at line 179 of file SparseMatrix.h.

#define SparseMatrix_known_skew (   A)    test_flag((A)->property, MATRIX_SKEW)

Definition at line 178 of file SparseMatrix.h.

#define SparseMatrix_known_strucural_symmetric (   A)    test_flag((A)->property, MATRIX_PATTERN_SYMMETRIC)

Definition at line 177 of file SparseMatrix.h.

Referenced by SparseMatrix_is_symmetric().

#define SparseMatrix_known_symmetric (   A)    test_flag((A)->property, MATRIX_SYMMETRIC)

Definition at line 176 of file SparseMatrix.h.

Referenced by SparseMatrix_is_symmetric().

#define SparseMatrix_known_undirected (   A)    test_flag((A)->property, MATRIX_UNDIRECTED)

Definition at line 175 of file SparseMatrix.h.

Referenced by makeDotGraph().

#define SparseMatrix_set_hemitian (   A)    set_flag((A)->property, MATRIX_HERMITIAN)

Definition at line 165 of file SparseMatrix.h.

#define SparseMatrix_set_pattern_symmetric (   A)    set_flag((A)->property, MATRIX_PATTERN_SYMMETRIC)
#define SparseMatrix_set_skew (   A)    set_flag((A)->property, MATRIX_SKEW)

Definition at line 164 of file SparseMatrix.h.

#define SparseMatrix_set_symmetric (   A)    set_flag((A)->property, MATRIX_SYMMETRIC)
#define SparseMatrix_set_undirected (   A)    set_flag((A)->property, MATRIX_UNDIRECTED)

Definition at line 161 of file SparseMatrix.h.

Referenced by SparseMatrix_make_undirected().

#define SYMMETRY_EPSILON   0.0000001

Definition at line 19 of file SparseMatrix.h.

Referenced by SparseMatrix_is_symmetric().

Typedef Documentation

Definition at line 40 of file SparseMatrix.h.

Enumeration Type Documentation

anonymous enum
Enumerator
FORMAT_CSC 
FORMAT_CSR 
FORMAT_COORD 

Definition at line 20 of file SparseMatrix.h.

anonymous enum
Enumerator
UNMASKED 
MASKED 

Definition at line 21 of file SparseMatrix.h.

anonymous enum
Enumerator
MATRIX_PATTERN_SYMMETRIC 
MATRIX_SYMMETRIC 
MATRIX_SKEW 
MATRIX_HERMITIAN 
MATRIX_UNDIRECTED 

Definition at line 22 of file SparseMatrix.h.

anonymous enum
Enumerator
BIPARTITE_RECT 
BIPARTITE_PATTERN_UNSYM 
BIPARTITE_UNSYM 
BIPARTITE_ALWAYS 

Definition at line 23 of file SparseMatrix.h.

anonymous enum
Enumerator
MATRIX_TYPE_REAL 
MATRIX_TYPE_COMPLEX 
MATRIX_TYPE_INTEGER 
MATRIX_TYPE_PATTERN 
MATRIX_TYPE_UNKNOWN 

Definition at line 42 of file SparseMatrix.h.

anonymous enum
Enumerator
SUM_REPEATED_NONE 
SUM_REPEATED_ALL 
SUM_REPEATED_REAL_PART 
SUM_REPEATED_IMAGINARY_PART 
SUM_IMGINARY_KEEP_LAST_REAL 

Definition at line 82 of file SparseMatrix.h.

Function Documentation

SparseMatrix SparseMatrix_add ( SparseMatrix  A,
SparseMatrix  B 
)
SparseMatrix SparseMatrix_apply_fun ( SparseMatrix  A,
double(*)(double x)  fun 
)
SparseMatrix SparseMatrix_apply_fun_general ( SparseMatrix  A,
void(*)(int i, int j, int n, double *x)  fun 
)
SparseMatrix SparseMatrix_complement ( SparseMatrix  A,
int  undirected 
)
int SparseMatrix_connectedQ ( SparseMatrix  A)
SparseMatrix SparseMatrix_coordinate_form_add_entries ( SparseMatrix  A,
int  nentries,
int irn,
int jcn,
void *  val 
)
SparseMatrix SparseMatrix_copy ( SparseMatrix  A)
SparseMatrix SparseMatrix_crop ( SparseMatrix  A,
real  epsilon 
)
void SparseMatrix_decompose_to_supervariables ( SparseMatrix  A,
int ncluster,
int **  cluster,
int **  clusterp 
)
void SparseMatrix_delete ( SparseMatrix  A)
SparseMatrix SparseMatrix_delete_empty_columns ( SparseMatrix  A,
int **  new2old,
int nnew,
int  inplace 
)

Definition at line 3314 of file SparseMatrix.c.

References SparseMatrix_delete_sparse_columns().

SparseMatrix SparseMatrix_delete_sparse_columns ( SparseMatrix  A,
int  threshold,
int **  new2old,
int nnew,
int  inplace 
)
int SparseMatrix_distance_matrix ( SparseMatrix  A,
int  weighted,
real **  dist_matrix 
)
SparseMatrix SparseMatrix_distance_matrix_k_centers ( int  K,
SparseMatrix  D,
int  weighted 
)
SparseMatrix SparseMatrix_distance_matrix_khops ( int  khops,
SparseMatrix  A,
int  weighted 
)
SparseMatrix SparseMatrix_divide_row_by_degree ( SparseMatrix  A)
SparseMatrix SparseMatrix_exclude_submatrix ( SparseMatrix  A,
int  nrow,
int  ncol,
int rindices,
int cindices 
)
void SparseMatrix_export ( FILE *  f,
SparseMatrix  A 
)

Definition at line 778 of file SparseMatrix.c.

References assert, SparseMatrix_struct::format, FORMAT_COORD, FORMAT_CSC, and FORMAT_CSR.

void SparseMatrix_export_binary ( char *  name,
SparseMatrix  A,
int flag 
)

Definition at line 646 of file SparseMatrix.c.

References SparseMatrix_export_binary_fp().

void SparseMatrix_export_binary_fp ( FILE *  f,
SparseMatrix  A 
)
SparseMatrix SparseMatrix_from_coordinate_arrays ( int  nz,
int  m,
int  n,
int irn,
int jcn,
void *  val,
int  type,
size_t  sz 
)
SparseMatrix SparseMatrix_from_coordinate_arrays_not_compacted ( int  nz,
int  m,
int  n,
int irn,
int jcn,
void *  val,
int  type,
size_t  sz,
int  what_to_sum 
)

Definition at line 962 of file SparseMatrix.c.

Referenced by SparseMatrix_from_coordinate_format_not_compacted().

SparseMatrix SparseMatrix_from_coordinate_format ( SparseMatrix  A)
SparseMatrix SparseMatrix_from_coordinate_format_not_compacted ( SparseMatrix  A,
int  what_to_sum 
)
SparseMatrix SparseMatrix_from_dense ( int  m,
int  n,
real x 
)
SparseMatrix SparseMatrix_general_new ( int  m,
int  n,
int  nz,
int  type,
size_t  sz,
int  format 
)

Definition at line 397 of file SparseMatrix.c.

Referenced by SparseMatrix_copy(), and SparseMatrix_import_binary_fp().

SparseMatrix SparseMatrix_get_augmented ( SparseMatrix  A)
SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized ( SparseMatrix  A)
SparseMatrix SparseMatrix_get_submatrix ( SparseMatrix  A,
int  nrow,
int  ncol,
int rindices,
int cindices 
)
int SparseMatrix_has_diagonal ( SparseMatrix  A)
SparseMatrix SparseMatrix_import_binary ( char *  name)

Definition at line 707 of file SparseMatrix.c.

References NULL, and SparseMatrix_import_binary_fp().

SparseMatrix SparseMatrix_import_binary_fp ( FILE *  f)
int SparseMatrix_is_symmetric ( SparseMatrix  A,
int  test_pattern_symmetry_only 
)
int SparseMatrix_k_centers ( SparseMatrix  D,
int  weighted,
int  K,
int  root,
int **  centers,
int  centering,
real **  dist 
)
int SparseMatrix_k_centers_user ( SparseMatrix  D,
int  weighted,
int  K,
int centers_user,
int  centering,
real **  dist 
)
void SparseMatrix_kcore_decomposition ( SparseMatrix  A,
int coreness_max0,
int **  coreness_ptr0,
int **  coreness_list0 
)
void SparseMatrix_kcoreness ( SparseMatrix  A,
int **  coreness 
)
void SparseMatrix_khair_decomposition ( SparseMatrix  A,
int hairness_max0,
int **  hairness_ptr0,
int **  hairness_list0 
)
void SparseMatrix_khairness ( SparseMatrix  A,
int **  hairness 
)
SparseMatrix SparseMatrix_largest_component ( SparseMatrix  A)
void SparseMatrix_level_sets ( SparseMatrix  A,
int  root,
int nlevel,
int **  levelset_ptr,
int **  levelset,
int **  mask,
int  reintialize_mask 
)
void SparseMatrix_level_sets_khops ( int  khops,
SparseMatrix  A,
int  root,
int nlevel,
int **  levelset_ptr,
int **  levelset,
int **  mask,
int  reintialize_mask 
)

Definition at line 2552 of file SparseMatrix.c.

References SparseMatrix_level_sets_internal().

Referenced by SparseMatrix_distance_matrix_khops().

SparseMatrix SparseMatrix_make_undirected ( SparseMatrix  A)
SparseMatrix SparseMatrix_multiply ( SparseMatrix  A,
SparseMatrix  B 
)
SparseMatrix SparseMatrix_multiply3 ( SparseMatrix  A,
SparseMatrix  B,
SparseMatrix  C 
)
SparseMatrix SparseMatrix_multiply_by_scaler ( SparseMatrix  A,
real  s 
)
void SparseMatrix_multiply_dense ( SparseMatrix  A,
int  ATranspose,
real v,
int  vTransposed,
real **  res,
int  res_transpose,
int  dim 
)

Definition at line 1192 of file SparseMatrix.c.

Referenced by StressMajorizationSmoother_smooth().

void SparseMatrix_multiply_vector ( SparseMatrix  A,
real v,
real **  res,
int  transposed 
)
SparseMatrix SparseMatrix_new ( int  m,
int  n,
int  nz,
int  type,
int  format 
)
SparseMatrix SparseMatrix_normalize_by_row ( SparseMatrix  A)
SparseMatrix SparseMatrix_normalize_to_rowsum1 ( SparseMatrix  A)
void SparseMatrix_page_rank ( SparseMatrix  A,
real  teleport_probablity,
int  weighted,
real  epsilon,
real **  page_rank 
)
void SparseMatrix_print ( char *  ,
SparseMatrix  A 
)
real SparseMatrix_pseudo_diameter_only ( SparseMatrix  A)

Definition at line 2849 of file SparseMatrix.c.

References FALSE, and SparseMatrix_pseudo_diameter_unweighted().

real SparseMatrix_pseudo_diameter_unweighted ( SparseMatrix  A0,
int  root,
int  aggressive,
int end1,
int end2,
int connectedQ 
)
real SparseMatrix_pseudo_diameter_weighted ( SparseMatrix  A0,
int  root,
int  aggressive,
int end1,
int end2,
int connectedQ 
)
SparseMatrix SparseMatrix_remove_diagonal ( SparseMatrix  A)
SparseMatrix SparseMatrix_remove_upper ( SparseMatrix  A)
SparseMatrix SparseMatrix_scaled_by_vector ( SparseMatrix  A,
real v,
int  apply_to_row 
)
SparseMatrix SparseMatrix_set_entries_to_real_one ( SparseMatrix  A)
SparseMatrix SparseMatrix_sort ( SparseMatrix  A)

Definition at line 54 of file SparseMatrix.c.

References SparseMatrix_delete(), and SparseMatrix_transpose().

SparseMatrix SparseMatrix_sum_repeat_entries ( SparseMatrix  A,
int  what_to_sum 
)
SparseMatrix SparseMatrix_symmetrize ( SparseMatrix  A,
int  pattern_symmetric_only 
)
SparseMatrix SparseMatrix_symmetrize_nodiag ( SparseMatrix  A,
int  pattern_symmetric_only 
)
SparseMatrix SparseMatrix_to_square_matrix ( SparseMatrix  A,
int  bipartite_options 
)
SparseMatrix SparseMatrix_transpose ( SparseMatrix  A)
void SparseMatrix_weakly_connected_components ( SparseMatrix  A0,
int ncomp,
int **  comps,
int **  comps_ptr 
)