Found 477 results in 11 files.
Rgraphviz:src/graphviz/lib/sparse/SparseMatrix.c: [ ]
50: SparseMatrix SparseMatrix_sort(SparseMatrix A){
58: SparseMatrix SparseMatrix_make_undirected(SparseMatrix A){
65: SparseMatrix SparseMatrix_transpose(SparseMatrix A){
146: SparseMatrix SparseMatrix_symmetrize(SparseMatrix A, int pattern_symmetric_only){
158: SparseMatrix SparseMatrix_symmetrize_nodiag(SparseMatrix A, int pattern_symmetric_only){
173: int SparseMatrix_is_symmetric(SparseMatrix A, int test_pattern_symmetry_only){
291: static SparseMatrix SparseMatrix_init(int m, int n, int type, int format){
322: static SparseMatrix SparseMatrix_alloc(SparseMatrix A, int nz){
343: static SparseMatrix SparseMatrix_realloc(SparseMatrix A, int nz){
374: SparseMatrix SparseMatrix_new(int m, int n, int nz, int type, int format){
385: void SparseMatrix_delete(SparseMatrix A){
394: void SparseMatrix_print_csr(char *c, SparseMatrix A){
455: void SparseMatrix_print_coord(char *c, SparseMatrix A){
510: void SparseMatrix_print(char *c, SparseMatrix A){
531: static void SparseMatrix_export_csr(FILE *f, SparseMatrix A){
600: void SparseMatrix_export_binary(char *name, SparseMatrix A, int *flag){
627: SparseMatrix SparseMatrix_import_binary(char *name){
660: static void SparseMatrix_export_coord(FILE *f, SparseMatrix A){
722: void SparseMatrix_export(FILE *f, SparseMatrix A){
741: SparseMatrix SparseMatrix_from_coordinate_format(SparseMatrix A){
756: SparseMatrix SparseMatrix_from_coordinate_format_not_compacted(SparseMatrix A, int what_to_sum){
772: SparseMatrix SparseMatrix_from_coordinate_arrays_internal(int nz, int m, int n, int *irn, int *jcn, void *val0, int type, int...(15 bytes skipped)...
887: SparseMatrix SparseMatrix_from_coordinate_arrays(int nz, int m, int n, int *irn, int *jcn, void *val0, int type){
890: SparseMatrix SparseMatrix_from_coordinate_arrays_not_compacted(int nz, int m, int n, int *irn, int *jcn, void *val0, int type...(19 bytes skipped)...
894: SparseMatrix SparseMatrix_add(SparseMatrix A, SparseMatrix B){
1044: static void SparseMatrix_multiply_dense1(SparseMatrix A, real *v, real **res, int dim, int transposed, int res_transposed){
1084: static void SparseMatrix_multiply_dense2(SparseMatrix A, real *v, real **res, int dim, int transposed, int res_transposed){
1120: void SparseMatrix_multiply_dense(SparseMatrix A, int ATransposed, real *v, int vTransposed, real **res, int res_transposed, int dim){
1145: void SparseMatrix_multiply_vector(SparseMatrix A, real *v, real **res, int transposed){
1203: SparseMatrix SparseMatrix_scaled_by_vector(SparseMatrix A, real *v, int apply_to_row){
1234: SparseMatrix SparseMatrix_multiply_by_scaler(SparseMatrix A, real s){
1261: SparseMatrix SparseMatrix_multiply(SparseMatrix A, SparseMatrix B){
1427: SparseMatrix SparseMatrix_multiply3(SparseMatrix A, SparseMatrix B, SparseMatrix C){
1629: SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum){
1808: SparseMatrix SparseMatrix_coordinate_form_add_entries(SparseMatrix A, int nentries, int *irn, int *jcn, void *val){
1833: SparseMatrix SparseMatrix_remove_diagonal(SparseMatrix A){
1913: SparseMatrix SparseMatrix_remove_upper(SparseMatrix A){/* remove diag and upper diag */
1999: SparseMatrix SparseMatrix_divide_row_by_degree(SparseMatrix A){
2048: SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized(SparseMatrix A){
2082: SparseMatrix SparseMatrix_normalize_to_rowsum1(SparseMatrix A){
2111: SparseMatrix SparseMatrix_normalize_by_row(SparseMatrix A){
2140: SparseMatrix SparseMatrix_apply_fun(SparseMatrix A, double (*fun)(double x)){
2163: SparseMatrix SparseMatrix_apply_fun_general(SparseMatrix A, void (*fun)(int i, int j, int n, double *x)){
2187: SparseMatrix SparseMatrix_crop(SparseMatrix A, real epsilon){
2256: SparseMatrix SparseMatrix_copy(SparseMatrix A){
2268: int SparseMatrix_has_diagonal(SparseMatrix A){
2280: void SparseMatrix_level_sets(SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reinitialize_mask){
2320: void SparseMatrix_weakly_connected_components(SparseMatrix A0, int *ncomp, int **comps, int **comps_ptr){
2475: real SparseMatrix_pseudo_diameter_weighted(SparseMatrix A0, int root, int aggressive, int *end1, int *end2, int *connectedQ){
2539: real SparseMatrix_pseudo_diameter_unweighted(SparseMatrix A0, int root, int aggressive, int *end1, int *end2, int *connectedQ){
2592: real SparseMatrix_pseudo_diameter_only(SparseMatrix A){
2597: int SparseMatrix_connectedQ(SparseMatrix A0){
2618: void SparseMatrix_decompose_to_supervariables(SparseMatrix A, int *ncluster, int **cluster, int **clusterp){
2717: SparseMatrix SparseMatrix_get_augmented(SparseMatrix A){
2761: SparseMatrix SparseMatrix_to_square_matrix(SparseMatrix A, int bipartite_options){
2783: SparseMatrix SparseMatrix_get_submatrix(SparseMatrix A, int nrow, int ncol, int *rindices, int *cindices){
2938: SparseMatrix SparseMatrix_exclude_submatrix(SparseMatrix A, int nrow, int ncol, int *rindices, int *cindices){
2977: SparseMatrix SparseMatrix_largest_component(SparseMatrix A){
3007: SparseMatrix SparseMatrix_delete_empty_columns(SparseMatrix A, int **new2old, int *nnew, int inplace){
3057: SparseMatrix SparseMatrix_set_entries_to_real_one(SparseMatrix A){
3070: SparseMatrix SparseMatrix_complement(SparseMatrix A, int undirected){
1: /* $Id: SparseMatrix.c,v 1.7 2011/02/28 16:08:27 erg Exp $Revision: */
21: #include "SparseMatrix.h"
51:   SparseMatrix B;
52:   B = SparseMatrix_transpose(A);
53:   SparseMatrix_delete(A);
54:   A = SparseMatrix_transpose(B);
55:   SparseMatrix_delete(B);
60:   SparseMatrix B;
61:   B = SparseMatrix_symmetrize(A, FALSE);
62:   SparseMatrix_set_undirected(B);
63:   return SparseMatrix_remove_upper(B);
67:   SparseMatrix B;
73:   B = SparseMatrix_new(n, m, nz, type, format);
131:     SparseMatrix_delete(B);
134:     SparseMatrix_delete(B);
147:   SparseMatrix B;
148:   if (SparseMatrix_is_symmetric(A, pattern_symmetric_only)) return SparseMatrix_copy(A);
149:   B = SparseMatrix_transpose(A);
151:   A = SparseMatrix_add(A, B);
152:   SparseMatrix_delete(B);
153:   SparseMatrix_set_symmetric(A);
154:   SparseMatrix_set_pattern_symmetric(A);
159:   SparseMatrix B;
160:   if (SparseMatrix_is_symmetric(A, pattern_symmetric_only)) {
161:     B = SparseMatrix_copy(A);
162:     return SparseMatrix_remove_diagonal(B);
164:   B = SparseMatrix_transpose(A);
166:   A = SparseMatrix_add(A, B);
167:   SparseMatrix_delete(B);
168:   SparseMatrix_set_symmetric(A);
169:   SparseMatrix_set_pattern_symmetric(A);
170:   return SparseMatrix_remove_diagonal(A);
175:   SparseMatrix B;
184:   if (SparseMatrix_known_symmetric(A)) return TRUE;
185:   if (test_pattern_symmetry_only && SparseMatrix_known_strucural_symmetric(A)) return TRUE;
189:   B = SparseMatrix_transpose(A);
279:     SparseMatrix_set_pattern_symmetric(A);
281:     SparseMatrix_set_symmetric(A);
282:     SparseMatrix_set_pattern_symmetric(A);
287:   SparseMatrix_delete(B);
292:   SparseMatrix A;
295:   A = MALLOC(sizeof(struct SparseMatrix_struct));
377:   SparseMatrix A;
379:   A = SparseMatrix_init(m, n, type, format);
380:   if (nz > 0) A = SparseMatrix_alloc(A, nz);
513:     SparseMatrix_print_csr(c, A);
517: 		 SparseMatrix_print_csc(c, A);*/
520:     SparseMatrix_print_coord(c, A);
628:   SparseMatrix A = NULL;
643:   A = SparseMatrix_new(m, n, nz, type, format);
726:     SparseMatrix_export_csr(f, A);
730: 		 SparseMatrix_print_csc(c, A);*/
733:     SparseMatrix_export_coord(f, A);
753:   return SparseMatrix_from_coordinate_arrays(A->nz, A->m, A->n, irn, jcn, a, A->type);
768:   return SparseMatrix_from_coordinate_arrays_not_compacted(A->nz, A->m, A->n, irn, jcn, a, A->type, what_to_sum);
781:   SparseMatrix A = NULL;
790:   A = SparseMatrix_new(m, n, nz, type, FORMAT_CSR);
882:   if(sum_repeated) A = SparseMatrix_sum_repeat_entries(A, sum_repeated);
888:   return SparseMatrix_from_coordinate_arrays_internal(nz, m, n, irn, jcn, val0, type, SUM_REPEATED_ALL);
891:   return SparseMatrix_from_coordinate_arrays_internal(nz, m, n, irn, jcn, val0, type, what_to_sum);
896:   SparseMatrix C = NULL;
910:   C = SparseMatrix_new(m, n, nzmax, A->type, FORMAT_CSR);
1101:       SparseMatrix_multiply_vector(A, &(v[n*i]), &rr, transposed);
1108:       SparseMatrix_multiply_vector(A, &(v[m*i]), &rr, transposed);
1136:     SparseMatrix_multiply_dense1(A, v, res, dim, ATransposed, res_transposed);
1138:     SparseMatrix_multiply_dense2(A, v, res, dim, ATransposed, res_transposed);
1263:   SparseMatrix C = NULL;
1274:     printf("in SparseMatrix_multiply, the matrix types do not match, right now only multiplication of matrices of the same type...(18 bytes skipped)...
1293: 	    fprintf(stderr,"overflow in SparseMatrix_multiply !!!\n");
1304:   C = SparseMatrix_new(m, B->n, nz, type, FORMAT_CSR);
1412:     SparseMatrix_delete(C);
1429:   SparseMatrix D = NULL;
1442:     printf("in SparseMatrix_multiply, the matrix types do not match, right now only multiplication of matrices of the same type...(18 bytes skipped)...
1463: 	      fprintf(stderr,"overflow in SparseMatrix_multiply !!!\n");
1475:   D = SparseMatrix_new(m, C->n, nz, type, FORMAT_CSR);
1599:     SparseMatrix_delete(D);
1819:     A = SparseMatrix_realloc(A, nzmax);
2052:   SparseMatrix B;
2064:   B = SparseMatrix_new(m, n, nz, MATRIX_TYPE_PATTERN, FORMAT_CSR);
2070:   A = SparseMatrix_symmetrize(B, TRUE);
2071:   SparseMatrix_delete(B);
2072:   A = SparseMatrix_remove_diagonal(A);
2171:     printf("SparseMatrix_apply_fun: only CSR and real/complex matrix supported.\n");
2257:   SparseMatrix B;
2259:   B = SparseMatrix_new(A->m, A->n, A->nz, A->type, A->format);
2321:   SparseMatrix A = A0;
2325:   if (!SparseMatrix_is_symmetric(A, TRUE)){
2326:     A = SparseMatrix_symmetrize(A, TRUE);
2334:       SparseMatrix_level_sets(A, i, &nlevel, &levelset_ptr, &levelset, &mask, FALSE);
2343:   if (A != A0) SparseMatrix_delete(A);
2371: static int Dijkstra(SparseMatrix A, int root, real *dist, int *nlist, int *list, real *dist_max){
2391:   assert(SparseMatrix_is_symmetric(A, TRUE));
2477:   SparseMatrix A = A0;
2483:   if (!SparseMatrix_is_symmetric(A, TRUE)){
2484:     A = SparseMatrix_symmetrize(A, TRUE);
2493:   assert(SparseMatrix_is_symmetric(A, TRUE));
2521:       dist_max = SparseMatrix_pseudo_diameter_weighted(A, root, FALSE, &end11, &end22, connectedQ);
2534:   if (A != A0) SparseMatrix_delete(A);
2541:   SparseMatrix A = A0;
2548:   if (!SparseMatrix_is_symmetric(A, TRUE)){
2549:     A = SparseMatrix_symmetrize(A, TRUE);
2552:   assert(SparseMatrix_is_symmetric(A, TRUE));
2554:   SparseMatrix_level_sets(A, root, &nlevel, &levelset_ptr, &levelset, &mask, TRUE);
2561:     SparseMatrix_level_sets(A, root, &nlevel, &levelset_ptr, &levelset, &mask, TRUE);
2576:       nlevel = (int) SparseMatrix_pseudo_diameter_unweighted(A, root, FALSE, &enda, &endb, connectedQ);
2588:   if (A != A0) SparseMatrix_delete(A);
2594:   return SparseMatrix_pseudo_diameter_unweighted(A, 0, FALSE, &end1, &end2, &connectedQ);
2599:   SparseMatrix A = A0;
2601:   if (!SparseMatrix_is_symmetric(A, TRUE)){
2603:     A = SparseMatrix_symmetrize(A, TRUE);
2606:   SparseMatrix_level_sets(A, root, &nlevel, &levelset_ptr, &levelset, &mask, TRUE);
2612:   if (A != A0) SparseMatrix_delete(A);
2723:   SparseMatrix B = NULL;
2751:   B = SparseMatrix_from_coordinate_arrays(nz, m + n, m + n, irn, jcn, val, type);
2752:   SparseMatrix_set_symmetric(B);
2753:   SparseMatrix_set_pattern_symmetric(B);
2762:   SparseMatrix B;
2768:     if (A->m == A->n && SparseMatrix_is_symmetric(A, TRUE)) return A;
2771:     if (A->m == A->n && SparseMatrix_is_symmetric(A, FALSE)) return A;
2778:   B = SparseMatrix_get_augmented(A);
2779:   SparseMatrix_delete(A);
2792:   SparseMatrix B = NULL;
2926:   B = SparseMatrix_from_coordinate_arrays(nz, nrow, ncol, irn, jcn, v, A->type);
2941:   SparseMatrix B;
2969:   B = SparseMatrix_get_submatrix(A, nr, nc, r, c);
2978:   SparseMatrix B;
2986:   A = SparseMatrix_to_square_matrix(A, BIPARTITE_RECT);
2987:   SparseMatrix_weakly_connected_components(A, &ncomp, &comps, &comps_ptr);
2998:     B = SparseMatrix_get_submatrix(A, nmax, nmax, &comps[comps_ptr[imax]], &comps[comps_ptr[imax]]);
3012:   SparseMatrix B;
3020:   B = SparseMatrix_transpose(A);
3037:   SparseMatrix_delete(B);
3042:     B = SparseMatrix_copy(A);
3072:   SparseMatrix B = A;
3079:   if (undirected) B = SparseMatrix_symmetrize(A, TRUE);
3103:   if (B != A) SparseMatrix_delete(B);
3104:   B = SparseMatrix_from_coordinate_arrays(nz, m, n, irn, jcn, NULL, MATRIX_TYPE_PATTERN);
Rgraphviz:src/graphviz/lib/sfdpgen/sparse_solve.c: [ ]
249: real SparseMatrix_solve(SparseMatrix A, int dim, real *x0, real *rhs, real tol, int maxit, int method, int *flag){
29:   SparseMatrix A;
39:   SparseMatrix A = d->A;
44:   SparseMatrix_multiply_vector(A, x, &y, FALSE);
56: Operator Operator_uniform_stress_matmul(SparseMatrix A, real alpha){
70:   SparseMatrix A = (SparseMatrix) o->data;
71:   SparseMatrix_multiply_vector(A, x, &y, FALSE);
75: Operator Operator_matmul_new(SparseMatrix A){
100: Operator Operator_uniform_stress_diag_precon_new(SparseMatrix A, real alpha){
129: Operator Operator_diag_precon_new(SparseMatrix A){
Rgraphviz:src/graphviz/lib/neatogen/adjust.c: [ ]
699: SparseMatrix makeMatrix(Agraph_t* g, int dim, SparseMatrix *D)
701:     SparseMatrix A = 0;
761:     A = SparseMatrix_from_coordinate_arrays(nedges, nnodes, nnodes, I, J,
764:     if (D) *D = SparseMatrix_from_coordinate_arrays(nedges, nnodes, nnodes, I, J, valD, type);
778:     SparseMatrix A0 = makeMatrix(g, Ndim, NULL);
779:     SparseMatrix A = A0;
803:     if (!SparseMatrix_is_symmetric(A, FALSE)
805: 	A = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
807: 	A = SparseMatrix_remove_diagonal(A);
823: 	SparseMatrix_delete(A);
824:     SparseMatrix_delete (A0);
Rgraphviz:src/graphviz/lib/sfdpgen/spring_electrical.c: [ ]
14: #include "SparseMatrix.h"
141: real average_edge_length(SparseMatrix A, int dim, real *coord){
144:   assert(SparseMatrix_is_symmetric(A, TRUE));
160: static real spring_electrical_energy(int dim, SparseMatrix A, real *x, real p, real CRK, real KP){
197: void export_embedding(FILE *fp, int dim, SparseMatrix A, real *x, real *width){
354: static void beautify_leaves(int dim, SparseMatrix A, real *x){
362:   assert(!SparseMatrix_has_diagonal(A));
465: void spring_electrical_embedding_fast(int dim, SparseMatrix A0, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){
467:   SparseMatrix A = A0;
500:   A = SparseMatrix_symmetrize(A, TRUE);
645:   if (A != A0) SparseMatrix_delete(A);
651: void spring_electrical_embedding_slow(int dim, SparseMatrix A0, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){
654:   SparseMatrix A = A0;
698:   A = SparseMatrix_symmetrize(A, TRUE);
902:   if (A != A0) SparseMatrix_delete(A);
913: void spring_electrical_embedding(int dim, SparseMatrix A0, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){
915:   SparseMatrix A = A0;
955:   A = SparseMatrix_symmetrize(A, TRUE);
1148:   if (A != A0) SparseMatrix_delete(A);
1196: void spring_maxent_embedding(int dim, SparseMatrix A0, SparseMatrix D, spring_electrical_control ctrl, real *node_weights, real *x, real rho, int *flag){
1216:   SparseMatrix A = A0;
1255:   A = SparseMatrix_symmetrize(A, TRUE);
1463:   if (A != A0) SparseMatrix_delete(A);
1473: void spring_electrical_spring_embedding(int dim, SparseMatrix A0, SparseMatrix D, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){
1477:   SparseMatrix A = A0;
1510:   A = SparseMatrix_symmetrize(A, TRUE);
1673:   if (A != A0) SparseMatrix_delete(A);
1700: static void interpolate2(int dim, SparseMatrix A, real *x){
1727: static void interpolate(int dim, SparseMatrix A, real *x){
1750: static void prolongate(int dim, SparseMatrix A, SparseMatrix P, SparseMatrix R, real *x, real *y, int coarsen_scheme_used, real delta){
1752:   SparseMatrix_multiply_dense(P, FALSE, x, FALSE, &y, FALSE, dim);
1772: int power_law_graph(SparseMatrix A){
1879: static void attach_edge_label_coordinates(int dim, SparseMatrix A, int n_edge_label_nodes, int *edge_label_nodes, real *x, real *x2){
1924: static SparseMatrix shorting_edge_label_nodes(SparseMatrix A, int n_edge_label_nodes, int *edge_label_nodes){
1928:   SparseMatrix B;
1989:   B = SparseMatrix_from_coordinate_arrays(nz, id, id, irn, jcn, NULL, MATRIX_TYPE_PATTERN);
1998: void multilevel_spring_electrical_embedding(int dim, SparseMatrix A0, SparseMatrix D0, spring_electrical_control ctrl, real *node_weights, real *label_sizes, 
2004:   SparseMatrix A = A0, D = D0, P = NULL;
2023:   if (!SparseMatrix_is_symmetric(A, FALSE) || A->type != MATRIX_TYPE_REAL){
2025:       A = SparseMatrix_symmetrize_nodiag(A, FALSE);
2027:       D = SparseMatrix_symmetrize_nodiag(D, FALSE);
2029:       A = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
2034:       D = SparseMatrix_remove_diagonal(D);
2036:     A = SparseMatrix_remove_diagonal(A);
2042:     SparseMatrix A2;
2052:     SparseMatrix_delete(A2);
2054:     if (A != A0) SparseMatrix_delete(A);
2173:   if (A != A0) SparseMatrix_delete(A);
2174:   if (D && D != D0) SparseMatrix_delete(D);
Rgraphviz:src/graphviz/lib/sfdpgen/Multilevel.c: [ ]
48: static Multilevel Multilevel_init(SparseMatrix A, SparseMatrix D, real *node_weights){
71: 	SparseMatrix_delete(grid->A);
72: 	if (grid->D) SparseMatrix_delete(grid->D);
75:       SparseMatrix_delete(grid->A);
76:       if (grid->D) SparseMatrix_delete(grid->D);
79:   SparseMatrix_delete(grid->P);
80:   SparseMatrix_delete(grid->R);
86: static void maximal_independent_vertex_set(SparseMatrix A, int randomize, int **vset, int *nvset, int *nzc){
89:   assert(SparseMatrix_known_strucural_symmetric(A));
130: static void maximal_independent_vertex_set_RS(SparseMatrix A, int randomize, int **vset, int *nvset, int *nzc){
141:   assert(SparseMatrix_known_strucural_symmetric(A));
202: static void maximal_independent_edge_set(SparseMatrix A, int randomize, int **matching, int *nmatch){
205:   assert(SparseMatrix_known_strucural_symmetric(A));
245: static void maximal_independent_edge_set_heavest_edge_pernode(SparseMatrix A, int randomize, int **matching, int *nmatch){
251:   assert(SparseMatrix_known_strucural_symmetric(A));
261:   assert(SparseMatrix_is_symmetric(A, FALSE));
326: static void maximal_independent_edge_set_heavest_edge_pernode_leaves_first(SparseMatrix A, int randomize, int **cluster, int **clusterp, int *ncluster){
334:   assert(SparseMatrix_known_strucural_symmetric(A));
346:   assert(SparseMatrix_is_symmetric(A, FALSE));
501: static void maximal_independent_edge_set_heavest_edge_pernode_supernodes_first(SparseMatrix A, int randomize, int **cluster, int **clusterp, int *ncluster){
510:   assert(SparseMatrix_known_strucural_symmetric(A));
522:   assert(SparseMatrix_is_symmetric(A, FALSE));
525:   SparseMatrix_decompose_to_supervariables(A, &nsuper, &super, &superp);
644: static void maximal_independent_edge_set_heavest_cluster_pernode_leaves_first(SparseMatrix A, int csize, 
653:   assert(SparseMatrix_known_strucural_symmetric(A));
666:   assert(SparseMatrix_is_symmetric(A, FALSE));
740: static void maximal_independent_edge_set_heavest_edge_pernode_scaled(SparseMatrix A, int randomize, int **matching, int *nmatch){
746:   assert(SparseMatrix_known_strucural_symmetric(A));
756:   assert(SparseMatrix_is_symmetric(A, FALSE));
815: SparseMatrix DistanceMatrix_restrict_cluster(int ncluster, int *clusterp, int *cluster, SparseMatrix P, SparseMatrix R, SparseMatrix D){
818:   SparseMatrix cD = NULL;
897:     SparseMatrix A;
898:     A = SparseMatrix_from_coordinate_arrays(nz[nz[i]], nnodes[i], nnodes[i], irn[i], jcn[i], (void*) val[i], MATRIX_TYPE...(7 bytes skipped)...
900:     SparseMatrix_delete(A);
913:   cD = SparseMatrix_multiply3(R, D, P); 
915:   SparseMatrix_set_symmetric(cD);
916:   SparseMatrix_set_pattern_symmetric(cD);
917:   cD = SparseMatrix_remove_diagonal(cD);
935: SparseMatrix DistanceMatrix_restrict_matching(int *matching, SparseMatrix D){
941: SparseMatrix DistanceMatrix_restrict_filtering(int *mask, int is_C, int is_F, SparseMatrix D){
948: static void Multilevel_coarsen_internal(SparseMatrix A, SparseMatrix *cA, SparseMatrix D, SparseMatrix *cD,
950: 					SparseMatrix *P, SparseMatrix *R, Multilevel_control ctrl, int *coarsen_scheme_used){
954:   SparseMatrix B = NULL;
1046:     *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, (void *) val, MATRIX_TYPE_REAL);
1047:     *R = SparseMatrix_transpose(*P);
1051:     *cA = SparseMatrix_multiply3(*R, A, *P); 
1054:       B = SparseMatrix_multiply(*R, A);
1056:       *cA = SparseMatrix_multiply(B, *P); 
1060:     SparseMatrix_multiply_vector(*R, node_wgt, cnode_wgt, FALSE);
1061:     *R = SparseMatrix_divide_row_by_degree(*R);
1062:     SparseMatrix_set_symmetric(*cA);
1063:     SparseMatrix_set_pattern_symmetric(*cA);
1064:     *cA = SparseMatrix_remove_diagonal(*cA);
1110:     *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, (void *) val, MATRIX_TYPE_REAL);
1111:     *R = SparseMatrix_transpose(*P);
1112:     *cA = SparseMatrix_multiply3(*R, A, *P); 
1114:       B = SparseMatrix_multiply(*R, A);
1116:       *cA = SparseMatrix_multiply(B, *P); 
1119:     SparseMatrix_multiply_vector(*R, node_wgt, cnode_wgt, FALSE);
1120:     *R = SparseMatrix_divide_row_by_degree(*R);
1121:     SparseMatrix_set_symmetric(*cA);
1122:     SparseMatrix_set_pattern_symmetric(*cA);
1123:     *cA = SparseMatrix_remove_diagonal(*cA);
1175:     *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, (void *) val, MATRIX_TYPE_REAL);
1176:     *R = SparseMatrix_transpose(*P);
1177:     *cA = SparseMatrix_multiply3(*R, A, *P); 
1179:     SparseMatrix_multiply_vector(*R, node_wgt, cnode_wgt, FALSE);
1180:     SparseMatrix_set_symmetric(*cA);
1181:     SparseMatrix_set_pattern_symmetric(*cA);
1182:     *cA = SparseMatrix_remove_diagonal(*cA);
1195:   if (B) SparseMatrix_delete(B);
1198: void Multilevel_coarsen(SparseMatrix A, SparseMatrix *cA, SparseMatrix D, SparseMatrix *cD, real *node_wgt, real **cnode_wgt,
1199: 			       SparseMatrix *P, SparseMatrix *R, Multilevel_control ctrl, int *coarsen_scheme_used){
1200:   SparseMatrix cA0 = A,  cD0 = NULL, P0 = NULL, R0 = NULL, M;
1218:       M = SparseMatrix_multiply(*P, P0);
1219:       SparseMatrix_delete(*P);
1220:       SparseMatrix_delete(P0);
1222:       M = SparseMatrix_multiply(R0, *R);
1223:       SparseMatrix_delete(*R);
1224:       SparseMatrix_delete(R0);
1231:     if (*cA) SparseMatrix_delete(*cA);
1233:     if (*cD) SparseMatrix_delete(*cD);
1254:   SparseMatrix P, R, A, cA, D, cD;
1291: Multilevel Multilevel_new(SparseMatrix A0, SparseMatrix D0, real *node_weights, Multilevel_control ctrl){
1294:   SparseMatrix A = A0, D = D0;
1296:   if (!SparseMatrix_is_symmetric(A, FALSE) || A->type != MATRIX_TYPE_REAL){
1297:     A = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
1299:   if (D && (!SparseMatrix_is_symmetric(D, FALSE) || D->type != MATRIX_TYPE_REAL)){
1300:     D = SparseMatrix_symmetrize_nodiag(D, FALSE);
Rgraphviz:src/graphviz/lib/neatogen/overlap.c: [ ]
20: #include "SparseMatrix.h"
29: static void ideal_distance_avoid_overlap(int dim, SparseMatrix A, real *x, real *width, real *ideal_distance, real *tmax, real *tmin){
42:   assert(SparseMatrix_is_symmetric(A, FALSE));
139: static SparseMatrix get_overlap_graph(int dim, int n, real *x, real *width){
142:   SparseMatrix A = NULL, B = NULL;
147:   A = SparseMatrix_new(n, n, 1, MATRIX_TYPE_REAL, FORMAT_COORD);
208: 	A = SparseMatrix_coordinate_form_add_entries(A, 1, &neighbor, &k, &one);
237:   B = SparseMatrix_from_coordinate_format(A);
238:   SparseMatrix_delete(A);
239:   A = SparseMatrix_symmetrize(B, FALSE);
240:   SparseMatrix_delete(B);
261: static relative_position_constraints relative_position_constraints_new(SparseMatrix A_constr, int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes){
277: OverlapSmoother OverlapSmoother_new(SparseMatrix A, int m, 
280: 				    int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int shrink
284:   SparseMatrix B;
287:   assert((!A) || SparseMatrix_is_symmetric(A, FALSE));
305:     SparseMatrix C, D;
307:     D = SparseMatrix_add(B, C);
308:     SparseMatrix_delete(B);
309:     SparseMatrix_delete(C);
313:     sm->Lw = SparseMatrix_add(A, B);
314:     SparseMatrix_delete(B);
318:   sm->Lwd = SparseMatrix_copy(sm->Lw);
407: static void scale_to_edge_length(int dim, SparseMatrix A, real *x, real avg_label_size){
449: void remove_overlap(int dim, SparseMatrix A, real *x, real *label_sizes, int ntry, real initial_scaling, 
450: 		    int edge_labeling_scheme, int n_constr_nodes, int *constr_nodes, SparseMatrix A_constr, int *flag){
583: #include "SparseMatrix.h"
584: void remove_overlap(int dim, SparseMatrix A, int m, real *x, real *label_sizes, int ntry, real initial_scaling, int *flag)
Rgraphviz:src/graphviz/lib/sfdpgen/post_process.c: [ ]
35: SparseMatrix ideal_distance_matrix(SparseMatrix A, int dim, real *x){
38:   SparseMatrix D;
44:   assert(SparseMatrix_is_symmetric(A, FALSE));
46:   D = SparseMatrix_copy(A);
103: StressMajorizationSmoother StressMajorizationSmoother2_new(SparseMatrix A, int dim, real lambda0, real *x, 
111:   SparseMatrix ID;
113:   assert(SparseMatrix_is_symmetric(A, FALSE));
165:   sm->Lw = SparseMatrix_new(m, m, nz + m, MATRIX_TYPE_REAL, FORMAT_CSR);
166:   sm->Lwd = SparseMatrix_new(m, m, nz + m, MATRIX_TYPE_REAL, FORMAT_CSR);
286:   SparseMatrix_delete(ID);
290: StressMajorizationSmoother SparseStressMajorizationSmoother_new(SparseMatrix A, int dim, real lambda0, real *x, int weighting_scheme){
301:   assert(SparseMatrix_is_symmetric(A, FALSE) && A->type == MATRIX_TYPE_REAL);
324:   sm->Lw = SparseMatrix_new(m, m, nz + m, MATRIX_TYPE_REAL, FORMAT_CSR);
325:   sm->Lwd = SparseMatrix_new(m, m, nz + m, MATRIX_TYPE_REAL, FORMAT_CSR);
425: static void get_edge_label_matrix(relative_position_constraints data, int m, int dim, real *x, SparseMatrix *LL, real **rhs){
429:   SparseMatrix A_constr = data->A_constr;
434:   SparseMatrix Lc = NULL;
490:     Lc = SparseMatrix_from_coordinate_arrays(nz, m, m, irn, jcn, val, MATRIX_TYPE_REAL);
520:     Lc = SparseMatrix_from_coordinate_arrays(nz, m, m, irn, jcn, val, MATRIX_TYPE_REAL);
563: static real uniform_stress_solve(SparseMatrix Lw, real alpha, int dim, real *x0, real *rhs, real tol, int maxit, int *flag){
576:   SparseMatrix Lw = sm->Lw, Lwd = sm->Lwd, Lwdd = NULL;
579:   SparseMatrix Lc = NULL;
581:   Lwdd = SparseMatrix_copy(Lwd);
599:     if (Lc) Lw = SparseMatrix_add(Lw, Lc);
624:     SparseMatrix_multiply_dense(Lwdd, FALSE, x, FALSE, &y, FALSE, dim);
652:       res = SparseMatrix_solve(Lw, dim, x, y, 0.01, maxit, SOLVE_METHOD_CG, &flag);
673:   SparseMatrix_delete(Lwdd);
675:     SparseMatrix_delete(Lc);
676:     SparseMatrix_delete(Lw);
688:   if (sm->Lw) SparseMatrix_delete(sm->Lw);
689:   if (sm->Lwd) SparseMatrix_delete(sm->Lwd);
696: TriangleSmoother TriangleSmoother_new(SparseMatrix A, int dim, real lambda0, real *x, int use_triangularization){
699:   SparseMatrix B;
703:   assert(SparseMatrix_is_symmetric(A, FALSE));
734:     B = SparseMatrix_copy(A);
739:   sm->Lw = SparseMatrix_add(A, B);
741:   SparseMatrix_delete(B);
742:   sm->Lwd = SparseMatrix_copy(sm->Lw);
808: SpringSmoother SpringSmoother_new(SparseMatrix A, int dim, spring_electrical_control ctrl, real *x){
814:   SparseMatrix ID = NULL;
816:   assert(SparseMatrix_is_symmetric(A, FALSE));
862:   sm->D = SparseMatrix_new(m, m, nz, MATRIX_TYPE_REAL, FORMAT_CSR);
910:   SparseMatrix_delete(ID);
918:   if (sm->D) SparseMatrix_delete(sm->D);
925: void SpringSmoother_smooth(SpringSmoother sm, SparseMatrix A, real *node_weights, int dim, real *x){
935: void post_process_smoothing(int dim, SparseMatrix A, spring_electrical_control ctrl, real *node_weights, real *x, int *flag){
Rgraphviz:src/graphviz/lib/sfdpgen/sfdpinit.c: [ ]
106:     SparseMatrix D = NULL;
107:     SparseMatrix A;
149:     SparseMatrix_delete (A);
150:     if (D) SparseMatrix_delete (D);
Rgraphviz:src/graphviz/lib/sfdpgen/uniform_stress.c: [ ]
2: #include "SparseMatrix.h"
10: UniformStressSmoother UniformStressSmoother_new(int dim, SparseMatrix A, real *x, real alpha, real M, int *flag){
17:   assert(SparseMatrix_is_symmetric(A, FALSE));
29:   sm->Lw = SparseMatrix_new(m, m, A->nz + m, MATRIX_TYPE_REAL, FORMAT_CSR);
30:   sm->Lwd = SparseMatrix_new(m, m, A->nz + m, MATRIX_TYPE_REAL, FORMAT_CSR);
90: SparseMatrix get_distance_matrix(SparseMatrix A, real scaling){
93:   SparseMatrix B;
98:     B = SparseMatrix_symmetrize(A, FALSE);
100:     B = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
109: void uniform_stress(int dim, SparseMatrix A, real *x, int *flag){
114:   SparseMatrix B = NULL;
143:   assert(SparseMatrix_is_symmetric(B, FALSE));
163:   SparseMatrix_delete(B);
Rgraphviz:src/graphviz/lib/neatogen/call_tri.c: [ ]
18: #include "SparseMatrix.h"
23: SparseMatrix call_tri(int n, int dim, real * x)
27:     SparseMatrix A;
28:     SparseMatrix B;
45:     A = SparseMatrix_new(n, n, 1, MATRIX_TYPE_REAL, FORMAT_COORD);
49: 	SparseMatrix_coordinate_form_add_entries(A, 1, &(ii), &(jj), &one);
54: 	SparseMatrix_coordinate_form_add_entries(A, 1, &(ii), &(jj), &one);
57: 	SparseMatrix_coordinate_form_add_entries(A, 1, &i, &i, &one);
59:     B = SparseMatrix_from_coordinate_format(A);
60:     B = SparseMatrix_symmetrize(B, FALSE);
61:     SparseMatrix_delete(A);
69: SparseMatrix call_tri2(int n, int dim, real * xx)
74:     SparseMatrix A;
75:     SparseMatrix B;
87:     A = SparseMatrix_new(n, n, 1, MATRIX_TYPE_REAL, FORMAT_COORD);
91: 	    SparseMatrix_coordinate_form_add_entries(A, 1, &i,
97: 	SparseMatrix_coordinate_form_add_entries(A, 1, &i, &i, &one);
99:     B = SparseMatrix_from_coordinate_format(A);
100:     B = SparseMatrix_symmetrize(B, FALSE);
101:     SparseMatrix_delete(A);
Rgraphviz:src/graphviz/lib/sfdpgen/stress_model.c: [ ]
2: #include "SparseMatrix.h"
7: void stress_model(int dim, SparseMatrix B, real **x, int maxit_sm, real tol, int *flag){
13:   SparseMatrix A = B;
15:   if (!SparseMatrix_is_symmetric(A, FALSE) || A->type != MATRIX_TYPE_REAL){
17:       A = SparseMatrix_symmetrize(A, FALSE);
18:       A = SparseMatrix_remove_diagonal(A);
20:       A = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
23:   A = SparseMatrix_remove_diagonal(A);
48:   if (A != B) SparseMatrix_delete(A);