igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] matrix problem


From: Tamas Nepusz
Subject: Re: [igraph] matrix problem
Date: Mon, 11 Oct 2010 21:56:34 +0100

> int CriaRede(igraph_t* grafo, int dist, Mat* dados){
>  igraph_matrix_t w_adj;
> 
>  printf("   - Inicializando WAdj ... \t");
>  igraph_matrix_init(&w_adj, (long int)dados->i, (long int)dados->i);
>  printf("[ OK ]\n");
> 
> ...
> 
> }
I highly suspect that your "dados" parameter is wrong, either it is not 
allocated, or you are passing the wrong pointer in there, that's why you are 
getting your error. Try adding this line after your printf:

printf("   - dados = %p, dados->i = %ld\n", dados, (long int)dados->i);

I guess that the segmentation fault will happen also on this line, showing that 
"dados" is incorrect.

-- 
Tamas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]