[Nauty] dynamic memory allocation

Brendan McKay bdm at cs.anu.edu.au
Tue Aug 19 13:24:01 EST 2003


The DYNALLSTAT declares two variables, given by the second and
third arguments.  So you are declaring "g_sz" twice.  All you have
to do is change the name of one of them, for example
DYNALLSTAT(graph, canong, canong_sz);
DYNALLSTAT(graph, g, g_sz);
 ...and then
   DYNALLOC2(graph,g,g_sz,n,n,"malloc");
   DYNALLOC2(graph,canong,canong_sz,n,n,"malloc");

I use the convention that the name of the third argument is the
same as the second except for appending "_sz".  It isn't required
but helps to prevent some difficult bugs.

Brendan.


* Angela Jo Pignotti <pignotti at email.arc.nasa.gov> [030819 10:18]:
> Hello All,
> 	I'm trying to dynamically allocate to variables of type graph with:
> line 33:  DYNALLSTAT(graph, canong, g_sz);
> line 34:  DYNALLSTAT(graph, g, g_sz);
> ...and then 
>   DYNALLOC2(graph,g,g_sz,n,n,"malloc");
>   DYNALLOC2(graph,canong,g_sz,n,n,"malloc");
> 
> but am receiving the error: 
> getCanonize_c.c:34: redeclaration of `g_sz'
> getCanonize_c.c:33: `g_sz' previously declared here
> 
> Does anyone know of this problem?? 
> thanks,
> Angela
> 
> Angela Pignotti
> Graduate Student Intern
> Mission Critical Technologies
> located at NASA-Ames Research Ctr.
> Bldg. 258 Rm. 201
> ph: 415-604-4313
> 
> 
> _______________________________________________
> This is the nauty mailing list
> Post messages to nauty-list at cs.anu.edu.au
> nauty page: http://cs.anu.edu.au/~bdm/nauty/
> list page: http://cs.anu.edu.au/mailman/listinfo/nauty-list




More information about the Nauty mailing list