Graphviz
2.41.20171026.1811
|
#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"
Go to the source code of this file.
Data Structures | |
struct | nodedata_struct |
Typedefs | |
typedef struct nodedata_struct * | nodedata |
typedef struct nodedata_struct* nodedata |
Definition at line 2593 of file SparseMatrix.c.
SparseMatrix SparseMatrix_add | ( | SparseMatrix | A, |
SparseMatrix | B | ||
) |
Definition at line 966 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, C, for(), SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, real, SparseMatrix_new(), and SparseMatrix_struct::type.
Referenced by SparseMatrix_symmetrize(), SparseMatrix_symmetrize_nodiag(), StressMajorizationSmoother_smooth(), and TriangleSmoother_new().
SparseMatrix SparseMatrix_apply_fun | ( | SparseMatrix | A, |
double(*)(double x) | fun | ||
) |
Definition at line 2355 of file SparseMatrix.c.
References SparseMatrix_struct::a, for(), SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::m, MATRIX_TYPE_REAL, real, and SparseMatrix_struct::type.
SparseMatrix SparseMatrix_apply_fun_general | ( | SparseMatrix | A, |
void(*)(int i, int j, int n, double *x) | fun | ||
) |
Definition at line 2378 of file SparseMatrix.c.
References SparseMatrix_struct::a, for(), SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_REAL, real, and SparseMatrix_struct::type.
SparseMatrix SparseMatrix_complement | ( | SparseMatrix | A, |
int | undirected | ||
) |
Definition at line 3332 of file SparseMatrix.c.
References assert, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_PATTERN, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, SparseMatrix_delete(), SparseMatrix_from_coordinate_arrays(), SparseMatrix_symmetrize(), and TRUE.
int SparseMatrix_connectedQ | ( | SparseMatrix | A0 | ) |
Definition at line 2854 of file SparseMatrix.c.
References FALSE, FREE, SparseMatrix_struct::m, SparseMatrix_struct::n, NULL, SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_level_sets(), SparseMatrix_symmetrize(), and TRUE.
SparseMatrix SparseMatrix_coordinate_form_add_entries | ( | SparseMatrix | A, |
int | nentries, | ||
int * | irn, | ||
int * | jcn, | ||
void * | val | ||
) |
Definition at line 1968 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, SparseMatrix_struct::format, FORMAT_COORD, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MAX, MEMCPY, SparseMatrix_struct::n, SparseMatrix_struct::nz, SparseMatrix_struct::nzmax, and SparseMatrix_struct::size.
Referenced by call_tri(), call_tri2(), Multilevel_MQ_Clustering_establish(), SparseMatrix_distance_matrix_k_centers(), and SparseMatrix_distance_matrix_khops().
SparseMatrix SparseMatrix_copy | ( | SparseMatrix | A | ) |
Definition at line 2471 of file SparseMatrix.c.
References SparseMatrix_struct::a, SparseMatrix_struct::format, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MEMCPY, SparseMatrix_struct::n, SparseMatrix_struct::nz, SparseMatrix_struct::property, SparseMatrix_struct::size, SparseMatrix_general_new(), and SparseMatrix_struct::type.
Referenced by ideal_distance_matrix(), modularity_clustering(), mq_clustering(), SparseMatrix_delete_sparse_columns(), SparseMatrix_symmetrize(), SparseMatrix_symmetrize_nodiag(), StressMajorizationSmoother_smooth(), and TriangleSmoother_new().
SparseMatrix SparseMatrix_crop | ( | SparseMatrix | A, |
real | epsilon | ||
) |
Definition at line 2402 of file SparseMatrix.c.
References SparseMatrix_struct::a, ABS, for(), SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, NULL, SparseMatrix_struct::nz, real, and SparseMatrix_struct::type.
void SparseMatrix_decompose_to_supervariables | ( | SparseMatrix | A, |
int * | ncluster, | ||
int ** | cluster, | ||
int ** | clusterp | ||
) |
Definition at line 2875 of file SparseMatrix.c.
References FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, SparseMatrix_struct::n, and NULL.
void SparseMatrix_delete | ( | SparseMatrix | A | ) |
Definition at line 411 of file SparseMatrix.c.
References SparseMatrix_struct::a, FREE, SparseMatrix_struct::ia, and SparseMatrix_struct::ja.
Referenced by attached_clustering(), call_tri(), call_tri2(), DistanceMatrix_restrict_cluster(), main(), modularity_clustering(), mq_clustering(), Multilevel_coarsen(), Multilevel_delete(), Multilevel_MQ_Clustering_delete(), Multilevel_MQ_Clustering_establish(), SparseMatrix_complement(), SparseMatrix_connectedQ(), SparseMatrix_delete_sparse_columns(), SparseMatrix_distance_matrix(), SparseMatrix_distance_matrix_k_centers(), SparseMatrix_distance_matrix_khops(), SparseMatrix_get_real_adjacency_matrix_symmetrized(), SparseMatrix_is_symmetric(), SparseMatrix_k_centers(), SparseMatrix_k_centers_user(), SparseMatrix_multiply(), SparseMatrix_multiply3(), SparseMatrix_pseudo_diameter_unweighted(), SparseMatrix_pseudo_diameter_weighted(), SparseMatrix_sort(), SparseMatrix_symmetrize(), SparseMatrix_symmetrize_nodiag(), SparseMatrix_to_square_matrix(), SparseMatrix_transpose(), SparseMatrix_weakly_connected_components(), spring_electrical_embedding(), spring_electrical_embedding_fast(), spring_electrical_embedding_slow(), spring_electrical_spring_embedding(), spring_maxent_embedding(), SpringSmoother_delete(), SpringSmoother_new(), stress_model_core(), StressMajorizationSmoother2_new(), StressMajorizationSmoother_delete(), StressMajorizationSmoother_smooth(), TriangleSmoother_new(), and uniform_stress().
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 | ||
) |
Definition at line 3264 of file SparseMatrix.c.
References assert, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, SparseMatrix_struct::n, SparseMatrix_copy(), SparseMatrix_delete(), and SparseMatrix_transpose().
Referenced by SparseMatrix_delete_empty_columns().
int SparseMatrix_distance_matrix | ( | SparseMatrix | D0, |
int | weighted, | ||
real ** | dist0 | ||
) |
Definition at line 3655 of file SparseMatrix.c.
References assert, FALSE, FREE, SparseMatrix_struct::m, MALLOC, SparseMatrix_struct::n, NULL, real, SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_level_sets(), SparseMatrix_symmetrize(), and TRUE.
SparseMatrix SparseMatrix_distance_matrix_k_centers | ( | int | K, |
SparseMatrix | D, | ||
int | weighted | ||
) |
Definition at line 3709 of file SparseMatrix.c.
References assert, C, FALSE, FORMAT_COORD, FREE, SparseMatrix_struct::m, MATRIX_TYPE_REAL, SparseMatrix_struct::n, NULL, real, SparseMatrix_coordinate_form_add_entries(), SparseMatrix_delete(), SparseMatrix_from_coordinate_format(), SparseMatrix_k_centers(), and SparseMatrix_new().
SparseMatrix SparseMatrix_distance_matrix_khops | ( | int | khops, |
SparseMatrix | D0, | ||
int | weighted | ||
) |
Definition at line 3747 of file SparseMatrix.c.
References assert, C, FALSE, FORMAT_COORD, FREE, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_REAL, SparseMatrix_struct::n, NULL, real, SparseMatrix_coordinate_form_add_entries(), SparseMatrix_delete(), SparseMatrix_from_coordinate_format(), SparseMatrix_is_symmetric(), SparseMatrix_level_sets_khops(), SparseMatrix_new(), SparseMatrix_symmetrize(), and TRUE.
SparseMatrix SparseMatrix_divide_row_by_degree | ( | SparseMatrix | A | ) |
Definition at line 2159 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, for(), SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, NULL, real, and SparseMatrix_struct::type.
SparseMatrix SparseMatrix_exclude_submatrix | ( | SparseMatrix | A, |
int | nrow, | ||
int | ncol, | ||
int * | rindices, | ||
int * | cindices | ||
) |
Definition at line 3195 of file SparseMatrix.c.
References FREE, SparseMatrix_struct::m, MALLOC, SparseMatrix_struct::n, and SparseMatrix_get_submatrix().
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 | ||
) |
Definition at line 626 of file SparseMatrix.c.
References SparseMatrix_struct::a, SparseMatrix_struct::format, FORMAT_COORD, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, SparseMatrix_struct::n, SparseMatrix_struct::nz, SparseMatrix_struct::nzmax, SparseMatrix_struct::property, SparseMatrix_struct::size, and SparseMatrix_struct::type.
Referenced by SparseMatrix_export_binary().
SparseMatrix SparseMatrix_from_coordinate_arrays | ( | int | nz, |
int | m, | ||
int | n, | ||
int * | irn, | ||
int * | jcn, | ||
void * | val0, | ||
int | type, | ||
size_t | sz | ||
) |
Definition at line 957 of file SparseMatrix.c.
References SUM_REPEATED_ALL.
Referenced by attached_clustering(), DistanceMatrix_restrict_cluster(), Import_coord_clusters_from_dot(), makeMatrix(), SparseMatrix_complement(), SparseMatrix_from_coordinate_format(), SparseMatrix_get_augmented(), SparseMatrix_get_submatrix(), and SparseMatrix_import_dot().
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 | ) |
Definition at line 797 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, SparseMatrix_struct::format, FORMAT_COORD, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, SparseMatrix_struct::size, SparseMatrix_from_coordinate_arrays(), and SparseMatrix_struct::type.
Referenced by call_tri(), call_tri2(), Multilevel_MQ_Clustering_establish(), SparseMatrix_distance_matrix_k_centers(), and SparseMatrix_distance_matrix_khops().
SparseMatrix SparseMatrix_from_coordinate_format_not_compacted | ( | SparseMatrix | A, |
int | what_to_sum | ||
) |
Definition at line 812 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, SparseMatrix_struct::format, FORMAT_COORD, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, SparseMatrix_struct::size, SparseMatrix_from_coordinate_arrays_not_compacted(), and SparseMatrix_struct::type.
SparseMatrix SparseMatrix_from_dense | ( | int | m, |
int | n, | ||
real * | x | ||
) |
Definition at line 3631 of file SparseMatrix.c.
References SparseMatrix_struct::a, for(), FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::ja, MATRIX_TYPE_REAL, SparseMatrix_struct::nz, real, and SparseMatrix_new().
Definition at line 397 of file SparseMatrix.c.
Referenced by SparseMatrix_copy(), and SparseMatrix_import_binary_fp().
SparseMatrix SparseMatrix_get_augmented | ( | SparseMatrix | A | ) |
Definition at line 2974 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MEMCPY, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, SparseMatrix_struct::size, SparseMatrix_from_coordinate_arrays(), SparseMatrix_set_pattern_symmetric, SparseMatrix_set_symmetric, and SparseMatrix_struct::type.
Referenced by SparseMatrix_to_square_matrix().
SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized | ( | SparseMatrix | A | ) |
Definition at line 2208 of file SparseMatrix.c.
References SparseMatrix_struct::a, for(), FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MEMCPY, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, real, SparseMatrix_struct::size, SparseMatrix_delete(), SparseMatrix_new(), SparseMatrix_remove_diagonal(), SparseMatrix_symmetrize(), TRUE, and SparseMatrix_struct::type.
Referenced by get_distance_matrix(), Multilevel_MQ_Clustering_new(), Multilevel_new(), and stress_model_core().
SparseMatrix SparseMatrix_get_submatrix | ( | SparseMatrix | A, |
int | nrow, | ||
int | ncol, | ||
int * | rindices, | ||
int * | cindices | ||
) |
Definition at line 3040 of file SparseMatrix.c.
References SparseMatrix_struct::a, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, NULL, real, SparseMatrix_struct::size, SparseMatrix_from_coordinate_arrays(), and SparseMatrix_struct::type.
Referenced by SparseMatrix_exclude_submatrix(), and SparseMatrix_largest_component().
int SparseMatrix_has_diagonal | ( | SparseMatrix | A | ) |
Definition at line 2483 of file SparseMatrix.c.
References FALSE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, and TRUE.
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 | ) |
Definition at line 662 of file SparseMatrix.c.
References SparseMatrix_struct::a, FORMAT_COORD, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, NULL, SparseMatrix_struct::nz, SparseMatrix_struct::property, SparseMatrix_struct::size, and SparseMatrix_general_new().
Referenced by SparseMatrix_import_binary().
int SparseMatrix_is_symmetric | ( | SparseMatrix | A, |
int | test_pattern_symmetry_only | ||
) |
Definition at line 178 of file SparseMatrix.c.
References SparseMatrix_struct::a, ABS, assert, FALSE, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, real, SparseMatrix_delete(), SparseMatrix_known_strucural_symmetric, SparseMatrix_known_symmetric, SparseMatrix_set_pattern_symmetric, SparseMatrix_set_symmetric, SparseMatrix_transpose(), SYMMETRY_EPSILON, TRUE, and SparseMatrix_struct::type.
Referenced by average_edge_length(), ideal_distance_matrix(), Multilevel_MQ_Clustering_init(), Multilevel_MQ_Clustering_new(), Multilevel_new(), SparseMatrix_connectedQ(), SparseMatrix_distance_matrix(), SparseMatrix_distance_matrix_khops(), SparseMatrix_k_centers(), SparseMatrix_k_centers_user(), SparseMatrix_pseudo_diameter_unweighted(), SparseMatrix_pseudo_diameter_weighted(), SparseMatrix_symmetrize(), SparseMatrix_symmetrize_nodiag(), SparseMatrix_to_square_matrix(), SparseMatrix_weakly_connected_components(), SparseStressMajorizationSmoother_new(), SpringSmoother_new(), stress_model_core(), StressMajorizationSmoother2_new(), TriangleSmoother_new(), uniform_stress(), and UniformStressSmoother_new().
int SparseMatrix_k_centers | ( | SparseMatrix | D0, |
int | weighted, | ||
int | K, | ||
int | root, | ||
int ** | centers, | ||
int | centering, | ||
real ** | dist0 | ||
) |
Definition at line 3372 of file SparseMatrix.c.
References assert, FALSE, FREE, SparseMatrix_struct::m, MALLOC, MIN, SparseMatrix_struct::n, NULL, real, SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_level_sets(), SparseMatrix_pseudo_diameter_unweighted(), SparseMatrix_pseudo_diameter_weighted(), SparseMatrix_symmetrize(), and TRUE.
Referenced by SparseMatrix_distance_matrix_k_centers().
int SparseMatrix_k_centers_user | ( | SparseMatrix | D0, |
int | weighted, | ||
int | K, | ||
int * | centers_user, | ||
int | centering, | ||
real ** | dist0 | ||
) |
Definition at line 3515 of file SparseMatrix.c.
References assert, FALSE, FREE, SparseMatrix_struct::m, MALLOC, MIN, SparseMatrix_struct::n, NULL, real, SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_level_sets(), SparseMatrix_pseudo_diameter_unweighted(), SparseMatrix_pseudo_diameter_weighted(), SparseMatrix_symmetrize(), and TRUE.
SparseMatrix SparseMatrix_largest_component | ( | SparseMatrix | A | ) |
Definition at line 3234 of file SparseMatrix.c.
References BIPARTITE_RECT, FREE, NULL, SparseMatrix_get_submatrix(), SparseMatrix_to_square_matrix(), and SparseMatrix_weakly_connected_components().
void SparseMatrix_level_sets | ( | SparseMatrix | A, |
int | root, | ||
int * | nlevel, | ||
int ** | levelset_ptr, | ||
int ** | levelset, | ||
int ** | mask, | ||
int | reinitialize_mask | ||
) |
Definition at line 2545 of file SparseMatrix.c.
References SparseMatrix_level_sets_internal().
Referenced by SparseMatrix_connectedQ(), SparseMatrix_distance_matrix(), SparseMatrix_k_centers(), SparseMatrix_k_centers_user(), SparseMatrix_pseudo_diameter_unweighted(), and SparseMatrix_weakly_connected_components().
void SparseMatrix_level_sets_internal | ( | int | khops, |
SparseMatrix | A, | ||
int | root, | ||
int * | nlevel, | ||
int ** | levelset_ptr, | ||
int ** | levelset, | ||
int ** | mask, | ||
int | reinitialize_mask | ||
) |
Definition at line 2495 of file SparseMatrix.c.
References assert, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, and UNMASKED.
Referenced by SparseMatrix_level_sets(), and SparseMatrix_level_sets_khops().
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 | ) |
Definition at line 62 of file SparseMatrix.c.
References FALSE, SparseMatrix_remove_upper(), SparseMatrix_set_undirected, and SparseMatrix_symmetrize().
SparseMatrix SparseMatrix_multiply | ( | SparseMatrix | A, |
SparseMatrix | B | ||
) |
Definition at line 1401 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, C, for(), SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, real, SparseMatrix_delete(), SparseMatrix_new(), and SparseMatrix_struct::type.
Referenced by Multilevel_coarsen(), and Multilevel_MQ_Clustering_establish().
SparseMatrix SparseMatrix_multiply3 | ( | SparseMatrix | A, |
SparseMatrix | B, | ||
SparseMatrix | C | ||
) |
Definition at line 1567 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, real, SparseMatrix_delete(), SparseMatrix_new(), and SparseMatrix_struct::type.
Referenced by DistanceMatrix_restrict_cluster().
SparseMatrix SparseMatrix_multiply_by_scaler | ( | SparseMatrix | A, |
real | s | ||
) |
Definition at line 1355 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, for(), SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_REAL, NULL, SparseMatrix_struct::nz, real, and SparseMatrix_struct::type.
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 | ||
) |
Definition at line 1217 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, if(), SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_INTEGER, MATRIX_TYPE_REAL, SparseMatrix_struct::n, NULL, real, and SparseMatrix_struct::type.
Referenced by Operator_matmul_apply(), and Operator_uniform_stress_matmul_apply().
Definition at line 384 of file SparseMatrix.c.
Referenced by call_tri(), call_tri2(), Multilevel_MQ_Clustering_establish(), SparseMatrix_add(), SparseMatrix_distance_matrix_k_centers(), SparseMatrix_distance_matrix_khops(), SparseMatrix_from_dense(), SparseMatrix_get_real_adjacency_matrix_symmetrized(), SparseMatrix_import_dot(), SparseMatrix_multiply(), SparseMatrix_multiply3(), SparseMatrix_transpose(), SparseStressMajorizationSmoother_new(), SpringSmoother_new(), StressMajorizationSmoother2_new(), and UniformStressSmoother_new().
SparseMatrix SparseMatrix_normalize_by_row | ( | SparseMatrix | A | ) |
Definition at line 2272 of file SparseMatrix.c.
References SparseMatrix_struct::a, ABS, for(), SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::m, MATRIX_TYPE_REAL, MAX, max, real, and SparseMatrix_struct::type.
SparseMatrix SparseMatrix_normalize_to_rowsum1 | ( | SparseMatrix | A | ) |
Definition at line 2243 of file SparseMatrix.c.
References SparseMatrix_struct::a, for(), SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::m, MATRIX_TYPE_REAL, real, and SparseMatrix_struct::type.
void SparseMatrix_page_rank | ( | SparseMatrix | A, |
real | teleport_probablity, | ||
int | weighted, | ||
real | epsilon, | ||
real ** | page_rank | ||
) |
Definition at line 4081 of file SparseMatrix.c.
References SparseMatrix_struct::a, ABS, assert, FALSE, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MACHINEACC, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, MAX, MEMCPY, SparseMatrix_struct::n, NULL, real, SparseMatrix_struct::type, and Verbose.
void SparseMatrix_print | ( | char * | c, |
SparseMatrix | A | ||
) |
Definition at line 536 of file SparseMatrix.c.
References assert, SparseMatrix_struct::format, FORMAT_COORD, FORMAT_CSC, FORMAT_CSR, SparseMatrix_print_coord(), and SparseMatrix_print_csr().
void SparseMatrix_print_coord | ( | char * | c, |
SparseMatrix | A | ||
) |
Definition at line 481 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, for(), SparseMatrix_struct::format, FORMAT_COORD, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, SparseMatrix_struct::nz, real, and SparseMatrix_struct::type.
Referenced by SparseMatrix_print().
void SparseMatrix_print_csr | ( | char * | c, |
SparseMatrix | A | ||
) |
Definition at line 420 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, for(), SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, real, and SparseMatrix_struct::type.
Referenced by SparseMatrix_print().
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 | ||
) |
Definition at line 2796 of file SparseMatrix.c.
References assert, FALSE, FREE, int, SparseMatrix_struct::m, MIN, NULL, real, SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_level_sets(), SparseMatrix_pseudo_diameter_unweighted(), SparseMatrix_symmetrize(), and TRUE.
Referenced by SparseMatrix_k_centers(), SparseMatrix_k_centers_user(), SparseMatrix_pseudo_diameter_only(), and SparseMatrix_pseudo_diameter_unweighted().
real SparseMatrix_pseudo_diameter_weighted | ( | SparseMatrix | A0, |
int | root, | ||
int | aggressive, | ||
int * | end1, | ||
int * | end2, | ||
int * | connectedQ | ||
) |
Definition at line 2732 of file SparseMatrix.c.
References ABS, assert, FALSE, FREE, SparseMatrix_struct::m, MALLOC, MAX, SparseMatrix_struct::n, NULL, real, SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_pseudo_diameter_weighted(), SparseMatrix_symmetrize(), and TRUE.
Referenced by SparseMatrix_k_centers(), SparseMatrix_k_centers_user(), and SparseMatrix_pseudo_diameter_weighted().
SparseMatrix SparseMatrix_remove_diagonal | ( | SparseMatrix | A | ) |
Definition at line 1993 of file SparseMatrix.c.
References SparseMatrix_struct::a, for(), SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, NULL, SparseMatrix_struct::nz, real, and SparseMatrix_struct::type.
Referenced by DistanceMatrix_restrict_cluster(), modularity_clustering(), mq_clustering(), SparseMatrix_get_real_adjacency_matrix_symmetrized(), SparseMatrix_symmetrize_nodiag(), and stress_model_core().
SparseMatrix SparseMatrix_remove_upper | ( | SparseMatrix | A | ) |
Definition at line 2073 of file SparseMatrix.c.
References SparseMatrix_struct::a, clear_flag, for(), SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_HERMITIAN, MATRIX_PATTERN_SYMMETRIC, MATRIX_SKEW, MATRIX_SYMMETRIC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, NULL, SparseMatrix_struct::nz, SparseMatrix_struct::property, real, and SparseMatrix_struct::type.
Referenced by SparseMatrix_make_undirected().
SparseMatrix SparseMatrix_scaled_by_vector | ( | SparseMatrix | A, |
real * | v, | ||
int | apply_to_row | ||
) |
Definition at line 1324 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, if(), SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_REAL, real, and SparseMatrix_struct::type.
SparseMatrix SparseMatrix_set_entries_to_real_one | ( | SparseMatrix | A | ) |
Definition at line 3318 of file SparseMatrix.c.
References SparseMatrix_struct::a, FREE, MALLOC, MATRIX_TYPE_REAL, SparseMatrix_struct::nz, real, SparseMatrix_struct::size, and SparseMatrix_struct::type.
Referenced by modularity_clustering(), and mq_clustering().
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 | ||
) |
Definition at line 1769 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, for(), FREE, SparseMatrix_struct::ia, if(), int, SparseMatrix_struct::ja, SparseMatrix_struct::m, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, MAX, MIN, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, real, SUM_IMGINARY_KEEP_LAST_REAL, SUM_REPEATED_ALL, SUM_REPEATED_IMAGINARY_PART, SUM_REPEATED_NONE, SUM_REPEATED_REAL_PART, SparseMatrix_struct::type, xmax, xmin, ymax, and ymin.
SparseMatrix SparseMatrix_symmetrize | ( | SparseMatrix | A, |
int | pattern_symmetric_only | ||
) |
Definition at line 151 of file SparseMatrix.c.
References NULL, SparseMatrix_add(), SparseMatrix_copy(), SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_set_pattern_symmetric, SparseMatrix_set_symmetric, and SparseMatrix_transpose().
Referenced by call_tri(), call_tri2(), get_distance_matrix(), modularity_clustering(), mq_clustering(), SparseMatrix_complement(), SparseMatrix_connectedQ(), SparseMatrix_distance_matrix(), SparseMatrix_distance_matrix_khops(), SparseMatrix_get_real_adjacency_matrix_symmetrized(), SparseMatrix_k_centers(), SparseMatrix_k_centers_user(), SparseMatrix_make_undirected(), SparseMatrix_pseudo_diameter_unweighted(), SparseMatrix_pseudo_diameter_weighted(), SparseMatrix_weakly_connected_components(), spring_electrical_embedding(), spring_electrical_embedding_fast(), spring_electrical_embedding_slow(), spring_electrical_spring_embedding(), spring_maxent_embedding(), and stress_model_core().
SparseMatrix SparseMatrix_symmetrize_nodiag | ( | SparseMatrix | A, |
int | pattern_symmetric_only | ||
) |
Definition at line 163 of file SparseMatrix.c.
References NULL, SparseMatrix_add(), SparseMatrix_copy(), SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_remove_diagonal(), SparseMatrix_set_pattern_symmetric, SparseMatrix_set_symmetric, and SparseMatrix_transpose().
Referenced by Multilevel_new().
SparseMatrix SparseMatrix_to_complex | ( | SparseMatrix | A | ) |
Definition at line 2300 of file SparseMatrix.c.
References SparseMatrix_struct::a, SparseMatrix_struct::format, FORMAT_CSR, FREE, SparseMatrix_struct::ia, SparseMatrix_struct::ja, MALLOC, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, NULL, SparseMatrix_struct::nz, real, REALLOC, SparseMatrix_struct::size, and SparseMatrix_struct::type.
SparseMatrix SparseMatrix_to_square_matrix | ( | SparseMatrix | A, |
int | bipartite_options | ||
) |
Definition at line 3018 of file SparseMatrix.c.
References assert, BIPARTITE_ALWAYS, BIPARTITE_PATTERN_UNSYM, BIPARTITE_RECT, BIPARTITE_UNSYM, FALSE, SparseMatrix_struct::m, SparseMatrix_struct::n, SparseMatrix_delete(), SparseMatrix_get_augmented(), SparseMatrix_is_symmetric(), and TRUE.
Referenced by SparseMatrix_largest_component().
SparseMatrix SparseMatrix_transpose | ( | SparseMatrix | A | ) |
Definition at line 69 of file SparseMatrix.c.
References SparseMatrix_struct::a, assert, SparseMatrix_struct::format, FORMAT_CSR, SparseMatrix_struct::ia, SparseMatrix_struct::ja, SparseMatrix_struct::m, MATRIX_TYPE_COMPLEX, MATRIX_TYPE_INTEGER, MATRIX_TYPE_PATTERN, MATRIX_TYPE_REAL, MATRIX_TYPE_UNKNOWN, SparseMatrix_struct::n, NULL, SparseMatrix_struct::nz, real, SparseMatrix_delete(), SparseMatrix_new(), and SparseMatrix_struct::type.
Referenced by Multilevel_MQ_Clustering_establish(), SparseMatrix_delete_sparse_columns(), SparseMatrix_is_symmetric(), SparseMatrix_sort(), SparseMatrix_symmetrize(), and SparseMatrix_symmetrize_nodiag().
void SparseMatrix_weakly_connected_components | ( | SparseMatrix | A0, |
int * | ncomp, | ||
int ** | comps, | ||
int ** | comps_ptr | ||
) |
Definition at line 2558 of file SparseMatrix.c.
References FALSE, FREE, SparseMatrix_struct::m, MALLOC, NULL, SparseMatrix_delete(), SparseMatrix_is_symmetric(), SparseMatrix_level_sets(), SparseMatrix_symmetrize(), and TRUE.
Referenced by SparseMatrix_largest_component().