[Top][All Lists]

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

[igraph] igraph_matrix_copy_to()

From: Fernando Martinez
Subject: [igraph] igraph_matrix_copy_to()
Date: Mon, 28 Jun 2010 18:44:54 +0100
User-agent: Thunderbird (X11/20090817)

Dear All,

I'm having problems when using the function igraph_matrix_copy_to()

As I understand it, this function allows to copy an igraph matrix into a normal 
C matrix. However, I get an error when compiling.

My code is the following:


#include <igraph.h>

int main()

        igraph_matrix_t matriz;
        igraph_vector_t vec;
        igraph_vs_t from;
        igraph_neimode_t mode = IGRAPH_ALL;

        long numberofnodes=512;

        long distances[numberofnodes][numberofnodes];


        igraph_shortest_paths(&graph, &matriz, from, mode);

        igraph_matrix_copy_to(&matriz, distances);




I compile in Unbuntu 9.04

g++ -I/igraph -L/lib w1024.cpp -ligraph -lgsl -lgslcblas -o w1024

and gives error for the line of "igraph_matrix_copy_to(&matriz, distances);":

error: cannot convert `long int (*)[((long unsigned int)((long 
int)numberofnodes))]' to `igraph_real_t*' for argument `2' to `int 
igraph_matrix_copy_to(const igraph_matrix_t*, igraph_real_t*)'

Any ideas on how to pass the data from the igraph matrix to a C matrix?


reply via email to

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