return 1;
}
initDotIO(g);
- A = SparseMatrix_import_dot(g, dim, &label_sizes, &x, &n_edge_label_nodes, nullptr, FORMAT_CSR, nullptr);
+ A = SparseMatrix_import_dot(g, dim, &label_sizes, &x, &n_edge_label_nodes,
+ nullptr, FORMAT_CSR);
if (!A){
agerr (AGERR, "Error: could not convert graph %s (%s) into matrix\n", agnameof(g), fname);
return 1;
char **xsplines = NULL;
int cdim;
- A = SparseMatrix_import_dot(g, dim, NULL, &x, NULL, NULL, FORMAT_COORD, NULL);
+ A = SparseMatrix_import_dot(g, dim, NULL, &x, NULL, NULL, FORMAT_COORD);
if (!x){
fprintf(stderr,"The gv file contains no or improper 2D coordinates\n");
return NULL;
* Assumes g is connected and simple, i.e., we can have a->b and b->a
* but not a->b and a->b
*/
-SparseMatrix
-SparseMatrix_import_dot (Agraph_t* g, int dim, double **label_sizes, double **x, int *n_edge_label_nodes, int **edge_label_nodes, int format, SparseMatrix *D)
-{
+SparseMatrix SparseMatrix_import_dot(Agraph_t *g, int dim, double **label_sizes,
+ double **x, int *n_edge_label_nodes,
+ int **edge_label_nodes, int format) {
SparseMatrix A = 0;
Agnode_t* n;
Agedge_t* e;
- Agsym_t *sym, *symD = NULL;
+ Agsym_t *sym;
Agsym_t *psym;
int nnodes;
int nedges;
int i, row;
int* I;
int* J;
- double *val, *valD = NULL;
+ double *val;
double v;
int type = MATRIX_TYPE_REAL;
double padding = 10;
}
sym = agattr(g, AGEDGE, "weight", NULL);
- if (D) {
- symD = agattr(g, AGEDGE, "len", NULL);
- valD = N_NEW(nedges, double);
- }
i = 0;
for (n = agfstnode (g); n; n = agnxtnode (g, n)) {
if (edge_label_nodes && strncmp(agnameof(n), "|edgelabel|",11)==0) nedge_nodes++;
}
val[i] = v;
- /* edge length */
- if (symD) {
- if (sscanf (agxget (e, symD), "%lf", &v) != 1) {
- v = 72;
- } else {
- v *= 72;/* len is specified in inch. Convert to points */
- }
- valD[i] = v;
- } else if (valD) {
- valD[i] = 72;
- }
-
i++;
}
}
if (format == FORMAT_CSR) A = SparseMatrix_from_coordinate_arrays(nedges, nnodes, nnodes, I, J, val, type, sz);
if (edge_label_nodes) *n_edge_label_nodes = nedge_nodes;
- if (D) *D = SparseMatrix_from_coordinate_arrays(nedges, nnodes, nnodes, I, J, valD, type, sz);
-
done:
if (format != FORMAT_COORD){
free(I);
free(J);
free(val);
}
- free(valD);
return A;
}
extern void attach_edge_colors(Agraph_t* g, int dim, double *colors);
-extern SparseMatrix SparseMatrix_import_dot(Agraph_t* g, int dim, double **label_sizes, double **x, int *n_edge_label_nodes,
- int **edge_label_nodes, int format, SparseMatrix *D);
+extern SparseMatrix SparseMatrix_import_dot(Agraph_t *g, int dim,
+ double **label_sizes, double **x,
+ int *n_edge_label_nodes,
+ int **edge_label_nodes,
+ int format);
char * hue2rgb(double hue, char *color);
SparseMatrix Import_coord_clusters_from_dot(Agraph_t* g, int maxcluster, int dim, int *nn, double **label_sizes, double **x, int **clusters, float **rgb_r, float **rgb_g, float **rgb_b, float **fsz, char ***labels, int default_color_scheme, int clustering_scheme, int useClusters);