Graphviz  2.41.20171026.1811
Data Structures | Typedefs | Functions
SparseMatrix.c File Reference
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include "logic.h"
#include "memory.h"
#include "arith.h"
#include "SparseMatrix.h"
#include "BinaryHeap.h"
Include dependency graph for SparseMatrix.c:

Go to the source code of this file.

Data Structures

struct  nodedata_struct
 

Typedefs

typedef struct nodedata_structnodedata
 

Functions

SparseMatrix SparseMatrix_sort (SparseMatrix A)
 
SparseMatrix SparseMatrix_make_undirected (SparseMatrix A)
 
SparseMatrix SparseMatrix_transpose (SparseMatrix A)
 
SparseMatrix SparseMatrix_symmetrize (SparseMatrix A, int pattern_symmetric_only)
 
SparseMatrix SparseMatrix_symmetrize_nodiag (SparseMatrix A, int pattern_symmetric_only)
 
int SparseMatrix_is_symmetric (SparseMatrix A, int test_pattern_symmetry_only)
 
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)
 
void SparseMatrix_delete (SparseMatrix A)
 
void SparseMatrix_print_csr (char *c, SparseMatrix A)
 
void SparseMatrix_print_coord (char *c, SparseMatrix A)
 
void SparseMatrix_print (char *c, SparseMatrix A)
 
void SparseMatrix_export_binary_fp (FILE *f, SparseMatrix A)
 
void SparseMatrix_export_binary (char *name, SparseMatrix A, int *flag)
 
SparseMatrix SparseMatrix_import_binary_fp (FILE *f)
 
SparseMatrix SparseMatrix_import_binary (char *name)
 
void SparseMatrix_export (FILE *f, SparseMatrix A)
 
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 *val0, int type, size_t sz)
 
SparseMatrix SparseMatrix_from_coordinate_arrays_not_compacted (int nz, int m, int n, int *irn, int *jcn, void *val0, int type, size_t sz, int what_to_sum)
 
SparseMatrix SparseMatrix_add (SparseMatrix A, SparseMatrix B)
 
void SparseMatrix_multiply_dense (SparseMatrix A, int ATransposed, real *v, int vTransposed, real **res, int res_transposed, int dim)
 
void SparseMatrix_multiply_vector (SparseMatrix A, real *v, real **res, int transposed)
 
SparseMatrix SparseMatrix_scaled_by_vector (SparseMatrix A, real *v, int apply_to_row)
 
SparseMatrix SparseMatrix_multiply_by_scaler (SparseMatrix A, real s)
 
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)
 
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)
 
SparseMatrix SparseMatrix_normalize_by_row (SparseMatrix A)
 
SparseMatrix SparseMatrix_to_complex (SparseMatrix A)
 
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_crop (SparseMatrix A, real epsilon)
 
SparseMatrix SparseMatrix_copy (SparseMatrix A)
 
int SparseMatrix_has_diagonal (SparseMatrix A)
 
void SparseMatrix_level_sets_internal (int khops, SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reinitialize_mask)
 
void SparseMatrix_level_sets (SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reinitialize_mask)
 
void SparseMatrix_level_sets_khops (int khops, SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reinitialize_mask)
 
void SparseMatrix_weakly_connected_components (SparseMatrix A0, int *ncomp, int **comps, int **comps_ptr)
 
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)
 
real SparseMatrix_pseudo_diameter_only (SparseMatrix A)
 
int SparseMatrix_connectedQ (SparseMatrix A0)
 
void SparseMatrix_decompose_to_supervariables (SparseMatrix A, int *ncluster, int **cluster, int **clusterp)
 
SparseMatrix SparseMatrix_get_augmented (SparseMatrix A)
 
SparseMatrix SparseMatrix_to_square_matrix (SparseMatrix A, int bipartite_options)
 
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_largest_component (SparseMatrix A)
 
SparseMatrix SparseMatrix_delete_sparse_columns (SparseMatrix A, int threshold, int **new2old, int *nnew, int inplace)
 
SparseMatrix SparseMatrix_delete_empty_columns (SparseMatrix A, int **new2old, int *nnew, int inplace)
 
SparseMatrix SparseMatrix_set_entries_to_real_one (SparseMatrix A)
 
SparseMatrix SparseMatrix_complement (SparseMatrix A, int undirected)
 
int SparseMatrix_k_centers (SparseMatrix D0, int weighted, int K, int root, int **centers, int centering, real **dist0)
 
int SparseMatrix_k_centers_user (SparseMatrix D0, int weighted, int K, int *centers_user, int centering, real **dist0)
 
SparseMatrix SparseMatrix_from_dense (int m, int n, real *x)
 
int SparseMatrix_distance_matrix (SparseMatrix D0, int weighted, real **dist0)
 
SparseMatrix SparseMatrix_distance_matrix_k_centers (int K, SparseMatrix D, int weighted)
 
SparseMatrix SparseMatrix_distance_matrix_khops (int khops, SparseMatrix D0, int weighted)
 
void SparseMatrix_page_rank (SparseMatrix A, real teleport_probablity, int weighted, real epsilon, real **page_rank)
 

Typedef Documentation

typedef struct nodedata_struct* nodedata

Definition at line 2593 of file SparseMatrix.c.

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  A0)
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  D0,
int  weighted,
real **  dist0 
)
SparseMatrix SparseMatrix_distance_matrix_k_centers ( int  K,
SparseMatrix  D,
int  weighted 
)
SparseMatrix SparseMatrix_distance_matrix_khops ( int  khops,
SparseMatrix  D0,
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 *  val0,
int  type,
size_t  sz 
)
SparseMatrix SparseMatrix_from_coordinate_arrays_not_compacted ( int  nz,
int  m,
int  n,
int irn,
int jcn,
void *  val0,
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  D0,
int  weighted,
int  K,
int  root,
int **  centers,
int  centering,
real **  dist0 
)
int SparseMatrix_k_centers_user ( SparseMatrix  D0,
int  weighted,
int  K,
int centers_user,
int  centering,
real **  dist0 
)
SparseMatrix SparseMatrix_largest_component ( SparseMatrix  A)
void SparseMatrix_level_sets ( SparseMatrix  A,
int  root,
int nlevel,
int **  levelset_ptr,
int **  levelset,
int **  mask,
int  reinitialize_mask 
)
void SparseMatrix_level_sets_internal ( int  khops,
SparseMatrix  A,
int  root,
int nlevel,
int **  levelset_ptr,
int **  levelset,
int **  mask,
int  reinitialize_mask 
)
void SparseMatrix_level_sets_khops ( int  khops,
SparseMatrix  A,
int  root,
int nlevel,
int **  levelset_ptr,
int **  levelset,
int **  mask,
int  reinitialize_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  ATransposed,
real v,
int  vTransposed,
real **  res,
int  res_transposed,
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 *  c,
SparseMatrix  A 
)
void SparseMatrix_print_coord ( char *  c,
SparseMatrix  A 
)
void SparseMatrix_print_csr ( char *  c,
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_complex ( SparseMatrix  A)
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 
)