Found 258 results in 3 files, showing top 3 files (show more).
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/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);