From 10638c445d1f12bb3fcd0c45946ec8a2e3af60af Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Tue, 4 May 2021 21:41:39 -0700 Subject: [PATCH] replace int-to-string operation in attached_clustering with new itos This commit serves to demonstrate how to use the function added in the prior commit. --- lib/sparse/DotIO.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index 8bfe6d043..59cb331a7 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -9,6 +9,7 @@ *************************************************************************/ #define STANDALONE +#include #include #include #include @@ -1031,8 +1032,6 @@ void attached_clustering(Agraph_t* g, int maxcluster, int clustering_scheme){ real v; int type = MATRIX_TYPE_REAL; size_t sz = sizeof(real); - char scluster[100]; - int *clusters; @@ -1092,8 +1091,7 @@ void attached_clustering(Agraph_t* g, int maxcluster, int clustering_scheme){ for (i = 0; i < nnodes; i++) (clusters)[i]++;/* make into 1 based */ for (n = agfstnode (g); n; n = agnxtnode (g, n)) { i = ND_id(n); - sprintf(scluster,"%d",(clusters)[i]); - agxset(n,clust_sym,scluster); + agxset(n, clust_sym, itos((clusters)[i]).str); } if (Verbose){ fprintf(stderr," no complement clustering info in dot file, using modularity clustering. Modularity = %f, ncluster=%d\n",modularity, nc); -- 2.40.0